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

fix(helm): use bitnami/kubectl image for helm hooks #7656

Merged
merged 1 commit into from
Sep 12, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,13 @@ kumactl:
tag:

kubectl:
# kuma image that support v1.20.15 image */ } }
# see: https://hub.docker.com/r/kumahq/kubectl */ } }
image:
# -- The kubectl image registry
registry: kumahq
registry: docker.io
# -- The kubectl image repository
repository: kubectl
repository: bitnami/kubectl
# -- The kubectl image tag
tag: "v1.20.15"
tag: "1.27.5"
hooks:
# -- Node selector for the HELM hooks
nodeSelector:
Expand Down
6 changes: 3 additions & 3 deletions deployments/charts/kuma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ A Helm chart for the Kuma Control Plane
| egress.containerSecurityContext | object | `{"readOnlyRootFilesystem":true}` | Security context at the container level for egress |
| kumactl.image.repository | string | `"kumactl"` | The kumactl image repository |
| kumactl.image.tag | string | `nil` | The kumactl image tag. When not specified, the value is copied from global.tag |
| kubectl.image.registry | string | `"kumahq"` | The kubectl image registry |
| kubectl.image.repository | string | `"kubectl"` | The kubectl image repository |
| kubectl.image.tag | string | `"v1.20.15"` | The kubectl image tag |
| kubectl.image.registry | string | `"docker.io"` | The kubectl image registry |
| kubectl.image.repository | string | `"bitnami/kubectl"` | The kubectl image repository |
| kubectl.image.tag | string | `"1.27.5"` | The kubectl image tag |
| hooks.nodeSelector | object | `{"kubernetes.io/os":"linux"}` | Node selector for the HELM hooks |
| hooks.tolerations | list | `[]` | Tolerations for the HELM hooks |
| hooks.podSecurityContext | object | `{"runAsNonRoot":true}` | Security context at the pod level for crd/webhook/ns |
Expand Down
14 changes: 0 additions & 14 deletions deployments/charts/kuma/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -372,17 +372,3 @@ env:
{{- end }}
{{- end }}
{{- end }}

{{/*
params: { image: { registry?, repository, tag? }, root: $ }
returns: formatted image string
*/}}
{{- define "kubectl.formatImage" -}}
{{- $img := .image }}
{{- $tag := .tag }}
{{- $root := .root }}
{{- $registry := ($img.registry | default $root.Values.kubectl.image.registry) -}}
{{- $repo := ($img.repository | default $root.Values.kubectl.image.repository) -}}
{{- $imageTag := ($tag | default $root.Values.kubectl.image.tag) -}}
{{- printf "%s/%s:%s" $registry $repo $imageTag -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ spec:
{{- toYaml .Values.hooks.podSecurityContext | trim | nindent 8 }}
containers:
- name: pre-delete-job
image: {{ include "kubectl.formatImage" (dict "image" .Values.kubectl.image "root" $) | quote }}
image: "{{ .Values.kubectl.image.registry }}/{{ .Values.kubectl.image.repository }}:{{ .Values.kubectl.image.tag }}"
command:
- 'kubectl'
- 'delete'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ spec:
{{- toYaml .Values.hooks.podSecurityContext | trim | nindent 8 }}
containers:
- name: pre-install-job
image: {{ include "kubectl.formatImage" (dict "image" .Values.kubectl.image "root" $) | quote }}
image: "{{ .Values.kubectl.image.registry }}/{{ .Values.kubectl.image.repository }}:{{ .Values.kubectl.image.tag }}"
securityContext:
{{- toYaml (mergeOverwrite (dict "runAsUser" 65534) .Values.hooks.containerSecurityContext) | trim | nindent 12 }}
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
{{- toYaml .Values.hooks.podSecurityContext | trim | nindent 8 }}
containers:
- name: pre-upgrade-job
image: {{ include "kubectl.formatImage" (dict "image" .Values.kubectl.image "root" $) | quote }}
image: "{{ .Values.kubectl.image.registry }}/{{ .Values.kubectl.image.repository }}:{{ .Values.kubectl.image.tag }}"
securityContext:
{{- toYaml (mergeOverwrite (dict "runAsUser" 65534) .Values.hooks.containerSecurityContext) | trim | nindent 12 }}
resources:
Expand Down
8 changes: 3 additions & 5 deletions deployments/charts/kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,13 @@ kumactl:
tag:

kubectl:
# kuma image that support v1.20.15 image */ } }
# see: https://hub.docker.com/r/kumahq/kubectl */ } }
image:
# -- The kubectl image registry
registry: kumahq
registry: docker.io
# -- The kubectl image repository
repository: kubectl
repository: bitnami/kubectl
# -- The kubectl image tag
tag: "v1.20.15"
tag: "1.27.5"
hooks:
# -- Node selector for the HELM hooks
nodeSelector:
Expand Down
8 changes: 3 additions & 5 deletions docs/generated/raw/helm-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,13 @@ kumactl:
tag:

kubectl:
# kuma image that support v1.20.15 image */ } }
# see: https://hub.docker.com/r/kumahq/kubectl */ } }
image:
# -- The kubectl image registry
registry: kumahq
registry: docker.io
# -- The kubectl image repository
repository: kubectl
repository: bitnami/kubectl
# -- The kubectl image tag
tag: "v1.20.15"
tag: "1.27.5"
hooks:
# -- Node selector for the HELM hooks
nodeSelector:
Expand Down
8 changes: 4 additions & 4 deletions mk/k3d.mk
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ k3d/deploy/kuma: build/kumactl k3d/load

.PHONY: k3d/deploy/helm
k3d/deploy/helm: k3d/load
@KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) delete namespace $(KUMA_NAMESPACE) | true
@KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create namespace $(KUMA_NAMESPACE)
@KUBECONFIG=$(KIND_KUBECONFIG) helm install --namespace $(KUMA_NAMESPACE) \
KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) delete namespace $(KUMA_NAMESPACE) --wait | true
KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create namespace $(KUMA_NAMESPACE)
KUBECONFIG=$(KIND_KUBECONFIG) helm upgrade --install --namespace $(KUMA_NAMESPACE) \
--set global.image.registry="$(DOCKER_REGISTRY)" \
--set global.image.tag="$(BUILD_INFO_VERSION)-${GOARCH}" \
--set global.image.tag="$(BUILD_INFO_VERSION)" \
--set cni.enabled=true \
--set cni.chained=true \
--set cni.netDir=/var/lib/rancher/k3s/agent/etc/cni/net.d/ \
Expand Down
12 changes: 0 additions & 12 deletions tools/kubectl/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions tools/kubectl/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions tools/kubectl/docker-build-and-publish.sh

This file was deleted.