From f3371d26857d0abad5521c702a32d69678a40fb2 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Sun, 15 Dec 2024 15:56:15 +0000 Subject: [PATCH] feat: make operators work on GKE --- charts/kubezero-ci/values.yaml | 2 +- charts/kubezero-lib/Chart.yaml | 4 +-- charts/kubezero-lib/README.md | 2 +- charts/kubezero-lib/templates/_commons.tpl | 10 +++++++ charts/kubezero-lib/templates/_helpers.tpl | 6 ++--- charts/kubezero-operators/Chart.yaml | 2 +- charts/kubezero-operators/values.yaml | 22 ---------------- charts/kubezero/Chart.yaml | 6 ++--- charts/kubezero/Makefile | 5 ---- charts/kubezero/README.md | 29 ++++++++++++--------- charts/kubezero/templates/cert-manager.yaml | 19 +++----------- charts/kubezero/templates/istio.yaml | 16 +++++------- charts/kubezero/templates/operators.yaml | 16 ++++++++++++ charts/kubezero/update.sh | 9 +++++++ charts/kubezero/values.yaml | 2 +- 15 files changed, 72 insertions(+), 78 deletions(-) create mode 100644 charts/kubezero-lib/templates/_commons.tpl delete mode 100644 charts/kubezero/Makefile create mode 100755 charts/kubezero/update.sh diff --git a/charts/kubezero-ci/values.yaml b/charts/kubezero-ci/values.yaml index 6f584507..485cc7d8 100644 --- a/charts/kubezero-ci/values.yaml +++ b/charts/kubezero-ci/values.yaml @@ -2,7 +2,7 @@ gitea: enabled: false image: - tag: 1.22.4 + tag: 1.22.6 rootless: true repliaCount: 1 diff --git a/charts/kubezero-lib/Chart.yaml b/charts/kubezero-lib/Chart.yaml index ba4a50a6..f966d71e 100644 --- a/charts/kubezero-lib/Chart.yaml +++ b/charts/kubezero-lib/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-lib description: KubeZero helm library - common helm functions and blocks type: library -version: 0.2.0 +version: 0.2.1 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: @@ -10,4 +10,4 @@ keywords: maintainers: - name: Stefan Reimer email: stefan@zero-downtime.net -kubeVersion: ">= 1.20.0" +kubeVersion: ">= 1.30.0" diff --git a/charts/kubezero-lib/README.md b/charts/kubezero-lib/README.md index 479c2594..569a2ff7 100644 --- a/charts/kubezero-lib/README.md +++ b/charts/kubezero-lib/README.md @@ -2,7 +2,7 @@ kubezero-lib ============ KubeZero helm library - common helm functions and blocks -Current chart version is `0.1.0` +Current chart version is `0.2.1` Source code can be found [here](https://kubezero.com) diff --git a/charts/kubezero-lib/templates/_commons.tpl b/charts/kubezero-lib/templates/_commons.tpl new file mode 100644 index 00000000..6b38e673 --- /dev/null +++ b/charts/kubezero-lib/templates/_commons.tpl @@ -0,0 +1,10 @@ +{{- /* +maps pods to the kube control-plane +*/ -}} +{{- define "kubezero-lib.control-plane" -}} +nodeSelector: + node-role.kubernetes.io/control-plane: "" +tolerations: +- key: node-role.kubernetes.io/control-plane + effect: NoSchedule +{{- end -}} diff --git a/charts/kubezero-lib/templates/_helpers.tpl b/charts/kubezero-lib/templates/_helpers.tpl index f9dbe370..52e5da48 100644 --- a/charts/kubezero-lib/templates/_helpers.tpl +++ b/charts/kubezero-lib/templates/_helpers.tpl @@ -25,9 +25,9 @@ Common naming functions {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{/* +{{- /* Selector labels -*/}} +*/ -}} {{- define "kubezero-lib.selectorLabels" -}} app.kubernetes.io/name: {{ include "kubezero-lib.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} @@ -49,7 +49,7 @@ This takes an array of three values: - the top context - the template name of the overrides (destination) - the template name of the base (source) -*/}} +*/ -}} {{- define "kubezero-lib.util.merge" -}} {{- $top := first . -}} {{- $overrides := fromYaml (include (index . 1) $top) | default (dict ) -}} diff --git a/charts/kubezero-operators/Chart.yaml b/charts/kubezero-operators/Chart.yaml index cba15726..009b5799 100644 --- a/charts/kubezero-operators/Chart.yaml +++ b/charts/kubezero-operators/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-operators description: Various operators supported by KubeZero type: application -version: 0.1.7 +version: 0.1.8 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: diff --git a/charts/kubezero-operators/values.yaml b/charts/kubezero-operators/values.yaml index 77cf2b29..c04b9598 100644 --- a/charts/kubezero-operators/values.yaml +++ b/charts/kubezero-operators/values.yaml @@ -13,28 +13,12 @@ opensearch-operator: - name: SKIP_INIT_CONTAINER value: "true" - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule - nodeSelector: - node-role.kubernetes.io/control-plane: "" - eck-operator: enabled: false installCRDs: false - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule - nodeSelector: - node-role.kubernetes.io/control-plane: "" cloudnative-pg: enabled: false - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule - nodeSelector: - node-role.kubernetes.io/control-plane: "" monitoring: podMonitorEnabled: false @@ -51,12 +35,6 @@ strimzi-kafka-operator: leaderElection: enable: false - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule - nodeSelector: - node-role.kubernetes.io/control-plane: "" - resources: requests: cpu: 20m diff --git a/charts/kubezero/Chart.yaml b/charts/kubezero/Chart.yaml index cfe50678..acd84034 100644 --- a/charts/kubezero/Chart.yaml +++ b/charts/kubezero/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero description: KubeZero - Root App of Apps chart type: application -version: 1.30.6 +version: 1.31.4-alpha home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: @@ -13,6 +13,6 @@ maintainers: email: stefan@zero-downtime.net dependencies: - name: kubezero-lib - version: ">= 0.1.6" + version: ">= 0.2.1" repository: https://cdn.zero-downtime.net/charts -kubeVersion: ">= 1.26.0-0" +kubeVersion: ">= 1.29.0-0" diff --git a/charts/kubezero/Makefile b/charts/kubezero/Makefile deleted file mode 100644 index e8c15cb5..00000000 --- a/charts/kubezero/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -.PHONY: sync - -sync: - rm -rf scripts templates - cp -r ../../kubezero/charts/kubezero/* . diff --git a/charts/kubezero/README.md b/charts/kubezero/README.md index d1f81df7..4ec51680 100644 --- a/charts/kubezero/README.md +++ b/charts/kubezero/README.md @@ -1,6 +1,6 @@ # kubezero -![Version: 1.30.5](https://img.shields.io/badge/Version-1.30.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 1.31.3](https://img.shields.io/badge/Version-1.31.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) KubeZero - Root App of Apps chart @@ -18,7 +18,7 @@ Kubernetes: `>= 1.26.0-0` | Repository | Name | Version | |------------|------|---------| -| https://cdn.zero-downtime.net/charts | kubezero-lib | >= 0.1.6 | +| https://cdn.zero-downtime.net/charts | kubezero-lib | >= 0.2.1 | ## Values @@ -32,16 +32,16 @@ Kubernetes: `>= 1.26.0-0` | addons.external-dns.enabled | bool | `false` | | | addons.forseti.enabled | bool | `false` | | | addons.sealed-secrets.enabled | bool | `false` | | -| addons.targetRevision | string | `"0.8.9"` | | +| addons.targetRevision | string | `"0.8.11"` | | | argo.argo-cd.enabled | bool | `false` | | | argo.argo-cd.istio.enabled | bool | `false` | | | argo.argocd-image-updater.enabled | bool | `false` | | | argo.enabled | bool | `false` | | | argo.namespace | string | `"argocd"` | | -| argo.targetRevision | string | `"0.2.4"` | | +| argo.targetRevision | string | `"0.2.6"` | | | cert-manager.enabled | bool | `false` | | | cert-manager.namespace | string | `"cert-manager"` | | -| cert-manager.targetRevision | string | `"0.9.9"` | | +| cert-manager.targetRevision | string | `"0.9.10"` | | | falco.enabled | bool | `false` | | | falco.k8saudit.enabled | bool | `false` | | | falco.targetRevision | string | `"0.1.2"` | | @@ -54,35 +54,35 @@ Kubernetes: `>= 1.26.0-0` | istio-ingress.enabled | bool | `false` | | | istio-ingress.gateway.service | object | `{}` | | | istio-ingress.namespace | string | `"istio-ingress"` | | -| istio-ingress.targetRevision | string | `"0.22.3-1"` | | +| istio-ingress.targetRevision | string | `"0.23.2"` | | | istio-private-ingress.chart | string | `"kubezero-istio-gateway"` | | | istio-private-ingress.enabled | bool | `false` | | | istio-private-ingress.gateway.service | object | `{}` | | | istio-private-ingress.namespace | string | `"istio-ingress"` | | -| istio-private-ingress.targetRevision | string | `"0.22.3-1"` | | +| istio-private-ingress.targetRevision | string | `"0.23.2"` | | | istio.enabled | bool | `false` | | | istio.namespace | string | `"istio-system"` | | -| istio.targetRevision | string | `"0.22.3-1"` | | +| istio.targetRevision | string | `"0.23.2"` | | | kubezero.defaultTargetRevision | string | `"*"` | | | kubezero.gitSync | object | `{}` | | | kubezero.repoURL | string | `"https://cdn.zero-downtime.net/charts"` | | | kubezero.server | string | `"https://kubernetes.default.svc"` | | | logging.enabled | bool | `false` | | | logging.namespace | string | `"logging"` | | -| logging.targetRevision | string | `"0.8.12"` | | +| logging.targetRevision | string | `"0.8.13"` | | | metrics.enabled | bool | `false` | | | metrics.istio.grafana | object | `{}` | | | metrics.istio.prometheus | object | `{}` | | | metrics.kubezero.prometheus.prometheusSpec.additionalScrapeConfigs | list | `[]` | | | metrics.namespace | string | `"monitoring"` | | -| metrics.targetRevision | string | `"0.10.0"` | | +| metrics.targetRevision | string | `"0.10.2"` | | | network.cilium.cluster | object | `{}` | | | network.enabled | bool | `true` | | | network.retain | bool | `true` | | | network.targetRevision | string | `"0.5.5"` | | | operators.enabled | bool | `false` | | | operators.namespace | string | `"operators"` | | -| operators.targetRevision | string | `"0.1.4"` | | +| operators.targetRevision | string | `"0.1.6"` | | | storage.aws-ebs-csi-driver.enabled | bool | `false` | | | storage.aws-efs-csi-driver.enabled | bool | `false` | | | storage.enabled | bool | `false` | | @@ -90,7 +90,10 @@ Kubernetes: `>= 1.26.0-0` | storage.k8up.enabled | bool | `false` | | | storage.lvm-localpv.enabled | bool | `false` | | | storage.snapshotController.enabled | bool | `false` | | -| storage.targetRevision | string | `"0.8.8"` | | +| storage.targetRevision | string | `"0.8.9"` | | | telemetry.enabled | bool | `false` | | | telemetry.namespace | string | `"telemetry"` | | -| telemetry.targetRevision | string | `"0.4.0"` | | +| telemetry.targetRevision | string | `"0.4.1"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/kubezero/templates/cert-manager.yaml b/charts/kubezero/templates/cert-manager.yaml index 270ced7d..fd60c99a 100644 --- a/charts/kubezero/templates/cert-manager.yaml +++ b/charts/kubezero/templates/cert-manager.yaml @@ -10,26 +10,13 @@ cert-manager: {{- end }} {{- if eq .Values.global.platform "aws" }} - # map everything to the control-plane - nodeSelector: - node-role.kubernetes.io/control-plane: "" - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule + {{- include "kubezero-lib.control-plane" . | nindent 2 }} webhook: - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule - nodeSelector: - node-role.kubernetes.io/control-plane: "" + {{- include "kubezero-lib.control-plane" . | nindent 4 }} cainjector: - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule - nodeSelector: - node-role.kubernetes.io/control-plane: "" + {{- include "kubezero-lib.control-plane" . | nindent 4 }} extraEnv: - name: AWS_REGION diff --git a/charts/kubezero/templates/istio.yaml b/charts/kubezero/templates/istio.yaml index dad5c830..6df9429d 100644 --- a/charts/kubezero/templates/istio.yaml +++ b/charts/kubezero/templates/istio.yaml @@ -13,19 +13,15 @@ istiod: telemetry: enabled: {{ $.Values.metrics.enabled }} pilot: -{{- if eq .Values.global.platform "aws" }} - nodeSelector: - node-role.kubernetes.io/control-plane: "" - tolerations: - - key: node-role.kubernetes.io/control-plane - effect: NoSchedule -{{- end }} -{{- if .Values.global.highAvailable }} + {{- if eq .Values.global.platform "aws" }} + {{- include "kubezero-lib.control-plane" . | nindent 4 }} + {{- end }} + {{- if .Values.global.highAvailable }} replicaCount: 2 -{{- else }} + {{- else }} extraContainerArgs: - --leader-elect=false -{{- end }} + {{- end }} {{- with index .Values "istio" "kiali-server" }} kiali-server: diff --git a/charts/kubezero/templates/operators.yaml b/charts/kubezero/templates/operators.yaml index cd481428..1e3b003f 100644 --- a/charts/kubezero/templates/operators.yaml +++ b/charts/kubezero/templates/operators.yaml @@ -2,16 +2,28 @@ {{- with index .Values "operators" "opensearch-operator" }} opensearch-operator: + {{- if eq $.Values.global.platform "aws" }} + {{- include "kubezero-lib.control-plane" . | nindent 2 }} + {{- end }} + {{- toYaml . | nindent 2 }} {{- end }} {{- with index .Values "operators" "eck-operator" }} eck-operator: + {{- if eq $.Values.global.platform "aws" }} + {{- include "kubezero-lib.control-plane" . | nindent 2 }} + {{- end }} + {{- toYaml . | nindent 2 }} {{- end }} {{- with index .Values "operators" "cloudnative-pg" }} cloudnative-pg: + {{- if eq $.Values.global.platform "aws" }} + {{- include "kubezero-lib.control-plane" . | nindent 2 }} + {{- end }} + {{- toYaml . | nindent 2 }} {{- with $.Values.metrics }} @@ -22,6 +34,10 @@ cloudnative-pg: {{- with index .Values "operators" "strimzi-kafka-operator" }} strimzi-kafka-operator: + {{- if eq $.Values.global.platform "aws" }} + {{- include "kubezero-lib.control-plane" . | nindent 2 }} + {{- end }} + {{- toYaml . | nindent 2 }} {{- with $.Values.metrics }} diff --git a/charts/kubezero/update.sh b/charts/kubezero/update.sh new file mode 100755 index 00000000..3f7c5736 --- /dev/null +++ b/charts/kubezero/update.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -ex + +. ../../scripts/lib-update.sh + +login_ecr_public +update_helm + +update_docs diff --git a/charts/kubezero/values.yaml b/charts/kubezero/values.yaml index 8232c9c6..8aab092f 100644 --- a/charts/kubezero/values.yaml +++ b/charts/kubezero/values.yaml @@ -96,7 +96,7 @@ telemetry: operators: enabled: false namespace: operators - targetRevision: 0.1.6 + targetRevision: 0.1.8 metrics: enabled: false