Skip to content

Commit

Permalink
(backport) chore: Remove Post Install Hook (#6827) for v0.37.x (#6836)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Aug 22, 2024
1 parent c3af798 commit e0d0f0c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ spec:
clientConfig:
service:
name: {{ .Values.webhook.serviceName }}
namespace: {{ .Values.webhook.serviceNamespace }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.webhook.port }}
{{- end }}

Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ spec:
clientConfig:
service:
name: {{ .Values.webhook.serviceName }}
namespace: {{ .Values.webhook.serviceNamespace }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.webhook.port }}
{{- end }}

2 changes: 1 addition & 1 deletion charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ spec:
clientConfig:
service:
name: {{ .Values.webhook.serviceName }}
namespace: {{ .Values.webhook.serviceNamespace }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.webhook.port }}
{{- end }}

3 changes: 1 addition & 2 deletions charts/karpenter-crd/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
webhook:
# -- Whether to enable the webhooks and webhook permissions.
# -- Whether to enable the webhooks.
enabled: false
serviceName: karpenter
serviceNamespace: kube-system
# -- The container port to use for the webhook.
port: 8443
11 changes: 0 additions & 11 deletions charts/karpenter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,6 @@ Karpenter image to use
{{- end }}
{{- end }}

{{/*
Karpenter post-install hook image to use
*/}}
{{- define "karpenter.postInstallHook.image" -}}
{{- if .Values.postInstallHook.image.digest }}
{{- printf "%s:%s@%s" .Values.postInstallHook.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.postInstallHook.image.tag) .Values.postInstallHook.image.digest }}
{{- else }}
{{- printf "%s:%s" .Values.postInstallHook.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.postInstallHook.image.tag) }}
{{- end }}
{{- end }}


{{/* Get PodDisruptionBudget API Version */}}
{{- define "karpenter.pdb.apiVersion" -}}
Expand Down
17 changes: 4 additions & 13 deletions charts/karpenter/templates/clusterrole-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ rules:
verbs: ["get", "watch", "list"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "watch", "list"]
{{- else }}
# Used for the post install hook
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get"]
{{- end }}
verbs: ["watch", "list"]
{{- end }}
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["get", "list", "watch"]
Expand All @@ -80,12 +75,8 @@ rules:
resourceNames: ["validation.webhook.karpenter.sh", "validation.webhook.config.karpenter.sh"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["update", "patch"]
{{- else }}
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["patch"]
{{- end }}
verbs: ["update"]
{{- end }}
{{- with .Values.additionalClusterRoleRules -}}
{{ toYaml . | nindent 2 }}
{{- end -}}
40 changes: 0 additions & 40 deletions charts/karpenter/templates/post-install-hook.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,6 @@ controller:
healthProbe:
# -- The container port to use for http health probe.
port: 8081
postInstallHook:
image:
# -- Repository path to the post-install hook. This minimally needs to have `kubectl` installed
repository: public.ecr.aws/bitnami/kubectl
# -- Tag of the post-install hook image.
tag: "1.30"
# -- SHA256 digest of the post-install hook image.
digest: sha256:13a2ad1bd37ce42ee2a6f1ab0d30595f42eb7fe4a90d6ec848550524104a1ed6
webhook:
# -- Whether to enable the webhooks and webhook permissions.
enabled: false
Expand Down
6 changes: 3 additions & 3 deletions hack/mutation/conversion_webhook_injection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo "{{- if .Values.webhook.enabled }}
clientConfig:
service:
name: {{ .Values.webhook.serviceName }}
namespace: {{ .Values.webhook.serviceNamespace }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.webhook.port }}
{{- end }}
" >> charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml
Expand All @@ -33,7 +33,7 @@ echo "{{- if .Values.webhook.enabled }}
clientConfig:
service:
name: {{ .Values.webhook.serviceName }}
namespace: {{ .Values.webhook.serviceNamespace }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.webhook.port }}
{{- end }}
" >> charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml
Expand All @@ -48,7 +48,7 @@ echo "{{- if .Values.webhook.enabled }}
clientConfig:
service:
name: {{ .Values.webhook.serviceName }}
namespace: {{ .Values.webhook.serviceNamespace }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.webhook.port }}
{{- end }}
" >> charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml

0 comments on commit e0d0f0c

Please sign in to comment.