-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added e2e for cluster-class feature and CC docker templates
- Loading branch information
Showing
8 changed files
with
715 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
201 changes: 201 additions & 0 deletions
201
...data/infrastructure-provider-byoh/v1beta1/templates/docker/cluster-template-topology.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
namespace: ${NAMESPACE} | ||
spec: | ||
clusterNetwork: | ||
services: | ||
cidrBlocks: | ||
- 10.128.0.0/12 | ||
pods: | ||
cidrBlocks: | ||
- 192.168.0.0/16 | ||
serviceDomain: cluster.local | ||
topology: | ||
class: quickstart | ||
version: ${KUBERNETES_VERSION} | ||
controlPlane: | ||
metadata: {} | ||
replicas: 1 | ||
variables: | ||
- name: bundleLookupBaseRegistry | ||
value: "projects.registry.vmware.com/cluster_api_provider_bringyourownhost" | ||
- name: controlPlaneIpAddr | ||
value: ${CONTROL_PLANE_ENDPOINT_IP} | ||
- name: kubeVipPodManifest | ||
value: | | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
creationTimestamp: null | ||
name: kube-vip | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- args: | ||
- manager | ||
env: | ||
- name: cp_enable | ||
value: "true" | ||
- name: vip_arp | ||
value: "true" | ||
- name: vip_leaderelection | ||
value: "true" | ||
- name: vip_address | ||
value: ${CONTROL_PLANE_ENDPOINT_IP} | ||
- name: vip_interface | ||
value: "{{ .DefaultNetworkInterfaceName }}" | ||
- name: vip_leaseduration | ||
value: "15" | ||
- name: vip_renewdeadline | ||
value: "10" | ||
- name: vip_retryperiod | ||
value: "2" | ||
image: ghcr.io/kube-vip/kube-vip:v0.4.1 | ||
imagePullPolicy: IfNotPresent | ||
name: kube-vip | ||
resources: {} | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
- NET_RAW | ||
volumeMounts: | ||
- mountPath: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
hostNetwork: true | ||
hostAliases: | ||
- hostnames: | ||
- kubernetes | ||
ip: 127.0.0.1 | ||
volumes: | ||
- hostPath: | ||
path: /etc/kubernetes/admin.conf | ||
type: FileOrCreate | ||
name: kubeconfig | ||
status: {} | ||
workers: | ||
machineDeployments: | ||
- class: quickstart-worker | ||
metadata: {} | ||
name: md-0 | ||
replicas: 1 | ||
--- | ||
kind: KubeadmControlPlaneTemplate | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
metadata: | ||
labels: | ||
nodepool: pool0 | ||
name: quickstart-control-plane | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
spec: | ||
kubeadmConfigSpec: | ||
clusterConfiguration: | ||
apiServer: | ||
certSANs: | ||
- localhost | ||
- 127.0.0.1 | ||
- 0.0.0.0 | ||
- host.docker.internal | ||
controllerManager: | ||
extraArgs: | ||
enable-hostpath-provisioner: "true" | ||
files: | ||
- owner: root:root | ||
path: /etc/kubernetes/manifests/kube-vip.yaml | ||
initConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
ignorePreflightErrors: | ||
- Swap | ||
- DirAvailable--etc-kubernetes-manifests | ||
- FileAvailable--etc-kubernetes-kubelet.conf | ||
kubeletExtraArgs: | ||
cgroup-driver: cgroupfs | ||
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% | ||
joinConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
ignorePreflightErrors: | ||
- Swap | ||
- DirAvailable--etc-kubernetes-manifests | ||
- FileAvailable--etc-kubernetes-kubelet.conf | ||
kubeletExtraArgs: | ||
cgroup-driver: cgroupfs | ||
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
metadata: | ||
name: quickstart-control-plane-machine | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
spec: | ||
installerRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: K8sInstallerConfigTemplate | ||
name: quickstart-control-plane-machine | ||
namespace: "${NAMESPACE}" | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: K8sInstallerConfigTemplate | ||
metadata: | ||
name: quickstart-control-plane-machine | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
spec: | ||
bundleRepo: projects.registry.vmware.com/cluster_api_provider_bringyourownhost | ||
bundleType: k8s | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoClusterTemplate | ||
metadata: | ||
name: quickstart-cluster | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
spec: {} | ||
|
||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
metadata: | ||
name: quickstart-worker-machinetemplate | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
spec: | ||
installerRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: K8sInstallerConfigTemplate | ||
name: ${CLUSTER_NAME}-md-0 | ||
namespace: ${NAMESPACE} | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: K8sInstallerConfigTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
spec: | ||
template: | ||
spec: | ||
bundleRepo: projects.registry.vmware.com/cluster_api_provider_bringyourownhost | ||
bundleType: k8s | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: quickstart-worker-bootstrap-template | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: | ||
spec: | ||
joinConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
cgroup-driver: cgroupfs | ||
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% |
94 changes: 94 additions & 0 deletions
94
...e/data/infrastructure-provider-byoh/v1beta1/templates/docker/clusterclass-quickstart.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: ClusterClass | ||
metadata: | ||
name: quickstart | ||
namespace: ${NAMESPACE} | ||
spec: | ||
controlPlane: | ||
ref: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlaneTemplate | ||
name: quickstart-control-plane | ||
machineInfrastructure: | ||
ref: | ||
kind: ByoMachineTemplate | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
name: quickstart-control-plane-machine | ||
infrastructure: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoClusterTemplate | ||
name: quickstart-cluster | ||
workers: | ||
machineDeployments: | ||
- class: quickstart-worker | ||
template: | ||
bootstrap: | ||
ref: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
name: quickstart-worker-bootstrap-template | ||
infrastructure: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
name: quickstart-worker-machinetemplate | ||
variables: | ||
- name: bundleLookupBaseRegistry | ||
required: true | ||
schema: | ||
openAPIV3Schema: | ||
type: string | ||
default: "https://projects.registry.vmware.com/cluster_api_provider_bringyourownhost" | ||
- name: controlPlaneIpAddr | ||
required: true | ||
schema: | ||
openAPIV3Schema: | ||
type: string | ||
- name: kubeVipPodManifest | ||
required: true | ||
schema: | ||
openAPIV3Schema: | ||
description: kube-vip manifest for the control plane. | ||
type: string | ||
patches: | ||
- name: bundleLookupBaseRegistry | ||
description: "Sets the bundleLookupBaseRegistry used for the BYOCluster." | ||
definitions: | ||
- selector: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoClusterTemplate | ||
matchResources: | ||
infrastructureCluster: true | ||
jsonPatches: | ||
- op: add | ||
path: "/spec/template/spec/bundleLookupBaseRegistry" | ||
valueFrom: | ||
variable: bundleLookupBaseRegistry | ||
- name: controlPlaneEndpoint | ||
description: "Sets control plane endpoint" | ||
definitions: | ||
- selector: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoClusterTemplate | ||
matchResources: | ||
infrastructureCluster: true | ||
jsonPatches: | ||
- op: add | ||
path: "/spec/template/spec/controlPlaneEndpoint" | ||
valueFrom: | ||
template: | | ||
host: '{{ .controlPlaneIpAddr }}' | ||
port: 6443 | ||
- name: kubeVipEnabled | ||
definitions: | ||
- jsonPatches: | ||
- op: add | ||
path: /spec/template/spec/kubeadmConfigSpec/files/0/content | ||
valueFrom: | ||
variable: kubeVipPodManifest | ||
selector: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlaneTemplate | ||
matchResources: | ||
controlPlane: true |
Oops, something went wrong.