Skip to content

Commit

Permalink
fixup! refactor: add kube-vip static Pod to KCP in the handler
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoshkin committed Apr 26, 2024
1 parent 48e7f72 commit 2bd290d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions charts/cluster-api-runtime-extensions-nutanix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
| hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-cilium-cni-helm-values-template"` | |
| hooks.csi.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.csi.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nutanix-csi-helm-values-template"` | |
| hooks.kubeVip.defaultTemplateConfigMap.create | bool | `true` | |
| hooks.kubeVip.defaultTemplateConfigMap.name | string | `"default-kube-vip-template"` | |
| hooks.nfd.crsStrategy.defaultInstallationConfigMap.name | string | `"node-feature-discovery"` | |
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nfd-helm-values-template"` | |
| hooks.virtualIP.kubeVip.defaultTemplateConfigMap.create | bool | `true` | |
| hooks.virtualIP.kubeVip.defaultTemplateConfigMap.name | string | `"default-kube-vip-template"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix"` | |
| image.tag | string | `""` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# DO NOT EDIT THIS FILE
# IT HAS BEEN GENERATED BY /hack/addons/update-kube-vip-manifests.sh
#=================================================================
{{- if .Values.hooks.kubeVip.defaultTemplateConfigMap.create }}
{{- if .Values.hooks.virtualIP.kubeVip.defaultTemplateConfigMap.create }}
apiVersion: v1
data:
kube-vip.yaml: |
Expand Down Expand Up @@ -71,5 +71,5 @@ data:
kind: ConfigMap
metadata:
creationTimestamp: null
name: '{{ .Values.hooks.kubeVip.defaultTemplateConfigMap.name }}'
name: '{{ .Values.hooks.virtualIP.kubeVip.defaultTemplateConfigMap.name }}'
{{- end -}}
10 changes: 6 additions & 4 deletions charts/cluster-api-runtime-extensions-nutanix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ hooks:
defaultValueTemplateConfigMap:
create: true
name: default-cluster-autoscaler-helm-values-template
kubeVip:
defaultTemplateConfigMap:
create: true
name: default-kube-vip-template

virtualIP:
kubeVip:
defaultTemplateConfigMap:
create: true
name: default-kube-vip-template

helmAddonsConfigMap: default-helm-addons-config

Expand Down
6 changes: 3 additions & 3 deletions hack/addons/update-kube-vip-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ docker container run --rm ghcr.io/kube-vip/kube-vip:"${KUBE_VIP_VERSION}" \
gojq --yaml-input --yaml-output 'del(.metadata.creationTimestamp, .status) | .spec.containers[].imagePullPolicy |= "IfNotPresent"' |
sed "s/\"-99999\"/'{{ \`{{ .ControlPlaneEndpoint.Port }}\` }}'/" >"${ASSETS_DIR}/${FILE_NAME}"

kubectl create configmap "{{ .Values.hooks.kubeVip.defaultTemplateConfigMap.name }}" --dry-run=client --output yaml \
kubectl create configmap "{{ .Values.hooks.virtualIP.kubeVip.defaultTemplateConfigMap.name }}" --dry-run=client --output yaml \
--from-file "${ASSETS_DIR}/${FILE_NAME}" \
>"${ASSETS_DIR}/kube-vip-configmap.yaml"

# add warning not to edit file directly
cat <<EOF >"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/kube-vip/manifests/kube-vip-configmap.yaml"
cat <<EOF >"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/virtual-ip/kube-vip/manifests/kube-vip-configmap.yaml"
$(cat "${GIT_REPO_ROOT}/hack/license-header.yaml.txt")
#=================================================================
# DO NOT EDIT THIS FILE
# IT HAS BEEN GENERATED BY /hack/addons/update-kube-vip-manifests.sh
#=================================================================
{{- if .Values.hooks.kubeVip.defaultTemplateConfigMap.create }}
{{- if .Values.hooks.virtualIP.kubeVip.defaultTemplateConfigMap.create }}
$(cat "${ASSETS_DIR}/kube-vip-configmap.yaml")
{{- end -}}
EOF

0 comments on commit 2bd290d

Please sign in to comment.