-
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.
Create new ksutomize source for cluster templates
Created separate cluster templates for docker and vm hosts
- Loading branch information
Showing
11 changed files
with
355 additions
and
8 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
176 changes: 176 additions & 0 deletions
176
test/e2e/data/infrastructure-provider-byoh/v1beta1/templates/vm/cluster-template.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,176 @@ | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
namespace: default | ||
spec: | ||
template: | ||
spec: {} | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
labels: | ||
cni: ${CLUSTER_NAME}-crs-0 | ||
crs: "true" | ||
name: ${CLUSTER_NAME} | ||
spec: | ||
clusterNetwork: | ||
pods: | ||
cidrBlocks: | ||
- 192.168.0.0/16 | ||
serviceDomain: cluster.local | ||
services: | ||
cidrBlocks: | ||
- 10.128.0.0/12 | ||
controlPlaneRef: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlane | ||
name: ${CLUSTER_NAME}-control-plane | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoCluster | ||
name: ${CLUSTER_NAME} | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
spec: | ||
clusterName: ${CLUSTER_NAME} | ||
replicas: ${WORKER_MACHINE_COUNT} | ||
selector: | ||
matchLabels: null | ||
template: | ||
metadata: | ||
labels: | ||
nodepool: pool1 | ||
spec: | ||
bootstrap: | ||
configRef: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
name: ${CLUSTER_NAME}-md-0 | ||
clusterName: ${CLUSTER_NAME} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
name: ${CLUSTER_NAME}-md-0 | ||
version: ${KUBERNETES_VERSION} | ||
--- | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlane | ||
metadata: | ||
labels: | ||
nodepool: pool0 | ||
name: ${CLUSTER_NAME}-control-plane | ||
spec: | ||
kubeadmConfigSpec: | ||
clusterConfiguration: | ||
apiServer: | ||
certSANs: | ||
- localhost | ||
- 127.0.0.1 | ||
- 0.0.0.0 | ||
- host.docker.internal | ||
controllerManager: | ||
extraArgs: | ||
enable-hostpath-provisioner: "true" | ||
files: | ||
- content: | | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
creationTimestamp: null | ||
name: kube-vip | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- args: | ||
- start | ||
env: | ||
- 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.3.5 | ||
imagePullPolicy: IfNotPresent | ||
name: kube-vip | ||
resources: {} | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
- SYS_TIME | ||
volumeMounts: | ||
- mountPath: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
hostNetwork: true | ||
volumes: | ||
- hostPath: | ||
path: /etc/kubernetes/admin.conf | ||
type: FileOrCreate | ||
name: kubeconfig | ||
status: {} | ||
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 | ||
joinConfiguration: | ||
nodeRegistration: | ||
criSocket: /var/run/containerd/containerd.sock | ||
ignorePreflightErrors: | ||
- Swap | ||
- DirAvailable--etc-kubernetes-manifests | ||
- FileAvailable--etc-kubernetes-kubelet.conf | ||
machineTemplate: | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
name: ${CLUSTER_NAME}-control-plane | ||
namespace: ${NAMESPACE} | ||
replicas: ${CONTROL_PLANE_MACHINE_COUNT} | ||
version: ${KUBERNETES_VERSION} | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoCluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
spec: | ||
bundleLookupBaseRegistry: projects.registry.vmware.com/cluster_api_provider_bringyourownhost | ||
bundleLookupTag: v0.1.0_alpha.2 | ||
controlPlaneEndpoint: | ||
host: ${CONTROL_PLANE_ENDPOINT_IP} | ||
port: 6443 | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
namespace: default | ||
spec: | ||
template: | ||
spec: {} | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-control-plane | ||
spec: | ||
template: | ||
spec: {} |
126 changes: 126 additions & 0 deletions
126
test/e2e/data/infrastructure-provider-byoh/v1beta1/templates/vm/cluster-with-kcp.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,126 @@ | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
labels: | ||
cni: ${CLUSTER_NAME}-crs-0 | ||
crs: "true" | ||
spec: | ||
clusterNetwork: | ||
services: | ||
cidrBlocks: ["10.128.0.0/12"] | ||
pods: | ||
cidrBlocks: ["192.168.0.0/16"] | ||
serviceDomain: "cluster.local" | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoCluster | ||
name: ${CLUSTER_NAME} | ||
controlPlaneRef: | ||
kind: KubeadmControlPlane | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
name: "${CLUSTER_NAME}-control-plane" | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoCluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
spec: | ||
bundleLookupBaseRegistry: projects.registry.vmware.com/cluster_api_provider_bringyourownhost | ||
bundleLookupTag: v0.1.0_alpha.2 | ||
controlPlaneEndpoint: | ||
host: ${CONTROL_PLANE_ENDPOINT_IP} | ||
port: 6443 | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-control-plane" | ||
spec: | ||
template: | ||
spec: {} | ||
--- | ||
kind: KubeadmControlPlane | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
metadata: | ||
name: "${CLUSTER_NAME}-control-plane" | ||
labels: | ||
nodepool: "pool0" | ||
spec: | ||
replicas: ${CONTROL_PLANE_MACHINE_COUNT} | ||
machineTemplate: | ||
infrastructureRef: | ||
kind: ByoMachineTemplate | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
name: "${CLUSTER_NAME}-control-plane" | ||
namespace: "${NAMESPACE}" | ||
kubeadmConfigSpec: | ||
clusterConfiguration: | ||
controllerManager: | ||
extraArgs: {enable-hostpath-provisioner: 'true'} | ||
apiServer: | ||
certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal] | ||
files: | ||
- content: | | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
creationTimestamp: null | ||
name: kube-vip | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- args: | ||
- start | ||
env: | ||
- 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.3.5 | ||
imagePullPolicy: IfNotPresent | ||
name: kube-vip | ||
resources: {} | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
- SYS_TIME | ||
volumeMounts: | ||
- mountPath: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
hostNetwork: true | ||
volumes: | ||
- hostPath: | ||
path: /etc/kubernetes/admin.conf | ||
type: FileOrCreate | ||
name: kubeconfig | ||
status: {} | ||
owner: root:root | ||
path: /etc/kubernetes/manifests/kube-vip.yaml | ||
initConfiguration: | ||
nodeRegistration: | ||
ignorePreflightErrors: | ||
- Swap | ||
- DirAvailable--etc-kubernetes-manifests | ||
- FileAvailable--etc-kubernetes-kubelet.conf | ||
criSocket: /var/run/containerd/containerd.sock | ||
joinConfiguration: | ||
nodeRegistration: | ||
ignorePreflightErrors: | ||
- Swap | ||
- DirAvailable--etc-kubernetes-manifests | ||
- FileAvailable--etc-kubernetes-kubelet.conf | ||
criSocket: /var/run/containerd/containerd.sock | ||
version: ${KUBERNETES_VERSION} |
3 changes: 3 additions & 0 deletions
3
test/e2e/data/infrastructure-provider-byoh/v1beta1/templates/vm/kustomization.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,3 @@ | ||
bases: | ||
- cluster-with-kcp.yaml | ||
- md.yaml |
45 changes: 45 additions & 0 deletions
45
test/e2e/data/infrastructure-provider-byoh/v1beta1/templates/vm/md.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,45 @@ | ||
|
||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
namespace: default | ||
spec: | ||
template: | ||
spec: {} | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
namespace: default | ||
spec: | ||
template: | ||
spec: {} | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: ${CLUSTER_NAME}-md-0 | ||
spec: | ||
clusterName: ${CLUSTER_NAME} | ||
replicas: ${WORKER_MACHINE_COUNT} | ||
selector: | ||
matchLabels: | ||
template: | ||
metadata: | ||
labels: | ||
nodepool: "pool1" | ||
spec: | ||
clusterName: ${CLUSTER_NAME} | ||
version: ${KUBERNETES_VERSION} | ||
bootstrap: | ||
configRef: | ||
name: ${CLUSTER_NAME}-md-0 | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
infrastructureRef: | ||
name: ${CLUSTER_NAME}-md-0 | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: ByoMachineTemplate |