Skip to content

Commit

Permalink
chore: Remove Post Install Hook (#6827)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Aug 21, 2024
1 parent 095c7e3 commit 75d482f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,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 @@ -826,7 +826,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 @@ -1077,7 +1077,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: true
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
12 changes: 2 additions & 10 deletions charts/karpenter/templates/clusterrole-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ rules:
{{- if .Values.webhook.enabled }}
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "watch", "list"]
{{- else }}
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get"]
verbs: ["watch", "list"]
{{- end }}
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
Expand All @@ -75,11 +71,7 @@ rules:
{{- if .Values.webhook.enabled }}
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["update", "patch"]
{{- else }}
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["patch"]
verbs: ["update"]
{{- end }}
{{- with .Values.additionalClusterRoleRules -}}
{{ toYaml . | nindent 2 }}
Expand Down
45 changes: 0 additions & 45 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: true
Expand Down
6 changes: 3 additions & 3 deletions hack/mutation/conversion_webhooks_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 75d482f

Please sign in to comment.