From 29f4ec88f2e1ac30a7a7c4ee49988c0ba295fdd2 Mon Sep 17 00:00:00 2001 From: Antonio Gamez Diaz Date: Mon, 21 Aug 2023 09:05:25 +0200 Subject: [PATCH] Bring dev changes back Signed-off-by: Antonio Gamez Diaz --- chart/kubeapps/Chart.yaml | 30 +++---- chart/kubeapps/README.md | 2 - chart/kubeapps/templates/_helpers.tpl | 7 ++ .../templates/kubeappsapis/deployment.yaml | 82 +++++++++++++++++++ 4 files changed, 104 insertions(+), 17 deletions(-) diff --git a/chart/kubeapps/Chart.yaml b/chart/kubeapps/Chart.yaml index c8c938de231..43a874953e9 100644 --- a/chart/kubeapps/Chart.yaml +++ b/chart/kubeapps/Chart.yaml @@ -22,19 +22,19 @@ annotations: apiVersion: v2 appVersion: DEVEL dependencies: -- condition: packaging.flux.enabled - name: redis - repository: oci://registry-1.docker.io/bitnamicharts - version: 17.x.x -- condition: packaging.helm.enabled - name: postgresql - repository: oci://registry-1.docker.io/bitnamicharts - version: 12.x.x -- name: common - repository: oci://registry-1.docker.io/bitnamicharts - tags: - - bitnami-common - version: 2.x.x + - condition: packaging.flux.enabled + name: redis + repository: oci://registry-1.docker.io/bitnamicharts + version: 17.x.x + - condition: packaging.helm.enabled + name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 12.x.x + - name: common + repository: oci://registry-1.docker.io/bitnamicharts + tags: + - bitnami-common + version: 2.x.x description: Kubeapps is a web-based UI for launching and managing applications on Kubernetes. It allows users to deploy trusted applications and operators to control users access to the cluster. home: https://bitnami.com icon: https://bitnami.com/assets/stacks/kubeapps/img/kubeapps-stack-220x234.png @@ -45,8 +45,8 @@ keywords: - deployment kubeVersion: ">=1.21.0-0" maintainers: -- name: VMware, Inc. - url: https://github.com/bitnami/charts + - name: VMware, Inc. + url: https://github.com/bitnami/charts name: kubeapps sources: - https://github.com/bitnami/charts/tree/main/bitnami/kubeapps diff --git a/chart/kubeapps/README.md b/chart/kubeapps/README.md index 086ed57a86b..60dc27d824a 100644 --- a/chart/kubeapps/README.md +++ b/chart/kubeapps/README.md @@ -1,5 +1,3 @@ - - # Kubeapps packaged by Bitnami Kubeapps is a web-based UI for launching and managing applications on Kubernetes. It allows users to deploy trusted applications and operators to control users access to the cluster. diff --git a/chart/kubeapps/templates/_helpers.tpl b/chart/kubeapps/templates/_helpers.tpl index b5eea7e6041..d588496eae2 100644 --- a/chart/kubeapps/templates/_helpers.tpl +++ b/chart/kubeapps/templates/_helpers.tpl @@ -61,6 +61,13 @@ Return the proper kubeappsapis image name {{- include "common.images.image" (dict "imageRoot" .Values.kubeappsapis.image "global" .Values.global) -}} {{- end -}} +{{/* +Return the proper oci-catalog image name +*/}} +{{- define "kubeapps.ociCatalog.image" -}} +{{- include "common.images.image" (dict "imageRoot" .Values.ociCatalog.image "global" .Values.global) -}} +{{- end -}} + {{/* Create a default fully qualified app name for PostgreSQL dependency. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). diff --git a/chart/kubeapps/templates/kubeappsapis/deployment.yaml b/chart/kubeapps/templates/kubeappsapis/deployment.yaml index fa262684607..0c116ea5c26 100644 --- a/chart/kubeapps/templates/kubeappsapis/deployment.yaml +++ b/chart/kubeapps/templates/kubeappsapis/deployment.yaml @@ -166,6 +166,8 @@ spec: secretKeyRef: key: postgres-password name: {{ include "kubeapps.postgresql.secretName" . }} + - name: OCI_CATALOG_URL + value: {{ printf ":%d" (int .Values.ociCatalog.containerPorts.grpc) | quote }} {{- end }} {{- if .Values.kubeappsapis.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.kubeappsapis.extraEnvVars "context" $) | nindent 12 }} @@ -226,6 +228,86 @@ spec: {{- if .Values.kubeappsapis.extraVolumeMounts }} {{- include "common.tplvalues.render" (dict "value" .Values.kubeappsapis.extraVolumeMounts "context" $) | nindent 12 }} {{- end }} + {{- if .Values.ociCatalog.enabled }} + - name: oci-catalog + image: {{ include "kubeapps.ociCatalog.image" . }} + imagePullPolicy: {{ .Values.ociCatalog.image.pullPolicy | quote }} + {{- if .Values.ociCatalog.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.ociCatalog.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.kubeappsapis.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.kubeappsapis.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.ociCatalog.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.ociCatalog.command "context" $) | nindent 12 }} + {{- else }} + command: + - /oci-catalog + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.ociCatalog.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.kubeappsapis.args "context" $) | nindent 12 }} + {{- else }} + args: + {{- range .Values.ociCatalog.extraFlags }} + - {{ . }} + {{- end }} + {{- end }} + env: + - name: OCI_CATALOG_PORT + value: {{ .Values.ociCatalog.containerPorts.grpc | quote }} + - name: RUST_LOG + # Use info,pinniped_proxy::pinniped=debug for module control. + value: info + {{- if .Values.ociCatalog.extraEnvVars }} + {{- include "common.tplvalues.render" (dict "value" .Values.ociCatalog.extraEnvVars "context" $) | nindent 12 }} + {{- end }} + envFrom: + {{- if .Values.ociCatalog.extraEnvVarsCM }} + - configMapRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.ociCatalog.extraEnvVarsCM "context" $) }} + {{- end }} + {{- if .Values.ociCatalog.extraEnvVarsSecret }} + - secretRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.ociCatalog.extraEnvVarsSecret "context" $) }} + {{- end }} + ports: + - name: grpc + containerPort: {{ .Values.ociCatalog.containerPorts.grpc }} + {{- if not .Values.diagnosticMode.enabled }} + {{- if .Values.ociCatalog.customLivenessProbe }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.ociCatalog.customLivenessProbe "context" $) | nindent 12 }} + {{- else if .Values.ociCatalog.livenessProbe.enabled }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.kubeappsapis.livenessProbe "enabled") "context" $) | nindent 12 }} + exec: + command: ["grpc_health_probe", "-addr=:{{ .Values.ociCatalog.containerPorts.grpc }}"] + {{- end }} + {{- if .Values.ociCatalog.customReadinessProbe }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.ociCatalog.customReadinessProbe "context" $) | nindent 12 }} + {{- else if .Values.ociCatalog.readinessProbe.enabled }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.ociCatalog.readinessProbe "enabled") "context" $) | nindent 12 }} + exec: + command: ["grpc_health_probe", "-addr=:{{ .Values.ociCatalog.containerPorts.grpc }}"] + {{- end }} + {{- if .Values.ociCatalog.customStartupProbe }} + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.ociCatalog.customStartupProbe "context" $) | nindent 12 }} + {{- else if .Values.ociCatalog.startupProbe.enabled }} + startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.ociCatalog.startupProbe "enabled") "context" $) | nindent 12 }} + tcpSocket: + port: grpc-http + {{- end }} + {{- end }} + {{- if .Values.ociCatalog.resources }} + resources: {{- toYaml .Values.ociCatalog.resources | nindent 12 }} + {{- end }} + volumeMounts: + {{- if .Values.ociCatalog.extraVolumeMounts }} + {{- include "common.tplvalues.render" (dict "value" .Values.ociCatalog.extraVolumeMounts "context" $) | nindent 12 }} + {{- end }} + {{- end }} {{- if .Values.kubeappsapis.sidecars }} {{- include "common.tplvalues.render" (dict "value" .Values.kubeappsapis.sidecars "context" $) | trim | nindent 8 }} {{- end }}