Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Nutanix CAPX to v1.3.0 #7534

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v35 v35.3.0
github.com/google/uuid v1.4.0
github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.2.4
github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.3.0
github.com/nutanix-cloud-native/prism-go-client v0.3.4
github.com/onsi/gomega v1.29.0
github.com/opencontainers/image-spec v1.1.0-rc5
Expand Down
43 changes: 41 additions & 2 deletions go.sum

Large diffs are not rendered by default.

239 changes: 239 additions & 0 deletions pkg/providers/nutanix/config/cp-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: "{{.clusterName}}"
namespace: "{{.eksaSystemNamespace}}"
spec:
failureDomains: []
abhinavmpandey08 marked this conversation as resolved.
Show resolved Hide resolved
prismCentral:
{{- if .nutanixAdditionalTrustBundle }}
additionalTrustBundle:
Expand Down Expand Up @@ -74,6 +75,7 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
extraArgs:
cloud-provider: external
audit-policy-file: /etc/kubernetes/audit-policy.yaml
audit-log-path: /var/log/kubernetes/api-audit.log
audit-log-maxage: "30"
Expand Down Expand Up @@ -105,6 +107,7 @@ spec:
{{- end}}
controllerManager:
extraArgs:
cloud-provider: external
enable-hostpath-provisioner: "true"
dns:
imageRepository: {{.corednsRepository}}
Expand Down Expand Up @@ -265,6 +268,7 @@ spec:
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
cloud-provider: external
# We have to pin the cgroupDriver to cgroupfs as kubeadm >=1.21 defaults to systemd
# kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726
#cgroup-driver: cgroupfs
Expand Down Expand Up @@ -397,4 +401,239 @@ metadata:
stringData:
username: "{{.registryUsername}}"
password: "{{.registryPassword}}"
---
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{.clusterName}}-nutanix-ccm
namespace: "{{.eksaSystemNamespace}}"
data:
nutanix-ccm.yaml: |
{{- if .nutanixAdditionalTrustBundle }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: user-ca-bundle
namespace: kube-system
binaryData:
ca.crt:{{- .nutanixAdditionalTrustBundle }}{{- end }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cloud-controller-manager
namespace: kube-system
---
kind: ConfigMap
apiVersion: v1
metadata:
name: nutanix-config
namespace: kube-system
data:
nutanix_config.json: |-
{
"prismCentral": {
"address": "{{.nutanixEndpoint}}",
"port": {{.nutanixPort}},
"insecure": {{.nutanixInsecure}},
"credentialRef": {
"kind": "secret",
"name": "nutanix-creds",
"namespace": "kube-system"
}{{- if .nutanixAdditionalTrustBundle }},
"additionalTrustBundle": {
"kind": "ConfigMap",
"name": "user-ca-bundle",
"namespace": "kube-system"
}{{- end }}
},
"enableCustomLabeling": false,
"topologyDiscovery": {
"type": "Prism"
}
}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: system:cloud-controller-manager
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
- apiGroups:
- ""
resources:
- nodes
verbs:
- "*"
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- apiGroups:
- ""
resources:
- endpoints
verbs:
- create
- get
- list
- watch
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:cloud-controller-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:cloud-controller-manager
subjects:
- kind: ServiceAccount
name: cloud-controller-manager
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
k8s-app: nutanix-cloud-controller-manager
name: nutanix-cloud-controller-manager
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
k8s-app: nutanix-cloud-controller-manager
strategy:
type: Recreate
template:
metadata:
labels:
k8s-app: nutanix-cloud-controller-manager
spec:
hostNetwork: true
priorityClassName: system-cluster-critical
nodeSelector:
node-role.kubernetes.io/control-plane: ""
serviceAccountName: cloud-controller-manager
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
k8s-app: nutanix-cloud-controller-manager
topologyKey: kubernetes.io/hostname
dnsPolicy: Default
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 120
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 120
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/not-ready
operator: Exists
containers:
- image: "{{.cloudProviderImage}}"
imagePullPolicy: IfNotPresent
name: nutanix-cloud-controller-manager
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
- "--leader-elect=true"
- "--cloud-config=/etc/cloud/nutanix_config.json"
resources:
requests:
cpu: 100m
memory: 50Mi
volumeMounts:
- mountPath: /etc/cloud
name: nutanix-config-volume
readOnly: true
volumes:
- name: nutanix-config-volume
configMap:
name: nutanix-config
---
apiVersion: addons.cluster.x-k8s.io/v1beta1
kind: ClusterResourceSet
metadata:
name: {{.clusterName}}-nutanix-ccm-crs
namespace: "{{.eksaSystemNamespace}}"
spec:
clusterSelector:
matchLabels:
cluster.x-k8s.io/cluster-name: "{{.clusterName}}"
resources:
- kind: ConfigMap
name: {{.clusterName}}-nutanix-ccm
- kind: Secret
name: {{.clusterName}}-nutanix-ccm-secret
{{- if .nutanixAdditionalTrustBundle }}
- kind: ConfigMap
name: user-ca-bundle
{{- end }}
strategy: Reconcile
1 change: 1 addition & 0 deletions pkg/providers/nutanix/config/md-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ spec:
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
cloud-provider: external
# We have to pin the cgroupDriver to cgroupfs as kubeadm >=1.21 defaults to systemd
# kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726
#cgroup-driver: cgroupfs
Expand Down
28 changes: 28 additions & 0 deletions pkg/providers/nutanix/config/secret-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,31 @@ metadata:
namespace: "{{.eksaSystemNamespace}}"
data:
credentials: "{{.base64EncodedCredentials}}"
---
apiVersion: v1
kind: Secret
metadata:
name: "{{.clusterName}}-nutanix-ccm-secret"
namespace: "{{.eksaSystemNamespace}}"
stringData:
nutanix-ccm-secret.yaml: |
apiVersion: v1
kind: Secret
metadata:
name: nutanix-creds
namespace: kube-system
stringData:
credentials: |-
[
{
"type": "basic_auth",
"data": {
"prismCentral": {
"username": "{{ .nutanixPCUsername }}",
"password": "{{ .nutanixPCPassword }}"
},
"prismElements": null
}
}
]
type: addons.cluster.x-k8s.io/resource-set
Loading
Loading