From 5e41c8f57193f3860f8e75a78aeded66576a1906 Mon Sep 17 00:00:00 2001 From: Dimitri Koshkin Date: Wed, 10 Apr 2024 09:13:22 -0700 Subject: [PATCH] build: remove unused CRS tooling for Nutanix CCM The CRS strategy is not supported for the Nutanix CCM, removing it until we actually need it. --- .../README.md | 1 - .../manifests/nutanix-ccm-configmap.yaml | 183 ------------------ .../values.yaml | 3 - .../kustomize/nutanix-ccm/helm-values.yaml | 8 - hack/addons/update-nutanix-ccm.sh | 41 ---- make/addons.mk | 6 +- 6 files changed, 1 insertion(+), 241 deletions(-) delete mode 100644 charts/cluster-api-runtime-extensions-nutanix/templates/ccm/nutanix/manifests/nutanix-ccm-configmap.yaml delete mode 100644 hack/addons/kustomize/nutanix-ccm/helm-values.yaml delete mode 100755 hack/addons/update-nutanix-ccm.sh diff --git a/charts/cluster-api-runtime-extensions-nutanix/README.md b/charts/cluster-api-runtime-extensions-nutanix/README.md index cb4b21510..80c72c84b 100644 --- a/charts/cluster-api-runtime-extensions-nutanix/README.md +++ b/charts/cluster-api-runtime-extensions-nutanix/README.md @@ -32,7 +32,6 @@ A Helm chart for cluster-api-runtime-extensions-nutanix | deployment.replicas | int | `1` | | | env | object | `{}` | | | helmAddonsConfigMap | string | `"default-helm-addons-config"` | | -| hooks.ccm.nutanix.crsStrategy.defaultInstallationConfigMap.name | string | `"nutanix-ccm"` | | | hooks.ccm.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | | | hooks.ccm.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nutanix-ccm-helm-values-template"` | | | hooks.clusterAutoscaler.crsStrategy.defaultInstallationConfigMap.name | string | `"cluster-autoscaler"` | | diff --git a/charts/cluster-api-runtime-extensions-nutanix/templates/ccm/nutanix/manifests/nutanix-ccm-configmap.yaml b/charts/cluster-api-runtime-extensions-nutanix/templates/ccm/nutanix/manifests/nutanix-ccm-configmap.yaml deleted file mode 100644 index 80bf668e9..000000000 --- a/charts/cluster-api-runtime-extensions-nutanix/templates/ccm/nutanix/manifests/nutanix-ccm-configmap.yaml +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright 2023 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -#================================================================= -# DO NOT EDIT THIS FILE -# IT HAS BEEN GENERATED BY /hack/addons/nutanix-ccm.sh -#================================================================= -apiVersion: v1 -data: - nutanix-ccm.yaml: | - apiVersion: v1 - kind: ServiceAccount - metadata: - name: cloud-controller-manager - namespace: kube-system - --- - 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 - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - 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: - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchLabels: - k8s-app: nutanix-cloud-controller-manager - topologyKey: kubernetes.io/hostname - containers: - - args: - - --leader-elect=true - - --cloud-config=/etc/cloud/nutanix_config.json - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - image: ghcr.io/nutanix-cloud-native/cloud-provider-nutanix/controller:v0.3.2 - imagePullPolicy: IfNotPresent - name: nutanix-cloud-controller-manager - resources: - requests: - cpu: 100m - memory: 50Mi - volumeMounts: - - mountPath: /etc/cloud - name: nutanix-config-volume - readOnly: true - dnsPolicy: Default - hostNetwork: true - nodeSelector: - node-role.kubernetes.io/control-plane: "" - priorityClassName: system-cluster-critical - serviceAccountName: cloud-controller-manager - 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 - volumes: - - configMap: - name: nutanix-config - name: nutanix-config-volume -kind: ConfigMap -metadata: - creationTimestamp: null - name: '{{ .Values.hooks.ccm.nutanix.crsStrategy.defaultInstallationConfigMap.name - }}' diff --git a/charts/cluster-api-runtime-extensions-nutanix/values.yaml b/charts/cluster-api-runtime-extensions-nutanix/values.yaml index 3d53411ba..eee0993af 100644 --- a/charts/cluster-api-runtime-extensions-nutanix/values.yaml +++ b/charts/cluster-api-runtime-extensions-nutanix/values.yaml @@ -51,9 +51,6 @@ hooks: name: default-nutanix-csi-helm-values-template ccm: nutanix: - crsStrategy: - defaultInstallationConfigMap: - name: nutanix-ccm helmAddonStrategy: defaultValueTemplateConfigMap: create: true diff --git a/hack/addons/kustomize/nutanix-ccm/helm-values.yaml b/hack/addons/kustomize/nutanix-ccm/helm-values.yaml deleted file mode 100644 index e0a69214e..000000000 --- a/hack/addons/kustomize/nutanix-ccm/helm-values.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2023 D2iQ, Inc. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - ---- -# The Secret containing the credentials is expected to already exist. -createSecret: false -# The ConfigMap containing the PC details will be created by the handler. -createConfig: false diff --git a/hack/addons/update-nutanix-ccm.sh b/hack/addons/update-nutanix-ccm.sh deleted file mode 100755 index 4e450704c..000000000 --- a/hack/addons/update-nutanix-ccm.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -readonly SCRIPT_DIR - -# shellcheck source=hack/common.sh -source "${SCRIPT_DIR}/../common.sh" - -if [ -z "${NUTANIX_CCM_CHART_VERSION:-}" ]; then - echo "Missing argument: NUTANIX_CCM_CHART_VERSION" - exit 1 -fi - -ASSETS_DIR="$(mktemp -d -p "${TMPDIR:-/tmp}")" -readonly ASSETS_DIR -trap_add "rm -rf ${ASSETS_DIR}" EXIT - -readonly FILE_NAME="nutanix-ccm.yaml" - -readonly KUSTOMIZE_BASE_DIR="${SCRIPT_DIR}/kustomize/nutanix-ccm/" -envsubst -no-unset <"${KUSTOMIZE_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_DIR}/kustomization.yaml" -cp "${KUSTOMIZE_BASE_DIR}"/*.yaml "${ASSETS_DIR}" - -kustomize build --enable-helm "${ASSETS_DIR}" >"${ASSETS_DIR}/${FILE_NAME}" - -kubectl create configmap "{{ .Values.hooks.ccm.nutanix.crsStrategy.defaultInstallationConfigMap.name }}" --dry-run=client --output yaml \ - --from-file "${ASSETS_DIR}/${FILE_NAME}" \ - >"${ASSETS_DIR}/nutanix-ccm-configmap.yaml" - -# add warning not to edit file directly -cat <"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/ccm/nutanix/manifests/nutanix-ccm-configmap.yaml" -$(cat "${GIT_REPO_ROOT}/hack/license-header.yaml.txt") - -#================================================================= -# DO NOT EDIT THIS FILE -# IT HAS BEEN GENERATED BY /hack/addons/nutanix-ccm.sh -#================================================================= -$(cat "${ASSETS_DIR}/nutanix-ccm-configmap.yaml") -EOF diff --git a/make/addons.mk b/make/addons.mk index 5a0e23d9c..36ae1b33e 100644 --- a/make/addons.mk +++ b/make/addons.mk @@ -18,7 +18,7 @@ export AWS_CCM_CHART_VERSION_128 := 0.0.8 export NUTANIX_CCM_CHART_VERSION := 0.3.3 .PHONY: addons.sync -addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler aws-ebs-csi aws-ccm.127 nutanix-storage-csi aws-ccm.128 nutanix-ccm) +addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler aws-ebs-csi aws-ccm.127 nutanix-storage-csi aws-ccm.128) .PHONY: update-addon.calico update-addon.calico: ; $(info $(M) updating calico manifests) @@ -48,10 +48,6 @@ update-addon.aws-ccm.%: ; $(info $(M) updating aws ccm $* manifests) update-addon.nutanix-storage-csi: ; $(info $(M) updating nutanix-storage csi manifests) ./hack/addons/update-nutanix-csi.sh -.PHONY: update-addon.nutanix-ccm -update-addon.nutanix-ccm: ; $(info $(M) updating nutanix ccm $* manifests) - ./hack/addons/update-nutanix-ccm.sh - .PHONY: generate-helm-configmap generate-helm-configmap: go run hack/tools/helm-cm/main.go -kustomize-directory="./hack/addons/kustomize" -output-file="./charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml"