From ac6ae4d08843304f48106e2b6003331d4b3e2d96 Mon Sep 17 00:00:00 2001 From: firmansyahn <80936459+firmansyahn@users.noreply.github.com> Date: Wed, 8 Jun 2022 21:45:52 +0700 Subject: [PATCH 1/5] Fix serviceAccount --- charts/adminer/templates/Certificate.yaml | 4 ++-- charts/adminer/templates/Deployment.yaml | 8 ++++---- charts/adminer/templates/Secret-tls.yaml | 2 +- charts/adminer/values.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/adminer/templates/Certificate.yaml b/charts/adminer/templates/Certificate.yaml index 6a1ad5fd..68e69fd7 100644 --- a/charts/adminer/templates/Certificate.yaml +++ b/charts/adminer/templates/Certificate.yaml @@ -1,5 +1,5 @@ {{- if .Capabilities.APIVersions.Has "cert-manager.io/v1" }} -{{- if and .Values.ingress.tls .Values.ingress.certManager.create (not .Values.ingress.selfSigned)}} +{{- if and .Values.ingress.tls .Values.ingress.certManager.create (not .Values.ingress.selfSigned) }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: @@ -44,7 +44,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: {{ include "common.names.fullname" . }} - namespace: {{ .Values.istio.namespace | quote }} + namespace: {{ .Values.istio.ingressNamespace | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} diff --git a/charts/adminer/templates/Deployment.yaml b/charts/adminer/templates/Deployment.yaml index bb0cf697..f05e6bc3 100644 --- a/charts/adminer/templates/Deployment.yaml +++ b/charts/adminer/templates/Deployment.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -18,15 +18,15 @@ spec: metadata: labels: {{- include "common.labels.standard" . | nindent 8 }} {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} {{- end }} annotations: checksum/secrets: {{ include (print $.Template.BasePath "/Secret.yaml") . | sha256sum }} {{- if .Values.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} {{- end }} spec: - serviceAccountName: {{ .Values.serviceAccountName }} + serviceAccountName: {{ include "adminer.serviceAccountName" . }} {{- include "adminer.imagePullSecrets" . | nindent 6 }} {{- if .Values.hostAliases }} hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} diff --git a/charts/adminer/templates/Secret-tls.yaml b/charts/adminer/templates/Secret-tls.yaml index 1f007143..eb02b19d 100644 --- a/charts/adminer/templates/Secret-tls.yaml +++ b/charts/adminer/templates/Secret-tls.yaml @@ -46,7 +46,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ printf "%s-tls" .Values.ingress.hostname }} - namespace: {{ .Values.istio.namespace | quote }} + namespace: {{ .Values.istio.ingressNamespace | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} diff --git a/charts/adminer/values.yaml b/charts/adminer/values.yaml index 4a5f18d3..d85c1387 100644 --- a/charts/adminer/values.yaml +++ b/charts/adminer/values.yaml @@ -508,4 +508,4 @@ istio: enabled: true existingVirtualService: ~ -organization: Adminer \ No newline at end of file +organization: Startechnica \ No newline at end of file From f4d86875ce21b6c4ae5650a22f66075e7f18b6da Mon Sep 17 00:00:00 2001 From: firmansyahn <80936459+firmansyahn@users.noreply.github.com> Date: Thu, 9 Jun 2022 10:16:22 +0700 Subject: [PATCH 2/5] Fix Service port protocol --- charts/adminer/templates/Service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/adminer/templates/Service.yaml b/charts/adminer/templates/Service.yaml index e05f0241..181a8aaa 100644 --- a/charts/adminer/templates/Service.yaml +++ b/charts/adminer/templates/Service.yaml @@ -47,7 +47,7 @@ spec: ports: - name: http port: {{ .Values.service.ports.http }} - protocol: UDP + protocol: TCP targetPort: {{ .Values.containerPorts.http }} {{- if (and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (coalesce .Values.service.nodePorts.http .Values.service.nodePort)) }} nodePort: {{ coalesce .Values.service.nodePorts.http .Values.service.nodePort }} From 2be18efc9873754d5f60bb6f9b6898ed626db515 Mon Sep 17 00:00:00 2001 From: firmansyahn <80936459+firmansyahn@users.noreply.github.com> Date: Thu, 9 Jun 2022 10:23:02 +0700 Subject: [PATCH 3/5] Add new label --- charts/adminer/templates/Deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/adminer/templates/Deployment.yaml b/charts/adminer/templates/Deployment.yaml index f05e6bc3..361a5670 100644 --- a/charts/adminer/templates/Deployment.yaml +++ b/charts/adminer/templates/Deployment.yaml @@ -4,6 +4,7 @@ metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} + app.kubernetes.io/component: adminer {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} @@ -17,6 +18,7 @@ spec: template: metadata: labels: {{- include "common.labels.standard" . | nindent 8 }} + app.kubernetes.io/component: adminer {{- if .Values.podLabels }} {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} {{- end }} From d59fefd99f7b79e3f826385c517325f93c2f0fcd Mon Sep 17 00:00:00 2001 From: firmansyahn <80936459+firmansyahn@users.noreply.github.com> Date: Thu, 9 Jun 2022 13:36:57 +0700 Subject: [PATCH 4/5] Add affinity and tolerations --- charts/adminer/values.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/charts/adminer/values.yaml b/charts/adminer/values.yaml index d85c1387..d6cc633d 100644 --- a/charts/adminer/values.yaml +++ b/charts/adminer/values.yaml @@ -141,6 +141,10 @@ config: externalserver: "" base_url: "" +## @section Traffic Exposure Parameters + +## Adminer service parameters +## service: ## @param service.type Adminer Kubernetes service type ## @@ -355,7 +359,7 @@ resources: requests: cpu: 50m memory: 64Mi -## Configure extra options for FreeRADIUS containers' liveness, readiness and startup probes +## Configure extra options for Adminer containers' liveness, readiness and startup probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) ## @param startupProbe.enabled Enable startupProbe ## @param startupProbe.initialDelaySeconds Initial delay seconds for startupProbe @@ -401,18 +405,18 @@ readinessProbe: timeoutSeconds: 1 failureThreshold: 3 successThreshold: 1 -## @param customStartupProbe Override default startup probe for FreeRADIUS containers +## @param customStartupProbe Override default startup probe for Adminer containers ## customStartupProbe: {} -## @param customLivenessProbe Override default liveness probe for FreeRADIUS containers +## @param customLivenessProbe Override default liveness probe for Adminer containers ## customLivenessProbe: {} -## @param customReadinessProbe Override default readiness probe for FreeRADIUS containers +## @param customReadinessProbe Override default readiness probe for Adminer containers ## customReadinessProbe: {} -## @param startupWaitOptions Override default builtin startup wait check options for FreeRADIUS containers +## @param startupWaitOptions Override default builtin startup wait check options for Adminer containers ## `bitnami/mariadb` Docker image has built-in startup check mechanism, -## which periodically checks if FreeRADIUS service has started up and stops it +## which periodically checks if Adminer service has started up and stops it ## if all checks have failed after X tries. Use these to control these checks. ## ref: https://github.com/bitnami/bitnami-docker-mariadb/pull/240 ## Example (with default options): @@ -421,27 +425,26 @@ customReadinessProbe: {} ## waitTime: 2 ## startupWaitOptions: {} -## @param extraFlags FreeRADIUS additional command line flags +## @param extraFlags Adminer additional command line flags ## Can be used to specify command line flags, for example: ## E.g. ## extraFlags: "--max-connect-errors=1000 --max_connections=155" ## extraFlags: "" -## @param extraEnvVars Extra environment variables to be set on FreeRADIUS containers +## @param extraEnvVars Extra environment variables to be set on Adminer containers ## E.g. ## extraEnvVars: ## - name: TZ ## value: "Europe/Paris" ## extraEnvVars: [] -## @param extraEnvVarsCM Name of existing ConfigMap containing extra env vars for FreeRADIUS containers +## @param extraEnvVarsCM Name of existing ConfigMap containing extra env vars for Adminer containers ## extraEnvVarsCM: "" -## @param extraEnvVarsSecret Name of existing Secret containing extra env vars for FreeRADIUS containers +## @param extraEnvVarsSecret Name of existing Secret containing extra env vars for Adminer containers ## extraEnvVarsSecret: "" - ## @section RBAC parameter # From 72a77fd1671641629c824ce9c7a943f38933d2bc Mon Sep 17 00:00:00 2001 From: firmansyahn <80936459+firmansyahn@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:21:56 +0700 Subject: [PATCH 5/5] Bump version to v0.1.3 --- charts/adminer/Chart.yaml | 4 ++-- charts/adminer/values.yaml | 31 ++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/charts/adminer/Chart.yaml b/charts/adminer/Chart.yaml index ee3c93cf..733c3c90 100644 --- a/charts/adminer/Chart.yaml +++ b/charts/adminer/Chart.yaml @@ -13,7 +13,7 @@ description: Adminer is a full-featured database management tool written in PHP. is available for MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Firebird, SimpleDB, Elasticsearch and MongoDB home: https://github.com/startechnica/apps/tree/main/charts/adminer -icon: https://raw.githubusercontent.com/Kong/docker-official-docs/master/adminer/logo.png +icon: https://www.adminer.org/static/images/logo.png keywords: - adminer - postgres @@ -31,4 +31,4 @@ name: adminer sources: - https://www.adminer.org type: application -version: 0.1.2 +version: 0.1.3 diff --git a/charts/adminer/values.yaml b/charts/adminer/values.yaml index d6cc633d..473bc491 100644 --- a/charts/adminer/values.yaml +++ b/charts/adminer/values.yaml @@ -354,7 +354,7 @@ containerSecurityContext: # memory: 128Mi resources: limits: - cpu: 2000m + cpu: 1000m memory: 1Gi requests: cpu: 50m @@ -445,6 +445,29 @@ extraEnvVarsCM: "" ## extraEnvVarsSecret: "" +## @param affinity Affinity for Adminer pods assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set +## +affinity: {} +## @param nodeSelector Node labels for Adminer pods assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} +## @param tolerations Tolerations for Adminer pods assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] +## @param topologySpreadConstraints Topology Spread Constraints for Adminer pods assignment +## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ +## E.g. +## topologySpreadConstraints: +## - maxSkew: 1 +## topologyKey: topology.kubernetes.io/zone +## whenUnsatisfiable: DoNotSchedule +## +topologySpreadConstraints: {} + ## @section RBAC parameter # @@ -484,12 +507,6 @@ rbac: ## rules: [] -nodeSelector: {} - -tolerations: [] - -affinity: {} - istio: enabled: false clusterName: cluster.local