This repository was archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add examples for Nutanix provider #5
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
08457eb
[WIP] added nutanix support
deepakm-ntnx e00083a
added nutanix examples for clusterclass and cluster
deepakm-ntnx 1d13297
removed extra $ sign from all the variables
deepakm-ntnx e20cf32
Update hack/examples/sync.sh
deepakm-ntnx 601c6a8
added new line to fix precommit lint
deepakm-ntnx db87f18
fix: removed trailing whitespaces
deepakm-ntnx 7e2b6e6
reverted devbox.lock changes
deepakm-ntnx c1695ce
fix: updated patches to use existing variable
deepakm-ntnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
305 changes: 305 additions & 0 deletions
305
...s/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/nutanix-cluster-class.yaml
This file contains hidden or 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,305 @@ | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/provider: nutanix | ||
name: nutanix-quick-start-kcfg-0 | ||
spec: | ||
template: | ||
spec: | ||
joinConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
cloud-provider: external | ||
eviction-hard: nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<15%,memory.available<100Mi,imagefs.inodesFree<10% | ||
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
deepakm-ntnx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
postKubeadmCommands: | ||
- echo "after kubeadm call" > /var/log/postkubeadm.log | ||
preKubeadmCommands: | ||
- echo "before kubeadm call" > /var/log/prekubeadm.log | ||
- hostnamectl set-hostname "{{ ds.meta_data.hostname }}" | ||
verbosity: 10 | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: ClusterClass | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/provider: nutanix | ||
name: nutanix-quick-start | ||
spec: | ||
controlPlane: | ||
machineHealthCheck: | ||
maxUnhealthy: 40% | ||
nodeStartupTimeout: 10m | ||
unhealthyConditions: | ||
- status: "False" | ||
timeout: 300s | ||
type: Ready | ||
- status: Unknown | ||
timeout: 300s | ||
type: Ready | ||
- status: "True" | ||
timeout: 300s | ||
type: MemoryPressure | ||
- status: "True" | ||
timeout: 300s | ||
type: DiskPressure | ||
- status: "True" | ||
timeout: 300s | ||
type: PIDPressure | ||
- status: "True" | ||
timeout: 300s | ||
type: NetworkUnavailable | ||
machineInfrastructure: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixMachineTemplate | ||
name: nutanix-quick-start-cp-nmt | ||
ref: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlaneTemplate | ||
name: nutanix-quick-start-kcpt | ||
infrastructure: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixClusterTemplate | ||
name: nutanix-quick-start-nct | ||
patches: | ||
- external: | ||
discoverVariablesExtension: nutanixclusterconfigvars.cluster-api-runtime-extensions-nutanix | ||
generateExtension: nutanixclusterconfigpatch.cluster-api-runtime-extensions-nutanix | ||
name: cluster-config | ||
- external: | ||
discoverVariablesExtension: nutanixworkerconfigvars.cluster-api-runtime-extensions-nutanix | ||
generateExtension: nutanixworkerconfigpatch.cluster-api-runtime-extensions-nutanix | ||
name: worker-config | ||
workers: | ||
machineDeployments: | ||
- class: nutanix-quick-start-worker | ||
machineHealthCheck: | ||
maxUnhealthy: 40% | ||
nodeStartupTimeout: 10m | ||
unhealthyConditions: | ||
- status: "False" | ||
timeout: 300s | ||
type: Ready | ||
- status: Unknown | ||
timeout: 300s | ||
type: Ready | ||
- status: "True" | ||
timeout: 300s | ||
type: MemoryPressure | ||
- status: "True" | ||
timeout: 300s | ||
type: DiskPressure | ||
- status: "True" | ||
timeout: 300s | ||
type: PIDPressure | ||
- status: "True" | ||
timeout: 300s | ||
type: NetworkUnavailable | ||
template: | ||
bootstrap: | ||
ref: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
name: nutanix-quick-start-kcfg-0 | ||
infrastructure: | ||
ref: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixMachineTemplate | ||
name: nutanix-quick-start-md-nmt | ||
--- | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmControlPlaneTemplate | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/provider: nutanix | ||
name: nutanix-quick-start-kcpt | ||
spec: | ||
template: | ||
spec: | ||
kubeadmConfigSpec: | ||
clusterConfiguration: | ||
apiServer: | ||
certSANs: | ||
- localhost | ||
- 127.0.0.1 | ||
- 0.0.0.0 | ||
extraArgs: | ||
cloud-provider: external | ||
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
controllerManager: | ||
extraArgs: | ||
cloud-provider: external | ||
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
scheduler: | ||
extraArgs: | ||
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
files: | ||
- content: | | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kube-vip | ||
deepakm-ntnx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
namespace: kube-system | ||
spec: | ||
containers: | ||
- name: kube-vip | ||
image: ghcr.io/kube-vip/kube-vip:v0.6.4 | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- manager | ||
env: | ||
- name: vip_arp | ||
value: "true" | ||
- name: address | ||
value: "${CONTROL_PLANE_ENDPOINT_IP}" | ||
faiq marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: port | ||
value: "${CONTROL_PLANE_ENDPOINT_PORT=6443}" | ||
- name: vip_cidr | ||
value: "32" | ||
- name: cp_enable | ||
value: "true" | ||
- name: cp_namespace | ||
value: kube-system | ||
- name: vip_ddns | ||
value: "false" | ||
- name: vip_leaderelection | ||
value: "true" | ||
- name: vip_leaseduration | ||
value: "15" | ||
- name: vip_renewdeadline | ||
value: "10" | ||
- name: vip_retryperiod | ||
value: "2" | ||
- name: svc_enable | ||
value: "${KUBEVIP_SVC_ENABLE=false}" | ||
- name: lb_enable | ||
value: "${KUBEVIP_LB_ENABLE=false}" | ||
- name: enableServicesElection | ||
value: "${KUBEVIP_SVC_ELECTION=false}" | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
- SYS_TIME | ||
- NET_RAW | ||
volumeMounts: | ||
- mountPath: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
resources: {} | ||
hostNetwork: true | ||
hostAliases: | ||
- hostnames: | ||
- kubernetes | ||
ip: 127.0.0.1 | ||
volumes: | ||
- name: kubeconfig | ||
hostPath: | ||
type: FileOrCreate | ||
path: /etc/kubernetes/admin.conf | ||
status: {} | ||
owner: root:root | ||
path: /etc/kubernetes/manifests/kube-vip.yaml | ||
initConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
cloud-provider: external | ||
eviction-hard: nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<15%,memory.available<100Mi,imagefs.inodesFree<10% | ||
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
joinConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
cloud-provider: external | ||
eviction-hard: nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<15%,memory.available<100Mi,imagefs.inodesFree<10% | ||
tls-cipher-suites: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
postKubeadmCommands: | ||
- echo export KUBECONFIG=/etc/kubernetes/admin.conf >> /root/.bashrc | ||
- | | ||
KUBERNETES_VERSION_NO_V=${KUBERNETES_VERSION#v} | ||
VERSION_TO_COMPARE=1.29.0 | ||
if [ "$(printf '%s\n' "$KUBERNETES_VERSION_NO_V" "$VERSION_TO_COMPARE" | sort -V | head -n1)" != "$KUBERNETES_VERSION_NO_V" ]; then | ||
if [ -f /run/kubeadm/kubeadm.yaml ]; then | ||
sed -i 's#path: /etc/kubernetes/super-admin.conf#path: /etc/kubernetes/admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; | ||
fi | ||
fi | ||
- echo "after kubeadm call" > /var/log/postkubeadm.log | ||
preKubeadmCommands: | ||
- echo "before kubeadm call" > /var/log/prekubeadm.log | ||
- hostnamectl set-hostname "{{ ds.meta_data.hostname }}" | ||
- echo "::1 ipv6-localhost ipv6-loopback" >/etc/hosts | ||
- echo "127.0.0.1 localhost" >>/etc/hosts | ||
- echo "127.0.0.1 kubernetes" >>/etc/hosts | ||
- echo "127.0.0.1 {{ ds.meta_data.hostname }}" >> /etc/hosts | ||
- | | ||
KUBERNETES_VERSION_NO_V=${KUBERNETES_VERSION#v} | ||
VERSION_TO_COMPARE=1.29.0 | ||
if [ "$(printf '%s\n' "$KUBERNETES_VERSION_NO_V" "$VERSION_TO_COMPARE" | sort -V | head -n1)" != "$KUBERNETES_VERSION_NO_V" ]; then | ||
if [ -f /run/kubeadm/kubeadm.yaml ]; then | ||
sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml; | ||
fi | ||
fi | ||
useExperimentalRetryJoin: true | ||
verbosity: 10 | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixClusterTemplate | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/provider: nutanix | ||
name: nutanix-quick-start-nct | ||
spec: | ||
template: | ||
spec: | ||
failureDomains: [] | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixMachineTemplate | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/provider: nutanix | ||
name: nutanix-quick-start-cp-nmt | ||
spec: | ||
template: | ||
spec: | ||
bootType: legacy | ||
cluster: | ||
name: "" | ||
type: name | ||
image: | ||
name: "" | ||
type: name | ||
memorySize: 4Gi | ||
providerID: nutanix://vm-uuid | ||
subnet: | ||
- name: "" | ||
type: name | ||
systemDiskSize: 40Gi | ||
vcpuSockets: 2 | ||
vcpusPerSocket: 1 | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixMachineTemplate | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/provider: nutanix | ||
name: nutanix-quick-start-md-nmt | ||
spec: | ||
template: | ||
spec: | ||
bootType: legacy | ||
cluster: | ||
name: "" | ||
type: name | ||
image: | ||
name: "" | ||
type: name | ||
memorySize: 4Gi | ||
providerID: nutanix://vm-uuid | ||
subnet: | ||
- name: "" | ||
type: name | ||
systemDiskSize: 40Gi | ||
vcpuSockets: 2 | ||
vcpusPerSocket: 1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.