From 611e971295ced258fb31364a0f249cc80f1a182d Mon Sep 17 00:00:00 2001 From: wbsong111 Date: Thu, 6 Aug 2026 16:09:51 +0900 Subject: [PATCH] =?UTF-8?q?add-keycloakx/7.2.2:=20keycloakx=207.2.2=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80,=20keycloak/18.4.0=20=EC=A0=9C=EA=B1=B0=20(?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codecentric/keycloak(18.4.0, WildFly 기반, appVersion 17.0.1-legacy)이 bitnami/postgresql 서브차트를 조건부 의존성으로 포함해 bitnami 무료 배포 정책 변경 문제가 그대로 전이됐다. codecentric은 이 WildFly 차트를 더 이상 갱신하지 않고 Quarkus 기반 Keycloak(17+)용 별도 차트 keycloakx를 제공하며, keycloakx는 서브차트 의존성이 전혀 없어(Chart.yaml에 dependencies 없음) 문제가 근본적으로 해소된다. 실제 소비자가 없어(문서 예시 표 한 줄 외 참조 없음) phased 전환 없이 keycloak/18.4.0을 같은 커밋에서 제거했다. custom-values.yaml 작성 시 확인한 핵심 사항 — 이 차트의 http.relativePath 기본값이 구버전 WildFly Keycloak 호환용 "/auth"라, 명시적으로 "/"로 오버라이드해야 한다(안 하면 OIDC issuer/admin API 경로가 소비 앱들의 경로 접미사 없음 가정과 어긋난다). database.existingSecret/existingSecretKey 로 kubernetes.io/basic-auth 시크릿을 그대로 참조 가능함도 helm template로 확인했다. Closes #1 Co-Authored-By: Claude Sonnet 5 --- .../helm/keycloak/18.4.0/BUILD-README.md | 83 -- .../helm/keycloak/18.4.0/CUSTOM-README.md | 157 --- manifests/helm/keycloak/18.4.0/Chart.lock | 6 - manifests/helm/keycloak/18.4.0/Chart.yaml | 28 - manifests/helm/keycloak/18.4.0/README.md | 903 --------------- .../18.4.0/charts/postgresql/.helmignore | 21 - .../18.4.0/charts/postgresql/Chart.lock | 6 - .../18.4.0/charts/postgresql/Chart.yaml | 28 - .../18.4.0/charts/postgresql/README.md | 819 -------------- .../postgresql/charts/common/Chart.yaml | 22 - .../charts/postgresql/charts/common/README.md | 328 ------ .../charts/common/templates/_affinities.tpl | 102 -- .../charts/common/templates/_capabilities.tpl | 128 --- .../charts/common/templates/_errors.tpl | 23 - .../charts/common/templates/_images.tpl | 75 -- .../charts/common/templates/_ingress.tpl | 55 - .../charts/common/templates/_labels.tpl | 18 - .../charts/common/templates/_names.tpl | 52 - .../charts/common/templates/_secrets.tpl | 129 --- .../charts/common/templates/_storage.tpl | 23 - .../charts/common/templates/_tplvalues.tpl | 13 - .../charts/common/templates/_utils.tpl | 62 - .../charts/common/templates/_warnings.tpl | 14 - .../templates/validations/_cassandra.tpl | 72 -- .../common/templates/validations/_mariadb.tpl | 103 -- .../common/templates/validations/_mongodb.tpl | 108 -- .../templates/validations/_postgresql.tpl | 129 --- .../common/templates/validations/_redis.tpl | 76 -- .../templates/validations/_validations.tpl | 46 - .../postgresql/charts/common/values.yaml | 5 - .../postgresql/ci/commonAnnotations.yaml | 3 - .../charts/postgresql/ci/default-values.yaml | 1 - .../ci/shmvolume-disabled-values.yaml | 2 - .../18.4.0/charts/postgresql/files/README.md | 1 - .../charts/postgresql/files/conf.d/README.md | 4 - .../docker-entrypoint-initdb.d/README.md | 3 - .../charts/postgresql/templates/NOTES.txt | 89 -- .../charts/postgresql/templates/_helpers.tpl | 361 ------ .../postgresql/templates/configmap.yaml | 34 - .../templates/extended-config-configmap.yaml | 29 - .../postgresql/templates/extra-list.yaml | 4 - .../templates/initialization-configmap.yaml | 26 - .../templates/metrics-configmap.yaml | 17 - .../postgresql/templates/metrics-svc.yaml | 29 - .../postgresql/templates/networkpolicy.yaml | 42 - .../templates/podsecuritypolicy.yaml | 42 - .../postgresql/templates/prometheusrule.yaml | 26 - .../charts/postgresql/templates/role.yaml | 24 - .../postgresql/templates/rolebinding.yaml | 23 - .../charts/postgresql/templates/secrets.yaml | 27 - .../postgresql/templates/serviceaccount.yaml | 15 - .../postgresql/templates/servicemonitor.yaml | 42 - .../templates/statefulset-readreplicas.yaml | 436 ------- .../postgresql/templates/statefulset.yaml | 642 ----------- .../postgresql/templates/svc-headless.yaml | 31 - .../postgresql/templates/svc-read-set.yaml | 42 - .../charts/postgresql/templates/svc-read.yaml | 47 - .../charts/postgresql/templates/svc.yaml | 45 - .../postgresql/templates/tls-secrets.yaml | 25 - .../charts/postgresql/values.schema.json | 103 -- .../18.4.0/charts/postgresql/values.yaml | 1001 ----------------- .../18.4.0/ci/h2-and-ingress-values.yaml | 75 -- .../18.4.0/ci/postgres-ha-values.yaml | 73 -- .../helm/keycloak/18.4.0/custom-values.yaml | 105 -- .../helm/keycloak/18.4.0/scripts/keycloak.cli | 13 - .../helm/keycloak/18.4.0/templates/NOTES.txt | 65 -- .../18.4.0/templates/service-headless.yaml | 18 - .../18.4.0/templates/serviceaccount.yaml | 19 - .../helm/keycloakx/7.2.2/.bumpversion.cfg | 7 + .../common => keycloakx/7.2.2}/.helmignore | 3 + .../helm/keycloakx/7.2.2/BUILD-README.md | 85 ++ .../helm/keycloakx/7.2.2/CUSTOM-README.md | 117 ++ manifests/helm/keycloakx/7.2.2/Chart.yaml | 24 + .../18.4.0 => keycloakx/7.2.2}/OWNERS | 2 - manifests/helm/keycloakx/7.2.2/README.md | 655 +++++++++++ .../helm/keycloakx/7.2.2/custom-values.yaml | 63 ++ .../helm/keycloakx/7.2.2/templates/NOTES.txt | 61 + .../7.2.2}/templates/_helpers.tpl | 48 +- .../7.2.2}/templates/configmap-startup.yaml | 2 +- .../7.2.2/templates/database-secret.yaml | 12 + .../7.2.2/templates/extra-manifests.yaml | 4 + .../7.2.2}/templates/hpa.yaml | 3 +- .../keycloakx/7.2.2/templates/httproute.yaml | 99 ++ .../7.2.2}/templates/ingress.yaml | 55 +- .../7.2.2}/templates/networkpolicy.yaml | 10 +- .../7.2.2}/templates/poddisruptionbudget.yaml | 7 +- .../7.2.2}/templates/prometheusrule.yaml | 5 + .../7.2.2}/templates/rbac.yaml | 4 +- .../7.2.2}/templates/route.yaml | 1 + .../7.2.2}/templates/secrets.yaml | 1 + .../7.2.2/templates/service-headless.yaml | 30 + .../7.2.2}/templates/service-http.yaml | 17 +- .../7.2.2/templates/serviceaccount.yaml | 47 + .../7.2.2}/templates/servicemonitor.yaml | 21 +- .../7.2.2}/templates/statefulset.yaml | 122 +- .../7.2.2}/templates/test/configmap-test.yaml | 27 +- .../7.2.2}/templates/test/pod-test.yaml | 7 +- .../7.2.2}/values.schema.json | 193 +++- .../18.4.0 => keycloakx/7.2.2}/values.yaml | 287 +++-- 99 files changed, 1805 insertions(+), 7432 deletions(-) delete mode 100644 manifests/helm/keycloak/18.4.0/BUILD-README.md delete mode 100644 manifests/helm/keycloak/18.4.0/CUSTOM-README.md delete mode 100644 manifests/helm/keycloak/18.4.0/Chart.lock delete mode 100644 manifests/helm/keycloak/18.4.0/Chart.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/README.md delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/.helmignore delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.lock delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/README.md delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/Chart.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/README.md delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_affinities.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_capabilities.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_errors.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_images.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_ingress.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_labels.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_names.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_secrets.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_storage.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_tplvalues.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_utils.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_warnings.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_cassandra.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mariadb.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mongodb.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_postgresql.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_redis.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_validations.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/ci/commonAnnotations.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/ci/default-values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/ci/shmvolume-disabled-values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/files/README.md delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/files/conf.d/README.md delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/files/docker-entrypoint-initdb.d/README.md delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/NOTES.txt delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/_helpers.tpl delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/configmap.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extended-config-configmap.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extra-list.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/initialization-configmap.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-configmap.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-svc.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/networkpolicy.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/podsecuritypolicy.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/prometheusrule.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/role.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/rolebinding.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/secrets.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/serviceaccount.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/servicemonitor.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset-readreplicas.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-headless.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read-set.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/templates/tls-secrets.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/values.schema.json delete mode 100644 manifests/helm/keycloak/18.4.0/charts/postgresql/values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/ci/h2-and-ingress-values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/ci/postgres-ha-values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/custom-values.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/scripts/keycloak.cli delete mode 100644 manifests/helm/keycloak/18.4.0/templates/NOTES.txt delete mode 100644 manifests/helm/keycloak/18.4.0/templates/service-headless.yaml delete mode 100644 manifests/helm/keycloak/18.4.0/templates/serviceaccount.yaml create mode 100644 manifests/helm/keycloakx/7.2.2/.bumpversion.cfg rename manifests/helm/{keycloak/18.4.0/charts/postgresql/charts/common => keycloakx/7.2.2}/.helmignore (94%) create mode 100644 manifests/helm/keycloakx/7.2.2/BUILD-README.md create mode 100644 manifests/helm/keycloakx/7.2.2/CUSTOM-README.md create mode 100644 manifests/helm/keycloakx/7.2.2/Chart.yaml rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/OWNERS (66%) create mode 100644 manifests/helm/keycloakx/7.2.2/README.md create mode 100644 manifests/helm/keycloakx/7.2.2/custom-values.yaml create mode 100644 manifests/helm/keycloakx/7.2.2/templates/NOTES.txt rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/_helpers.tpl (57%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/configmap-startup.yaml (85%) create mode 100644 manifests/helm/keycloakx/7.2.2/templates/database-secret.yaml create mode 100644 manifests/helm/keycloakx/7.2.2/templates/extra-manifests.yaml rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/hpa.yaml (90%) create mode 100644 manifests/helm/keycloakx/7.2.2/templates/httproute.yaml rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/ingress.yaml (62%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/networkpolicy.yaml (83%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/poddisruptionbudget.yaml (67%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/prometheusrule.yaml (84%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/rbac.yaml (80%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/route.yaml (95%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/secrets.yaml (94%) create mode 100644 manifests/helm/keycloakx/7.2.2/templates/service-headless.yaml rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/service-http.yaml (82%) create mode 100644 manifests/helm/keycloakx/7.2.2/templates/serviceaccount.yaml rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/servicemonitor.yaml (59%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/statefulset.yaml (57%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/test/configmap-test.yaml (59%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/templates/test/pod-test.yaml (81%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/values.schema.json (70%) rename manifests/helm/{keycloak/18.4.0 => keycloakx/7.2.2}/values.yaml (62%) diff --git a/manifests/helm/keycloak/18.4.0/BUILD-README.md b/manifests/helm/keycloak/18.4.0/BUILD-README.md deleted file mode 100644 index 64a0837..0000000 --- a/manifests/helm/keycloak/18.4.0/BUILD-README.md +++ /dev/null @@ -1,83 +0,0 @@ -# keycloak 버전 갱신 가이드 - -## 1. git 작업 환경 구성 - -- DIP 카탈로그 git 다운로드 -``` -$ git clone https://github.com/paasup/dip-catalog.git -``` - -- 작업 브랜치로 체크아웃 -``` -$ git checkout -b update-keycloak/18.4.0 -``` - -## 2. helm chart 업데이트 - -#### * keycloak 차트 변경 시 참고 -- 현재 keycloak 배포시 codecentric의 차트를 사용하고 있지만 17.0.1 이상의 버전은 제공하고 있지 않아 bitnami 차트로 변경이 필요하다. - -### 1) 차트 버전 변경 - -- BUILD-README.md, CUSTOM-README.md, custom-values.yaml을 제외한 파일 삭제. - ``` sh - # chart 디렉토리로 이동 - cd ~/dip-catalog/charts/keycloak - - # 파일 삭제 전 삭제할 파일 목록 확인 - find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -print - - # 파일 삭제 - find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -exec rm -rf {} + - ``` - - -- codecentric/keycloak 차트 다운로드 - ``` sh - # charts 디렉토리로 이동 - cd ~/dip-catalog/charts - - # helm repo 추가 - helm repo add keycloak https://codecentric.github.io/helm-charts - helm repo update - - # helm 차트 - helm pull keycloak/keycloak --version="18.4.0" - - # 차트 변경 - tar xzvf keycloak-*.tgz - - # 필요 없는 파일 삭제 - rm keycloak-*.tgz - rm keycloak/.helmignore keycloak/.bumpversion.cfg - ``` - - -## 3. git push 및 tag 추가 -- 갱신작업 진행후 commit -``` -$ git add . -$ git commit -m "update keycloak/18.4.0" -``` - -- main 브랜치에 체크아웃 후 merge -``` -$ git checkout main -$ git merge update-keycloak/18.4.0 -``` - -- git에 push 후 작업 브랜치 삭제 -``` -$ git push -u origin main -$ git branch -d update-keycloak/18.4.0 -``` - -- git tag 추가 후 push -``` -$ git tag keycloak/18.4.0 -$ git push origin keycloak/18.4.0 -``` -## 4. 차트 버전 정보 -- keycloak/18.4.0 - - 서비스 배포를 위하여 custom-values.yam에 정의하였다. - - 차트의 빌드 방법과 배포 방법을 BUILD-README.md, CUSTOM-README.md 문서에 작성하였다. \ No newline at end of file diff --git a/manifests/helm/keycloak/18.4.0/CUSTOM-README.md b/manifests/helm/keycloak/18.4.0/CUSTOM-README.md deleted file mode 100644 index b3372bf..0000000 --- a/manifests/helm/keycloak/18.4.0/CUSTOM-README.md +++ /dev/null @@ -1,157 +0,0 @@ -# keycloak 배포 - -## 1. 배포 방법 -### 1) 배포시 주의 사항 -- keycloak을 배포하기 위해서 postgresql이 필요하다. -- postgresql 설치는 내장 DB 또는 [dip-catalog/postgresql-ha](https://github.com/paasup/dip-catalog/tree/postgresql-ha/11.9.4-1/charts/postgresql-ha)를 배포하여 사용할 수 있다. - -### 2) 배포 방법 -``` sh -git clone https://github.com/paasup/dip-catalog.git -cd charts/keycloak -helm upgrade keycloak ./ -f custom-values.yaml --install -n platform --create-namespace -``` - -## 2.custom-values.yaml 설명 - -- custom-values.yaml에 정의된 값에 대한 설명이다. - -### 1) pod 설정 -- private 환경 배포시 사용한다. - -| Name | 설명 | 기본값 | -| ---------------------- | ----------------------------------| ------ | -| `image.repository` | 오프라인 설치 시에 설정.
오프라인 설치 시에는 "paasup.io"을 추가. | `"paasup/keycloak"` | -| `resources` | keycloak pod의 자원 설정. | `custom-values.yaml 참조` | - - -### 2) Postgresql 연동 설정 - -#### 내장 DB 사용 - -- custom-values.yaml 수정 -``` yaml -postgresql: - enabled: enable - -extraEnv: | - - name: KEYCLOAK_USER - value: admin - - name: KEYCLOAK_PASSWORD - value: Paasadm1234! - - name: KEYCLOAK_FRONTEND_URL - value: "https://keycloak.exmaple.org/auth" # keycloak 도메인으로 변경 - - name: JGROUPS_DISCOVERY_PROTOCOL - value: dns.DNS_PING - - name: JGROUPS_DISCOVERY_PROPERTIES - value: 'dns_query=keycloak-headless.platform.svc.cluster.local' - - name: CACHE_OWNERS_COUNT - value: "2" - - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - value: "2" - - name: TZ - value: Asia/Seoul -``` - -#### dip-catalog/postgresql-ha 배포 시 - -- custom-values.yaml 수정 - -``` yaml -postgresql: - enabled: false - -# 외부 DB 사용 시 -## DB_VENDOR, DB_ADDR, DB_PORT, DB_DATABASE, DB_SCHEMA의 값을 배포된 DB의 값으로 변경 -# keycloak 사용자 설정 -## KEYCLOAK_USER : 관리자 계정 설정 -## KEYCLOAK_PASSWORD : 관리자 계정 비밀번호 설정 -# keycloak domain 설정 -## KEYCLOAK_FRONTEND_URL: 사용할 keycloak 도메인으로 변경 -extraEnv: | - - name: DB_VENDOR - value: postgres - - name: DB_ADDR - value: postgresql-postgresql-ha-postgresql - - name: DB_PORT - value: "5432" - - name: DB_DATABASE - value: keycloak - - name: DB_SCHEMA - value: keycloak - - name: KEYCLOAK_USER - value: admin - - name: KEYCLOAK_PASSWORD - value: Paasadm1234! - - name: KEYCLOAK_FRONTEND_URL - value: "https://keycloak.exmaple.org/auth" # keycloak 도메인으로 변경 - - name: JGROUPS_DISCOVERY_PROTOCOL - value: dns.DNS_PING - - name: JGROUPS_DISCOVERY_PROPERTIES - value: 'dns_query=keycloak-headless.platform.svc.cluster.local' - - name: CACHE_OWNERS_COUNT - value: "2" - - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - value: "2" - - name: TZ - value: Asia/Seoul - -extraEnvFrom: | - - secretRef: - name: 'keycloak-db' - -secrets: - db: - stringData: - DB_USER: keycloak # keycloak이 사용할 DB의 사용자 이름 - DB_PASSWORD: keycloak # keycloak이 사용할 DB의 사용자 비밀번호 -``` - -### 3) Ingress 설정 - -#### 3.1) tls 시크릿 직접 생성 - -- flowise에서 ingress 사용을 위해서는 다음과 같이 설정할 수 있다. - - ``` yaml - ingress: - enabled: true - rules: - - host: keycloak.example.org # keycloak에서 사용할 도메인으로 변경 - paths: - - path: / - pathType: Prefix - tls: - - hosts: - - keycloak.exmaple.org # keycloak에서 사용할 도메인으로 변경 - secretName: keycloak-tls - ``` - -- ingress 사용을 위해서는 인증서를 secret으로 제공해야한다. 로컬 파일을 이용해 secret을 생성하는 방법은 다음과 같다. - - ``` sh - kubectl create secret tls flowise-tls-secret --cert= --key= -n - ``` - -#### 3.2) cert-manager를 이용한 자동 생성 - -- cert manager를 통해 인증서 자동 생성 시 `custom-values.yaml` 수정한다. -- `ingress.annotations.cert-manager.io/cluster-issuer`에 미리 배포된 Cluster Issuer의 이름으로 변경한다. - - ``` yaml - ingress: - enabled: true - annotations: - cert-manager.io/cluster-issuer: "selfsigned-issuer" - cert-manager.io/duration: 8760h - cert-manager.io/renew-before: 720h - rules: - - host: keycloak.example.org # keycloak에서 사용할 도메인으로 변경 - paths: - - path: / - pathType: Prefix - tls: - - hosts: - - keycloak.exmaple.org # keycloak에서 사용할 도메인으로 변경 - secretName: keycloak-tls - ``` \ No newline at end of file diff --git a/manifests/helm/keycloak/18.4.0/Chart.lock b/manifests/helm/keycloak/18.4.0/Chart.lock deleted file mode 100644 index c366144..0000000 --- a/manifests/helm/keycloak/18.4.0/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 10.16.2 -digest: sha256:e09e206d81074a6540102fb62b8b12cf943c934c2af21e58ff8caa259690e87a -generated: "2022-07-13T10:22:59.711349+02:00" diff --git a/manifests/helm/keycloak/18.4.0/Chart.yaml b/manifests/helm/keycloak/18.4.0/Chart.yaml deleted file mode 100644 index 16314d6..0000000 --- a/manifests/helm/keycloak/18.4.0/Chart.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v2 -appVersion: 17.0.1-legacy -dependencies: -- condition: postgresql.enabled - name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 10.16.2 -description: Open Source Identity and Access Management For Modern Applications and Services -home: https://www.keycloak.org/ -icon: https://www.keycloak.org/resources/images/keycloak_icon_512px.svg -keywords: -- sso -- idm -- openid connect -- saml -- kerberos -- ldap -maintainers: -- email: unguiculus@gmail.com - name: unguiculus -- email: thomas.darimont+github@gmail.com - name: thomasdarimont -name: keycloak -sources: -- https://github.com/codecentric/helm-charts -- https://github.com/jboss-dockerfiles/keycloak -- https://github.com/bitnami/charts/tree/master/bitnami/postgresql -version: 18.4.0 diff --git a/manifests/helm/keycloak/18.4.0/README.md b/manifests/helm/keycloak/18.4.0/README.md deleted file mode 100644 index 0e25c61..0000000 --- a/manifests/helm/keycloak/18.4.0/README.md +++ /dev/null @@ -1,903 +0,0 @@ -# Keycloak - -[Keycloak](http://www.keycloak.org/) is an open source identity and access management for modern applications and services. - -## TL;DR; - -```console -$ helm install keycloak codecentric/keycloak -``` - -## Introduction - -This chart bootstraps a [Keycloak](http://www.keycloak.org/) StatefulSet on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. -It provisions a fully featured Keycloak installation. -For more information on Keycloak and its capabilities, see its [documentation](http://www.keycloak.org/documentation.html). - -## Prerequisites Details - -The chart has an optional dependency on the [PostgreSQL](https://github.com/bitnami/charts/tree/master/bitnami/postgresql) chart. -By default, the PostgreSQL chart requires PV support on underlying infrastructure (may be disabled). - -**Important** -Since Version `v16.0.0` the support for Helm v2 is dropped in favor of to support also the latest postgres Helm Chart Version which requires Helm v3 only. - -## Installing the Chart - -To install the chart with the release name `keycloak`: - -```console -$ helm install keycloak codecentric/keycloak -``` - -## Uninstalling the Chart - -To uninstall the `keycloak` deployment: - -```console -$ helm uninstall keycloak -``` - -## Configuration - -The following table lists the configurable parameters of the Keycloak chart and their default values. - -| Parameter | Description | Default | -|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---| -| `fullnameOverride` | Optionally override the fully qualified name | `""` | -| `nameOverride` | Optionally override the name | `""` | -| `replicas` | The number of replicas to create | `1` | -| `image.repository` | The Keycloak image repository | `quay.io/keycloak/keycloak` | -| `image.tag` | Overrides the Keycloak image tag whose default is the chart version. Note versions after 16.1.1 need to use the `-legacy` suffix, e.g. `17.0.1-legacy` | `""` | -| `image.pullPolicy` | The Keycloak image pull policy | `IfNotPresent` | -| `imagePullSecrets` | Image pull secrets for the Pod | `[]` | -| `hostAliases` | Mapping between IPs and hostnames that will be injected as entries in the Pod's hosts files | `[]` | -| `enableServiceLinks` | Indicates whether information about services should be injected into Pod's environment variables, matching the syntax of Docker links | `true` | -| `podManagementPolicy` | Pod management policy. One of `Parallel` or `OrderedReady` | `Parallel` | -| `updateStrategy` | StatefulSet update strategy. One of `RollingUpdate` or `OnDelete` | `RollingUpdate` | -| `restartPolicy` | Pod restart policy. One of `Always`, `OnFailure`, or `Never` | `Always` | -| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | -| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `""` | -| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` | -| `serviceAccount.labels` | Additional labels for the ServiceAccount | `{}` | -| `serviceAccount.imagePullSecrets` | Image pull secrets that are attached to the ServiceAccount | `[]` | -| `rbac.create` | Specifies whether RBAC resources are to be created | `false` -| `rbac.rules` | Custom RBAC rules, e. g. for KUBE_PING | `[]` -| `podSecurityContext` | SecurityContext for the entire Pod. Every container running in the Pod will inherit this SecurityContext. This might be relevant when other components of the environment inject additional containers into running Pods (service meshes are the most prominent example for this) | `{"fsGroup":1000}` | -| `securityContext` | SecurityContext for the Keycloak container | `{"runAsNonRoot":true,"runAsUser":1000}` | -| `extraInitContainers` | Additional init containers, e. g. for providing custom themes | `[]` | -| `skipInitContainers` | Skip all init containers (to avoid issues with service meshes which require sidecar proxies for connectivity) | `false` -| `extraContainers` | Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy | `[]` | -| `lifecycleHooks` | Lifecycle hooks for the Keycloak container | `{}` | -| `terminationGracePeriodSeconds` | Termination grace period in seconds for Keycloak shutdown. Clusters with a large cache might need to extend this to give Infinispan more time to rebalance | `60` | -| `clusterDomain` | The internal Kubernetes cluster domain | `cluster.local` | -| `command` | Overrides the default entrypoint of the Keycloak container | `[]` | -| `args` | Overrides the default args for the Keycloak container | `[]` | -| `extraEnv` | Additional environment variables for Keycloak | `""` | -| `extraEnvFrom` | Additional environment variables for Keycloak mapped from a Secret or ConfigMap | `""` | -| `priorityClassName` | Pod priority class name | `""` | -| `affinity` | Pod affinity | Hard node and soft zone anti-affinity | -| `topologySpreadConstraints` | Topology spread constraints | Constraints used to spread pods | -| `nodeSelector` | Node labels for Pod assignment | `{}` | -| `tolerations` | Node taints to tolerate | `[]` | -| `podLabels` | Additional Pod labels | `{}` | -| `podAnnotations` | Additional Pod annotations | `{}` | -| `livenessProbe` | Liveness probe configuration | `{"httpGet":{"path":"/auth/","port":"http"},"initialDelaySeconds":0,"timeoutSeconds":5}` | -| `readinessProbe` | Readiness probe configuration | `{"httpGet":{"path":"/auth/realms/master","port":"http"},"initialDelaySeconds":30,"timeoutSeconds":1}` | -| `startupProbe` | Startup probe configuration | `{"httpGet":{"path":"/auth/","port":"http"},"initialDelaySeconds":30,"timeoutSeconds":5, "failureThreshold": 60, "periodSeconds": 5}` | -| `resources` | Pod resource requests and limits | `{}` | -| `startupScripts` | Startup scripts to run before Keycloak starts up | `{"keycloak.cli":"{{- .Files.Get "scripts/keycloak.cli" \| nindent 2 }}"}` | -| `extraVolumes` | Add additional volumes, e. g. for custom themes | `""` | -| `extraVolumeMounts` | Add additional volumes mounts, e. g. for custom themes | `""` | -| `extraPorts` | Add additional ports, e. g. for admin console or exposing JGroups ports | `[]` | -| `podDisruptionBudget` | Pod disruption budget | `{}` | -| `statefulsetAnnotations` | Annotations for the StatefulSet | `{}` | -| `statefulsetLabels` | Additional labels for the StatefulSet | `{}` | -| `secrets` | Configuration for secrets that should be created | `{}` | -| `service.annotations` | Annotations for headless and HTTP Services | `{}` | -| `service.labels` | Additional labels for headless and HTTP Services | `{}` | -| `service.type` | The Service type | `ClusterIP` | -| `service.loadBalancerIP` | Optional IP for the load balancer. Used for services of type LoadBalancer only | `""` | -| `loadBalancerSourceRanges` | Optional List of allowed source ranges (CIDRs). Used for service of type LoadBalancer only | `[]` | -| `service.externalTrafficPolicy` | Optional external traffic policy. Used for services of type LoadBalancer only | `"Cluster"` | -| `service.httpPort` | The http Service port | `80` | -| `service.httpNodePort` | The HTTP Service node port if type is NodePort | `""` | -| `service.httpsPort` | The HTTPS Service port | `8443` | -| `service.httpsNodePort` | The HTTPS Service node port if type is NodePort | `""` | -| `service.httpManagementPort` | The WildFly management Service port | `9990` | -| `service.httpManagementNodePort` | The WildFly management node port if type is NodePort | `""` | -| `service.extraPorts` | Additional Service ports, e. g. for custom admin console | `[]` | -| `service.sessionAffinity` | sessionAffinity for Service, e. g. "ClientIP" | `""` | -| `service.sessionAffinityConfig` | sessionAffinityConfig for Service | `{}` | -| `ingress.enabled` | If `true`, an Ingress is created | `false` | -| `ingress.rules` | List of Ingress Ingress rule | see below | -| `ingress.rules[0].host` | Host for the Ingress rule | `{{ .Release.Name }}.keycloak.example.com` | -| `ingress.rules[0].paths` | Paths for the Ingress rule | see below | -| `ingress.rules[0].paths[0].path` | Path for the Ingress rule | `/` | -| `ingress.rules[0].paths[0].pathType` | Path Type for the Ingress rule | `Prefix` | -| `ingress.servicePort` | The Service port targeted by the Ingress | `http` | -| `ingress.annotations` | Ingress annotations | `{}` | -| `ingress.ingressClassName` | The name of the Ingress Class associated with the ingress | `""` | -| `ingress.labels` | Additional Ingress labels | `{}` | -| `ingress.tls` | TLS configuration | see below | -| `ingress.tls[0].hosts` | List of TLS hosts | `[keycloak.example.com]` | -| `ingress.tls[0].secretName` | Name of the TLS secret | `""` | -| `ingress.console.enabled` | If `true`, an Ingress for the console is created | `false` | -| `ingress.console.rules` | List of Ingress Ingress rule for the console | see below | -| `ingress.console.rules[0].host` | Host for the Ingress rule for the console | `{{ .Release.Name }}.keycloak.example.com` | -| `ingress.console.rules[0].paths` | Paths for the Ingress rule for the console | see below | -| `ingress.console.rules[0].paths[0].path` | Path for the Ingress rule for the console | `[/auth/admin]` | -| `ingress.console.rules[0].paths[0].pathType` | Path Type for the Ingress rule for the console | `Prefix` | -| `ingress.console.annotations` | Ingress annotations for the console | `{}` | -| `ingress.console.ingressClassName` | The name of the Ingress Class associated with the console ingress | `""` | -| `ingress.console.tls` | TLS configuration | see below | -| `ingress.console.tls[0].hosts` | List of TLS hosts | `[keycloak.example.com]` | -| `ingress.console.tls[0].secretName` | Name of the TLS secret | `""` | -| `networkPolicy.enabled` | If true, the ingress network policy is deployed | `false` -| `networkPolicy.extraFrom` | Allows to define allowed external traffic (see Kubernetes doc for network policy `from` format) | `[]` -| `route.enabled` | If `true`, an OpenShift Route is created | `false` | -| `route.path` | Path for the Route | `/` | -| `route.annotations` | Route annotations | `{}` | -| `route.labels` | Additional Route labels | `{}` | -| `route.host` | Host name for the Route | `""` | -| `route.tls.enabled` | If `true`, TLS is enabled for the Route | `true` | -| `route.tls.insecureEdgeTerminationPolicy` | Insecure edge termination policy of the Route. Can be `None`, `Redirect`, or `Allow` | `Redirect` | -| `route.tls.termination` | TLS termination of the route. Can be `edge`, `passthrough`, or `reencrypt` | `edge` | -| `pgchecker.image.repository` | Docker image used to check Postgresql readiness at startup | `docker.io/busybox` | -| `pgchecker.image.tag` | Image tag for the pgchecker image | `1.32` | -| `pgchecker.image.pullPolicy` | Image pull policy for the pgchecker image | `IfNotPresent` | -| `pgchecker.securityContext` | SecurityContext for the pgchecker container | `{"allowPrivilegeEscalation":false,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}` | -| `pgchecker.resources` | Resource requests and limits for the pgchecker container | `{"limits":{"cpu":"10m","memory":"16Mi"},"requests":{"cpu":"10m","memory":"16Mi"}}` | -| `postgresql.enabled` | If `true`, the Postgresql dependency is enabled | `true` | -| `postgresql.postgresqlUsername` | PostgreSQL User to create | `keycloak` | -| `postgresql.postgresqlPassword` | PostgreSQL Password for the new user | `keycloak` | -| `postgresql.postgresqlDatabase` | PostgreSQL Database to create | `keycloak` | -| `serviceMonitor.enabled` | If `true`, a ServiceMonitor resource for the prometheus-operator is created | `false` | -| `serviceMonitor.namespace` | Optionally sets a target namespace in which to deploy the ServiceMonitor resource | `""` | -| `serviceMonitor.namespaceSelector` | Optionally sets a namespace selector for the ServiceMonitor | `{}` | -| `serviceMonitor.annotations` | Annotations for the ServiceMonitor | `{}` | -| `serviceMonitor.labels` | Additional labels for the ServiceMonitor | `{}` | -| `serviceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` | -| `serviceMonitor.scrapeTimeout` | Timeout for scraping | `10s` | -| `serviceMonitor.path` | The path at which metrics are served | `/metrics` | -| `serviceMonitor.port` | The Service port at which metrics are served | `http` | -| `extraServiceMonitor.enabled` | If `true`, an additional ServiceMonitor resource for the prometheus-operator is created. Could be used for additional metrics via [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi) | `false` | -| `extraServiceMonitor.namespace` | Optionally sets a target namespace in which to deploy the additional ServiceMonitor resource | `""` | -| `extraServiceMonitor.namespaceSelector` | Optionally sets a namespace selector for the additional ServiceMonitor | `{}` | -| `extraServiceMonitor.annotations` | Annotations for the additional ServiceMonitor | `{}` | -| `extraServiceMonitor.labels` | Additional labels for the additional ServiceMonitor | `{}` | -| `extraServiceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` | -| `extraServiceMonitor.scrapeTimeout` | Timeout for scraping | `10s` | -| `extraServiceMonitor.path` | The path at which metrics are served | `/metrics` | -| `extraServiceMonitor.port` | The Service port at which metrics are served | `http` | -| `prometheusRule.enabled` | If `true`, a PrometheusRule resource for the prometheus-operator is created | `false` | -| `prometheusRule.annotations` | Annotations for the PrometheusRule | `{}` | -| `prometheusRule.labels` | Additional labels for the PrometheusRule | `{}` | -| `prometheusRule.rules` | List of rules for Prometheus | `[]` | -| `autoscaling.enabled` | Enable creation of a HorizontalPodAutoscaler resource | `false` | -| `autoscaling.labels` | Additional labels for the HorizontalPodAutoscaler resource | `{}` | -| `autoscaling.minReplicas` | The minimum number of Pods when autoscaling is enabled | `3` | -| `autoscaling.maxReplicas` | The maximum number of Pods when autoscaling is enabled | `10` | -| `autoscaling.metrics` | The metrics configuration for the HorizontalPodAutoscaler | `[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}]` | -| `autoscaling.behavior` | The scaling policy configuration for the HorizontalPodAutoscaler | `{"scaleDown":{"policies":[{"periodSeconds":300,"type":"Pods","value":1}],"stabilizationWindowSeconds":300}` | -| `test.enabled` | If `true`, test resources are created | `false` | -| `test.image.repository` | The image for the test Pod | `docker.io/unguiculus/docker-python3-phantomjs-selenium` | -| `test.image.tag` | The tag for the test Pod image | `v1` | -| `test.image.pullPolicy` | The image pull policy for the test Pod image | `IfNotPresent` | -| `test.podSecurityContext` | SecurityContext for the entire test Pod | `{"fsGroup":1000}` | -| `test.securityContext` | SecurityContext for the test container | `{"runAsNonRoot":true,"runAsUser":1000}` | -| `test.deletionPolicy` | `helm.sh/hook-delete-policy` for the test Pod | `before-hook-creation` | - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: - -```console -$ helm install keycloak codecentric/keycloak -n keycloak --set replicas=1 -``` - -Alternatively, a YAML file that specifies the values for the parameters can be provided while -installing the chart. For example: - -```console -$ helm install keycloak codecentric/keycloak -n keycloak --values values.yaml -``` - -The chart offers great flexibility. -It can be configured to work with the official Keycloak Docker image but any custom image can be used as well. - -For the offical Docker image, please check it's configuration at https://github.com/keycloak/keycloak-containers/tree/master/server. - -### Usage of the `tpl` Function - -The `tpl` function allows us to pass string values from `values.yaml` through the templating engine. -It is used for the following values: - -* `extraInitContainers` -* `extraContainers` -* `extraEnv` -* `extraEnvFrom` -* `affinity` -* `extraVolumeMounts` -* `extraVolumes` -* `livenessProbe` -* `readinessProbe` -* `startupProbe` -* `topologySpreadConstraints` - -Additionally, custom labels and annotations can be set on various resources the values of which being passed through `tpl` as well. - -It is important that these values be configured as strings. -Otherwise, installation will fail. -See example for Google Cloud Proxy or default affinity configuration in `values.yaml`. - -### JVM Settings - -Keycloak sets the following system properties by default: -`-Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true` - -You can override these by setting the `JAVA_OPTS` environment variable. -Make sure you configure container support. -This allows you to only configure memory using Kubernetes resources and the JVM will automatically adapt. - -```yaml -extraEnv: | - - name: JAVA_OPTS - value: >- - -XX:+UseContainerSupport - -XX:MaxRAMPercentage=50.0 - -Djava.net.preferIPv4Stack=true - -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS - -Djava.awt.headless=true -``` - -### Database Setup - -By default, Bitnami's [PostgreSQL](https://github.com/bitnami/charts/tree/master/bitnami/postgresql) chart is deployed and used as database. -Please refer to this chart for additional PostgreSQL configuration options. - -#### Using an External Database - -The Keycloak Docker image supports various database types. -Configuration happens in a generic manner. - -##### Using a Secret Managed by the Chart - -The following examples uses a PostgreSQL database with a secret that is managed by the Helm chart. - -```yaml -postgresql: - # Disable PostgreSQL dependency - enabled: false - -extraEnv: | - - name: DB_VENDOR - value: postgres - - name: DB_ADDR - value: mypostgres - - name: DB_PORT - value: "5432" - - name: DB_DATABASE - value: mydb - -extraEnvFrom: | - - secretRef: - name: '{{ include "keycloak.fullname" . }}-db' - -secrets: - db: - stringData: - DB_USER: '{{ .Values.dbUser }}' - DB_PASSWORD: '{{ .Values.dbPassword }}' -``` - -`dbUser` and `dbPassword` are custom values you'd then specify on the commandline using `--set-string`. - -##### Using an Existing Secret - -The following examples uses a PostgreSQL database with a secret. -Username and password are mounted as files. - -```yaml -postgresql: - # Disable PostgreSQL dependency - enabled: false - -extraEnv: | - - name: DB_VENDOR - value: postgres - - name: DB_ADDR - value: mypostgres - - name: DB_PORT - value: "5432" - - name: DB_DATABASE - value: mydb - - name: DB_USER_FILE - value: /secrets/db-creds/user - - name: DB_PASSWORD_FILE - value: /secrets/db-creds/password - -extraVolumeMounts: | - - name: db-creds - mountPath: /secrets/db-creds - readOnly: true - -extraVolumes: | - - name: db-creds - secret: - secretName: keycloak-db-creds -``` - -### Creating a Keycloak Admin User - -The Keycloak Docker image supports creating an initial admin user. -It must be configured via environment variables: - -* `KEYCLOAK_USER` or `KEYCLOAK_USER_FILE` -* `KEYCLOAK_PASSWORD` or `KEYCLOAK_PASSWORD_FILE` - -Please refer to the section on database configuration for how to configure a secret for this. - -### High Availability and Clustering - -For high availability, Keycloak must be run with multiple replicas (`replicas > 1`). -The chart has a helper template (`keycloak.serviceDnsName`) that creates the DNS name based on the headless service. - -#### DNS_PING Service Discovery - -JGroups discovery via DNS_PING can be configured as follows: - -```yaml -extraEnv: | - - name: JGROUPS_DISCOVERY_PROTOCOL - value: dns.DNS_PING - - name: JGROUPS_DISCOVERY_PROPERTIES - value: 'dns_query={{ include "keycloak.serviceDnsName" . }}' - - name: CACHE_OWNERS_COUNT - value: "2" - - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - value: "2" -``` - -#### KUBE_PING Service Discovery - -Recent versions of Keycloak include a new Kubernetes native [KUBE_PING](https://github.com/jgroups-extras/jgroups-kubernetes) service discovery protocol. -This requires a little more configuration than DNS_PING but can easily be achieved with the Helm chart. - -As with DNS_PING some environment variables must be configured as follows: - -```yaml -extraEnv: | - - name: JGROUPS_DISCOVERY_PROTOCOL - value: kubernetes.KUBE_PING - - name: KUBERNETES_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: CACHE_OWNERS_COUNT - value: "2" - - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - value: "2" -``` - -However, the Keycloak Pods must also get RBAC permissions to `get` and `list` Pods in the namespace which can be configured as follows: - -```yaml -rbac: - create: true - rules: - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - list -``` - -#### Autoscaling - -Due to the caches in Keycloak only replicating to a few nodes (two in the example configuration above) and the limited controls around autoscaling built into Kubernetes, it has historically been problematic to autoscale Keycloak. -However, in Kubernetes 1.18 [additional controls were introduced](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior) which make it possible to scale down in a more controlled manner. - -The example autoscaling configuration in the values file scales from three up to a maximum of ten Pods using CPU utilization as the metric. Scaling up is done as quickly as required but scaling down is done at a maximum rate of one Pod per five minutes. - -Autoscaling can be enabled as follows: - -```yaml -autoscaling: - enabled: true -``` - -KUBE_PING service discovery seems to be the most reliable mechanism to use when enabling autoscaling, due to being faster than DNS_PING at detecting changes in the cluster. - -### Running Keycloak Behind a Reverse Proxy - -When running Keycloak behind a reverse proxy, which is the case when using an ingress controller, -proxy address forwarding must be enabled as follows: - -```yaml -extraEnv: | - - name: PROXY_ADDRESS_FORWARDING - value: "true" -``` - -### Providing a Custom Theme - -One option is certainly to provide a custom Keycloak image that includes the theme. -However, if you prefer to stick with the official Keycloak image, you can use an init container as theme provider. - -Create your own theme and package it up into a Docker image. - -```docker -FROM busybox -COPY mytheme /mytheme -``` - -In combination with an `emptyDir` that is shared with the Keycloak container, configure an init container that runs your theme image and copies the theme over to the right place where Keycloak will pick it up automatically. - -```yaml -extraInitContainers: | - - name: theme-provider - image: myuser/mytheme:1 - imagePullPolicy: IfNotPresent - command: - - sh - args: - - -c - - | - echo "Copying theme..." - cp -R /mytheme/* /theme - volumeMounts: - - name: theme - mountPath: /theme - -extraVolumeMounts: | - - name: theme - mountPath: /opt/jboss/keycloak/themes/mytheme - -extraVolumes: | - - name: theme - emptyDir: {} -``` - -### Setting a Custom Realm - -A realm can be added by creating a secret or configmap for the realm json file and then supplying this into the chart. -It can be mounted using `extraVolumeMounts` and then referenced as environment variable `KEYCLOAK_IMPORT`. -First we need to create a Secret from the realm JSON file using `kubectl create secret generic realm-secret --from-file=realm.json` which we need to reference in `values.yaml`: - -```yaml -extraVolumes: | - - name: realm-secret - secret: - secretName: realm-secret - -extraVolumeMounts: | - - name: realm-secret - mountPath: "/realm/" - readOnly: true - -extraEnv: | - - name: KEYCLOAK_IMPORT - value: /realm/realm.json -``` - -Alternatively, the realm file could be added to a custom image. - -After startup the web admin console for the realm should be available on the path /auth/admin/\/console/. - -### Using Google Cloud SQL Proxy - -Depending on your environment you may need a local proxy to connect to the database. -This is, e. g., the case for Google Kubernetes Engine when using Google Cloud SQL. -Create the secret for the credentials as documented [here](https://cloud.google.com/sql/docs/postgres/connect-kubernetes-engine) and configure the proxy as a sidecar. - -Because `extraContainers` is a string that is passed through the `tpl` function, it is possible to create custom values and use them in the string. - -```yaml -postgresql: - # Disable PostgreSQL dependency - enabled: false - -# Custom values for Google Cloud SQL -cloudsql: - project: my-project - region: europe-west1 - instance: my-instance - -extraContainers: | - - name: cloudsql-proxy - image: gcr.io/cloudsql-docker/gce-proxy:1.17 - command: - - /cloud_sql_proxy - args: - - -instances={{ .Values.cloudsql.project }}:{{ .Values.cloudsql.region }}:{{ .Values.cloudsql.instance }}=tcp:5432 - - -credential_file=/secrets/cloudsql/credentials.json - volumeMounts: - - name: cloudsql-creds - mountPath: /secrets/cloudsql - readOnly: true - -extraVolumes: | - - name: cloudsql-creds - secret: - secretName: cloudsql-instance-credentials - -extraEnv: | - - name: DB_VENDOR - value: postgres - - name: DB_ADDR - value: "127.0.0.1" - - name: DB_PORT - value: "5432" - - name: DB_DATABASE - value: postgres - - name: DB_USER - value: myuser - - name: DB_PASSWORD - value: mypassword -``` - -### Changing the Context Path - -By default, Keycloak is served under context `/auth`. -This can be changed as follows: - -```yaml -contextPath: mycontext - -startupScripts: - # cli script that reconfigures WildFly - contextPath.cli: | - embed-server --server-config=standalone-ha.xml --std-out=echo - batch - {{- if ne .Values.contextPath "auth" }} - /subsystem=keycloak-server/:write-attribute(name=web-context,value={{ if eq .Values.contextPath "" }}/{{ else }}{{ .Values.contextPath }}{{ end }}) - {{- if eq .Values.contextPath "" }} - /subsystem=undertow/server=default-server/host=default-host:write-attribute(name=default-web-module,value=keycloak-server.war) - {{- end }} - {{- end }} - run-batch - stop-embedded-server - -livenessProbe: | - httpGet: - path: {{ if ne .Values.contextPath "" }}/{{ .Values.contextPath }}{{ end }}/ - port: http - initialDelaySeconds: 0 - timeoutSeconds: 5 - -readinessProbe: | - httpGet: - path: {{ if ne .Values.contextPath "" }}/{{ .Values.contextPath }}{{ end }}/realms/master - port: http - initialDelaySeconds: 30 - timeoutSeconds: 1 - -startupProbe: | - httpGet: - path: /auth/ - port: http - initialDelaySeconds: 30 - timeoutSeconds: 1 - failureThreshold: 60 - periodSeconds: 5 -``` - -The above YAML references introduces the custom value `contextPath` which is possible because `startupScripts`, `livenessProbe`, `readinessProbe`, and `startupProbe` are templated using the `tpl` function. -Note that it must not start with a slash. -Alternatively, you may supply it via CLI flag: - -```console ---set-string contextPath=mycontext -``` - -### Prometheus Metrics Support - -#### WildFly Metrics - -WildFly can expose metrics on the management port. -In order to achieve this, the environment variable `KEYCLOAK_STATISTICS` must be set. - -```yaml -extraEnv: | - - name: KEYCLOAK_STATISTICS - value: all -``` - -Add a ServiceMonitor if using prometheus-operator: - -```yaml -serviceMonitor: - # If `true`, a ServiceMonitor resource for the prometheus-operator is created - enabled: true -``` - -Checkout `values.yaml` for customizing the ServiceMonitor and for adding custom Prometheus rules. - -Add annotations if you don't use prometheus-operator: - -```yaml -service: - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9990" -``` - -#### Keycloak Metrics SPI - -Optionally, it is possible to add [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi) via init container. - -A separate `ServiceMonitor` can be enabled to scrape metrics from the SPI: - -```yaml -extraServiceMonitor: - # If `true`, an additional ServiceMonitor resource for the prometheus-operator is created - enabled: true -``` - -Checkout `values.yaml` for customizing this ServiceMonitor. - -Note that the metrics endpoint is exposed on the HTTP port. -You may want to restrict access to it in your ingress controller configuration. -For ingress-nginx, this could be done as follows: - -```yaml -annotations: - nginx.ingress.kubernetes.io/server-snippet: | - location ~* /auth/realms/[^/]+/metrics { - return 403; - } -``` - -## Why StatefulSet? - -The chart sets node identifiers to the system property `jboss.node.name` which is in fact the pod name. -Node identifiers must not be longer than 23 characters. -This can be problematic because pod names are quite long. -We would have to truncate the chart's fullname to six characters because pods get a 17-character suffix (e. g. `-697f8b7655-mf5ht`). -Using a StatefulSet allows us to truncate to 20 characters leaving room for up to 99 replicas, which is much better. -Additionally, we get stable values for `jboss.node.name` which can be advantageous for cluster discovery. -The headless service that governs the StatefulSet is used for DNS discovery via DNS_PING. - -## Bad Gateway and Proxy Buffer Size in Nginx - -A common issue with Keycloak and nginx is that the proxy buffer may be too small for what Keycloak is trying to send. This will result in a Bad Gateway (502) error. There are [many](https://github.com/kubernetes/ingress-nginx/issues/4637) [issues](https://stackoverflow.com/questions/56126864/why-do-i-get-502-when-trying-to-authenticate) around the internet about this. The solution is to increase the buffer size of nginx. This can be done by creating an annotation in the ingress specification: - -```yaml -ingress: - annotations: - nginx.ingress.kubernetes.io/proxy-buffer-size: "128k" -``` - -## Upgrading - -### From chart < 17.0.1 - -* Keycloak is updated to 17.0.1 -* Use image from quay.io/keycloak/keycloak - -Note that we now need to add the `-legacy` suffix for the `Keycloak Legacy` image for the Wildfly based Keycloak as documented in [this Keycloak Blog Post](https://www.keycloak.org/2022/02/keycloak-1700-released#_migrating_from_the_preview_quarkus_distribution), -e.g.: `quay.io/keycloak/keycloak:17.0.1-legacy`. - - -Please read the additional notes about [Migrating to 17.0.0](https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-17-0-0) in the Keycloak documentation. - -### From chart < 16.0.0 - -* Keycloak is updated to 16.1.1 - -Please read the additional notes about [Migrating to 16.0.0](https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-16-0-0) in the Keycloak documentation. - -### From chart < 15.0.0 - -* Keycloak is updated to 15.0.2 - -### From chart < 14.0.0 - -Ingress path definitions are extended to describe path and pathType. Previously only the path was configured. Please adapt your configuration as shown below: - -Old: -```yaml -ingress: - # ... - rules: - - # ... - # Paths for the host - paths: - - / -``` -New: -```yaml -ingress: - # ... - rules: - - # ... - # Paths for the host - paths: - - path: / - pathType: Prefix -``` - -This allows to configure specific `pathType` configurations, e.g. `pathType: ImplementationSpecific` for [GKE Ingress on Google Cloud Platform](https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#default_backend). - -### From chart < 13.0.0 - -* Keycloak is updated to 14.0.0 - -Note that this might not be a seamless upgrade, because the clustering with older Keycloak versions might not work -due to incompatible infinispan versions. - -### From chart < 12.0.0 - -* Keycloak is updated to 13.0.1 - -Note that this might not be a seamless upgrade, because the clustering with older Keycloak versions might not work -due to incompatible infinispan versions. - -One way to perform the upgrade is to run: -``` -kubectl delete sts -keycloak && helm upgrade --install -``` -This ensures that all replicas are restarted with the same version. -Note that all sessions are lost in this case, and users might need to login again. - -### From chart < 11.0.0 - -When you are using the postgresql subchart (which is not recommended for production situations), you will need to migrate the statefulset governing the postgresql pod. -The upgrade will cause some immutable fields of the statefulset to be modified, which cannot be done in place. -You will have to manually remove the statefulset before doing the Helm upgrade. -The following procedure takes care of this: - -1. Remove the old statefulset (associated PVC will remain in place): `kubectl delete statefulset -n ` -1. Helm Upgrade: `helm upgrade -n ... ` - -### From chart < 10.0.0 - -* Keycloak is updated to 12.0.4 - -Note that this might not be a seamless upgrade, because the clustering with older Keycloak versions might not work -due to incompatible infinispan versions. - -One way to perform the upgrade is to run: -``` -kubectl delete sts -keycloak && helm upgrade --install -``` -This ensures that all replicas are restarted with the same version. -Note that all sessions are lost in this case, and users might need to login again. - -### From chart versions < 9.0.0 - -The Keycloak chart received a major facelift and, thus, comes with breaking changes. -Opinionated stuff and things that are now baked into Keycloak's Docker image were removed. -Configuration is more generic making it easier to use custom Docker images that are configured differently than the official one. - -* Values are no longer nested under `keycloak`. -* Besides setting the node identifier, no CLI changes are performed out of the box -* Environment variables for the Postresql dependency are set automatically if enabled. - Otherwise, no environment variables are set by default. -* Optionally enables creating RBAC resources with configurable rules (e. g. for KUBE_PING) -* PostgreSQL chart dependency is updated to 9.1.1 - -### From chart versions < 8.0.0 - -* Keycloak is updated to 10.0.0 -* PostgreSQL chart dependency is updated to 8.9.5 - -The upgrade should be seemless. -No special care has to be taken. - -### From chart versions < 7.0.0 - -Version 7.0.0 update breaks backwards-compatibility with the existing `keycloak.persistence.existingSecret` scheme. - -#### Changes in Configuring Database Credentials from an Existing Secret - -Both `DB_USER` and `DB_PASS` are always read from a Kubernetes Secret. -This is a requirement if you are provisioning database credentials dynamically - either via an Operator or some secret-management engine. - -The variable referencing the password key name has been renamed from `keycloak.persistence.existingSecretKey` to `keycloak.persistence.existingSecretPasswordKey` - -A new, optional variable for referencing the username key name for populating the `DB_USER` env has been added: -`keycloak.persistence.existingSecretUsernameKey`. - -If `keycloak.persistence.existingSecret` is left unset, a new Secret will be provisioned populated with the `dbUser` and `dbPassword` Helm variables. - -###### Example configuration: -```yaml -keycloak: - persistence: - existingSecret: keycloak-provisioned-db-credentials - existingSecretPasswordKey: PGPASSWORD - existingSecretUsernameKey: PGUSER - ... -``` -### From chart versions < 6.0.0 - -#### Changes in Probe Configuration - -Now both readiness and liveness probes are configured as strings that are then passed through the `tpl` function. -This allows for greater customizability of the readiness and liveness probes. - -The defaults are unchanged, but since 6.0.0 configured as follows: - -```yaml - livenessProbe: | - httpGet: - path: {{ if ne .Values.keycloak.basepath "" }}/{{ .Values.keycloak.basepath }}{{ end }}/ - port: http - initialDelaySeconds: 300 - timeoutSeconds: 5 - readinessProbe: | - httpGet: - path: {{ if ne .Values.keycloak.basepath "" }}/{{ .Values.keycloak.basepath }}{{ end }}/realms/master - port: http - initialDelaySeconds: 30 - timeoutSeconds: 1 -``` - -startup probe was added in 10.2.0 and is configured as follows: - -```yaml - startupProbe: | - httpGet: - path: /auth/ - port: http - initialDelaySeconds: 30 - timeoutSeconds: 1 - failureThreshold: 60 - periodSeconds: 5 -``` - -#### Changes in Existing Secret Configuration - -This can be useful if you create a secret in a parent chart and want to reference that secret. -Applies to `keycloak.existingSecret` and `keycloak.persistence.existingSecret`. - -_`values.yaml` of parent chart:_ -```yaml -keycloak: - keycloak: - existingSecret: '{{ .Release.Name }}-keycloak-secret' -``` - -#### HTTPS Port Added - -The HTTPS port was added to the pod and to the services. -As a result, service ports are now configured differently. - - -### From chart versions < 5.0.0 - -Version 5.0.0 is a major update. - -* The chart now follows the new Kubernetes label recommendations: -https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ -* Several changes to the StatefulSet render an out-of-the-box upgrade impossible because StatefulSets only allow updates to a limited set of fields -* The chart uses the new support for running scripts at startup that has been added to Keycloak's Docker image. -If you use this feature, you will have to adjust your configuration - -However, with the following manual steps an automatic upgrade is still possible: - -1. Adjust chart configuration as necessary (e. g. startup scripts) -1. Perform a non-cascading deletion of the StatefulSet which keeps the pods running -1. Add the new labels to the pods -1. Run `helm upgrade` - -Use a script like the following to add labels and to delete the StatefulSet: - -```console -#!/bin/sh - -release= -namespace= - -kubectl delete statefulset -n "$namespace" -l app=keycloak -l release="$release" --cascade=false - -kubectl label pod -n "$namespace" -l app=keycloak -l release="$release" app.kubernetes.io/name=keycloak -kubectl label pod -n "$namespace" -l app=keycloak -l release="$release" app.kubernetes.io/instance="$release" -``` - -**NOTE:** Version 5.0.0 also updates the Postgresql dependency which has received a major upgrade as well. -In case you use this dependency, the database must be upgraded first. -Please refer to the Postgresql chart's upgrading section in its README for instructions. diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/.helmignore b/manifests/helm/keycloak/18.4.0/charts/postgresql/.helmignore deleted file mode 100644 index f0c1319..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.lock b/manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.lock deleted file mode 100644 index 830fa8c..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: common - repository: https://charts.bitnami.com/bitnami - version: 1.10.3 -digest: sha256:e8f1d59ae8150ae6099f2d72a9e3ac2fdc0c8fd869b210226edf7c71eef11263 -generated: "2021-12-31T20:02:44.936728424Z" diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.yaml deleted file mode 100644 index 58d34d4..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/Chart.yaml +++ /dev/null @@ -1,28 +0,0 @@ -annotations: - category: Database -apiVersion: v2 -appVersion: 11.14.0 -dependencies: -- name: common - repository: https://charts.bitnami.com/bitnami - version: 1.x.x -description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. -home: https://github.com/bitnami/charts/tree/master/bitnami/postgresql -icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-220x234.png -keywords: -- postgresql -- postgres -- database -- sql -- replication -- cluster -maintainers: -- email: containers@bitnami.com - name: Bitnami -- email: cedric@desaintmartin.fr - name: desaintmartin -name: postgresql -sources: -- https://github.com/bitnami/bitnami-docker-postgresql -- https://www.postgresql.org/ -version: 10.16.2 diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/README.md b/manifests/helm/keycloak/18.4.0/charts/postgresql/README.md deleted file mode 100644 index e14bdc0..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/README.md +++ /dev/null @@ -1,819 +0,0 @@ - - -# PostgreSQL - -[PostgreSQL](https://www.postgresql.org/) is an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. - -## TL;DR - -```console -$ helm repo add bitnami https://charts.bitnami.com/bitnami -$ helm install my-release bitnami/postgresql -``` - -## Introduction - -This chart bootstraps a [PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -For HA, please see [this repo](https://github.com/bitnami/charts/tree/master/bitnami/postgresql-ha) - -Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the [BKPR](https://kubeprod.io/). - -## Prerequisites - -- Kubernetes 1.19+ -- Helm 3.2.0+ -- PV provisioner support in the underlying infrastructure - -## Installing the Chart -To install the chart with the release name `my-release`: - -```console -$ helm install my-release bitnami/postgresql -``` - -The command deploys PostgreSQL on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation. - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```console -$ helm delete my-release -``` - -The command removes all the Kubernetes components but PVC's associated with the chart and deletes the release. - -To delete the PVC's associated with `my-release`: - -```console -$ kubectl delete pvc -l release=my-release -``` - -> **Note**: Deleting the PVC's will delete postgresql data as well. Please be cautious before doing it. - -## Parameters - -### Global parameters - -| Name | Description | Value | -| --------------------------------------- | ------------------------------------------------------------------------------------ | ----- | -| `global.imageRegistry` | Global Docker image registry | `""` | -| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` | -| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` | -| `global.postgresql.postgresqlDatabase` | PostgreSQL database (overrides `postgresqlDatabase`) | `""` | -| `global.postgresql.postgresqlUsername` | PostgreSQL username (overrides `postgresqlUsername`) | `""` | -| `global.postgresql.existingSecret` | Name of existing secret to use for PostgreSQL passwords (overrides `existingSecret`) | `""` | -| `global.postgresql.postgresqlPassword` | PostgreSQL admin password (overrides `postgresqlPassword`) | `""` | -| `global.postgresql.servicePort` | PostgreSQL port (overrides `service.port` | `""` | -| `global.postgresql.replicationPassword` | Replication user password (overrides `replication.password`) | `""` | - - -### Common parameters - -| Name | Description | Value | -| ------------------------ | -------------------------------------------------------------------------------------------- | -------------- | -| `nameOverride` | String to partially override common.names.fullname template (will maintain the release name) | `""` | -| `fullnameOverride` | String to fully override common.names.fullname template | `""` | -| `extraDeploy` | Array of extra objects to deploy with the release (evaluated as a template) | `[]` | -| `commonLabels` | Add labels to all the deployed resources | `{}` | -| `commonAnnotations` | Add annotations to all the deployed resources | `{}` | -| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` | -| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` | -| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` | - - -### PostgreSQL parameters - -| Name | Description | Value | -| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | -| `image.registry` | PostgreSQL image registry | `docker.io` | -| `image.repository` | PostgreSQL image repository | `bitnami/postgresql` | -| `image.tag` | PostgreSQL image tag (immutable tags are recommended) | `11.14.0-debian-10-r28` | -| `image.pullPolicy` | PostgreSQL image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify image pull secrets | `[]` | -| `image.debug` | Specify if debug values should be set | `false` | -| `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` | -| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | -| `volumePermissions.image.repository` | Init container volume-permissions image repository | `bitnami/bitnami-shell` | -| `volumePermissions.image.tag` | Init container volume-permissions image tag (immutable tags are recommended) | `10-debian-10-r305` | -| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` | -| `volumePermissions.image.pullSecrets` | Init container volume-permissions image pull secrets | `[]` | -| `volumePermissions.securityContext.runAsUser` | User ID for the init container | `0` | -| `schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | -| `lifecycleHooks` | for the PostgreSQL container to automate configuration before or after startup | `{}` | -| `securityContext.enabled` | Enable security context | `true` | -| `securityContext.fsGroup` | Group ID for the pod | `1001` | -| `containerSecurityContext.enabled` | Enable container security context | `true` | -| `containerSecurityContext.runAsUser` | User ID for the container | `1001` | -| `serviceAccount.enabled` | Enable service account (Note: Service Account will only be automatically created if `serviceAccount.name` is not set) | `false` | -| `serviceAccount.name` | Name of an already existing service account. Setting this value disables the automatic service account creation | `""` | -| `serviceAccount.autoMount` | Auto-mount the service account token in the pod | `false` | -| `psp.create` | Whether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or later | `false` | -| `rbac.create` | Create Role and RoleBinding (required for PSP to work) | `false` | -| `replication.enabled` | Enable replication | `false` | -| `replication.user` | Replication user | `repl_user` | -| `replication.password` | Replication user password | `repl_password` | -| `replication.readReplicas` | Number of read replicas replicas | `1` | -| `replication.synchronousCommit` | Set synchronous commit mode. Allowed values: `on`, `remote_apply`, `remote_write`, `local` and `off` | `off` | -| `replication.numSynchronousReplicas` | Number of replicas that will have synchronous replication. Note: Cannot be greater than `replication.readReplicas`. | `0` | -| `replication.applicationName` | Cluster application name. Useful for advanced replication settings | `my_application` | -| `replication.singleService` | Create one service connecting to all read-replicas | `true` | -| `replication.uniqueServices` | Create a unique service for each independent read-replica | `false` | -| `postgresqlPostgresPassword` | PostgreSQL admin password (used when `postgresqlUsername` is not `postgres`, in which case`postgres` is the admin username) | `""` | -| `postgresqlUsername` | PostgreSQL user (has superuser privileges if username is `postgres`) | `postgres` | -| `postgresqlPassword` | PostgreSQL user password | `""` | -| `existingSecret` | Name of existing secret to use for PostgreSQL passwords | `""` | -| `usePasswordFile` | Mount PostgreSQL secret as a file instead of passing environment variable | `false` | -| `postgresqlDatabase` | PostgreSQL database | `""` | -| `postgresqlDataDir` | PostgreSQL data dir folder | `/bitnami/postgresql/data` | -| `extraEnv` | An array to add extra environment variables | `[]` | -| `extraEnvVarsCM` | Name of a Config Map containing extra environment variables | `""` | -| `postgresqlInitdbArgs` | PostgreSQL initdb extra arguments | `""` | -| `postgresqlInitdbWalDir` | Specify a custom location for the PostgreSQL transaction log | `""` | -| `postgresqlConfiguration` | PostgreSQL configuration | `{}` | -| `postgresqlExtendedConf` | Extended Runtime Config Parameters (appended to main or default configuration) | `{}` | -| `primaryAsStandBy.enabled` | Whether to enable current cluster's primary as standby server of another cluster or not | `false` | -| `primaryAsStandBy.primaryHost` | The Host of replication primary in the other cluster | `""` | -| `primaryAsStandBy.primaryPort` | The Port of replication primary in the other cluster | `""` | -| `pgHbaConfiguration` | PostgreSQL client authentication configuration | `""` | -| `configurationConfigMap` | ConfigMap with PostgreSQL configuration | `""` | -| `extendedConfConfigMap` | ConfigMap with PostgreSQL extended configuration | `""` | -| `initdbScripts` | Dictionary of initdb scripts | `{}` | -| `initdbScriptsConfigMap` | ConfigMap with scripts to be run at first boot | `""` | -| `initdbScriptsSecret` | Secret with scripts to be run at first boot (in case it contains sensitive information) | `""` | -| `initdbUser` | Specify the PostgreSQL username to execute the initdb scripts | `""` | -| `initdbPassword` | Specify the PostgreSQL password to execute the initdb scripts | `""` | -| `containerPorts.postgresql` | PostgreSQL container port | `5432` | -| `audit.logHostname` | Log client hostnames | `false` | -| `audit.logConnections` | Add client log-in operations to the log file | `false` | -| `audit.logDisconnections` | Add client log-outs operations to the log file | `false` | -| `audit.pgAuditLog` | Add operations to log using the pgAudit extension | `""` | -| `audit.pgAuditLogCatalog` | Log catalog using pgAudit | `off` | -| `audit.clientMinMessages` | Message log level to share with the user | `error` | -| `audit.logLinePrefix` | Template for log line prefix (default if not set) | `""` | -| `audit.logTimezone` | Timezone for the log timestamps | `""` | -| `postgresqlSharedPreloadLibraries` | Shared preload libraries (comma-separated list) | `pgaudit` | -| `postgresqlMaxConnections` | Maximum total connections | `""` | -| `postgresqlPostgresConnectionLimit` | Maximum connections for the postgres user | `""` | -| `postgresqlDbUserConnectionLimit` | Maximum connections for the non-admin user | `""` | -| `postgresqlTcpKeepalivesInterval` | TCP keepalives interval | `""` | -| `postgresqlTcpKeepalivesIdle` | TCP keepalives idle | `""` | -| `postgresqlTcpKeepalivesCount` | TCP keepalives count | `""` | -| `postgresqlStatementTimeout` | Statement timeout | `""` | -| `postgresqlPghbaRemoveFilters` | Comma-separated list of patterns to remove from the pg_hba.conf file | `""` | -| `terminationGracePeriodSeconds` | Seconds the pod needs to terminate gracefully | `""` | -| `ldap.enabled` | Enable LDAP support | `false` | -| `ldap.url` | LDAP URL beginning in the form `ldap[s]://host[:port]/basedn` | `""` | -| `ldap.server` | IP address or name of the LDAP server. | `""` | -| `ldap.port` | Port number on the LDAP server to connect to | `""` | -| `ldap.prefix` | String to prepend to the user name when forming the DN to bind | `""` | -| `ldap.suffix` | String to append to the user name when forming the DN to bind | `""` | -| `ldap.baseDN` | Root DN to begin the search for the user in | `""` | -| `ldap.bindDN` | DN of user to bind to LDAP | `""` | -| `ldap.bind_password` | Password for the user to bind to LDAP | `""` | -| `ldap.search_attr` | Attribute to match against the user name in the search | `""` | -| `ldap.search_filter` | The search filter to use when doing search+bind authentication | `""` | -| `ldap.scheme` | Set to `ldaps` to use LDAPS | `""` | -| `ldap.tls` | Set to `1` to use TLS encryption | `""` | -| `service.type` | Kubernetes Service type | `ClusterIP` | -| `service.clusterIP` | Static clusterIP or None for headless services | `""` | -| `service.port` | PostgreSQL port | `5432` | -| `service.nodePort` | Specify the nodePort value for the LoadBalancer and NodePort service types | `""` | -| `service.annotations` | Annotations for PostgreSQL service | `{}` | -| `service.loadBalancerIP` | Load balancer IP if service type is `LoadBalancer` | `""` | -| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | -| `service.loadBalancerSourceRanges` | Addresses that are allowed when service is LoadBalancer | `[]` | -| `shmVolume.enabled` | Enable emptyDir volume for /dev/shm for primary and read replica(s) Pod(s) | `true` | -| `shmVolume.chmod.enabled` | Set to `true` to `chmod 777 /dev/shm` on a initContainer (ignored if `volumePermissions.enabled` is `false`) | `true` | -| `shmVolume.sizeLimit` | Set this to enable a size limit on the shm tmpfs. Note that the size of the tmpfs counts against container's memory limit | `""` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `""` | -| `persistence.mountPath` | The path the volume will be mounted at, useful when using different | `/bitnami/postgresql` | -| `persistence.subPath` | The subdirectory of the volume to mount to | `""` | -| `persistence.storageClass` | PVC Storage Class for PostgreSQL volume | `""` | -| `persistence.accessModes` | PVC Access Mode for PostgreSQL volume | `["ReadWriteOnce"]` | -| `persistence.snapshotName` | Provide a VolumeSnapshot name which to create the PVC | `""` | -| `persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` | -| `persistence.annotations` | Annotations for the PVC | `{}` | -| `persistence.selector` | Selector to match an existing Persistent Volume (this value is evaluated as a template) | `{}` | -| `updateStrategy.type` | updateStrategy for PostgreSQL StatefulSet and its reads StatefulSets | `RollingUpdate` | -| `primary.podAffinityPreset` | PostgreSQL primary pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `primary.podAntiAffinityPreset` | PostgreSQL primary pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `soft` | -| `primary.nodeAffinityPreset.type` | PostgreSQL primary node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `primary.nodeAffinityPreset.key` | PostgreSQL primary node label key to match Ignored if `primary.affinity` is set. | `""` | -| `primary.nodeAffinityPreset.values` | PostgreSQL primary node label values to match. Ignored if `primary.affinity` is set. | `[]` | -| `primary.affinity` | Affinity for PostgreSQL primary pods assignment | `{}` | -| `primary.nodeSelector` | Node labels for PostgreSQL primary pods assignment | `{}` | -| `primary.tolerations` | Tolerations for PostgreSQL primary pods assignment | `[]` | -| `primary.extraPodSpec` | Optionally specify extra PodSpec | `{}` | -| `primary.labels` | Map of labels to add to the statefulset (postgresql primary) | `{}` | -| `primary.annotations` | Annotations for PostgreSQL primary pods | `{}` | -| `primary.podLabels` | Map of labels to add to the pods (postgresql primary) | `{}` | -| `primary.podAnnotations` | Map of annotations to add to the pods (postgresql primary) | `{}` | -| `primary.priorityClassName` | Priority Class to use for each pod (postgresql primary) | `""` | -| `primary.extraInitContainers` | Extra init containers to add to the pods (postgresql primary) | `[]` | -| `primary.extraVolumeMounts` | Extra volume mounts to add to the pods (postgresql primary) | `[]` | -| `primary.extraVolumes` | Extra volumes to add to the pods (postgresql primary) | `[]` | -| `primary.sidecars` | Extra containers to the pod | `[]` | -| `primary.service.type` | Allows using a different service type for primary | `""` | -| `primary.service.nodePort` | Allows using a different nodePort for primary | `""` | -| `primary.service.clusterIP` | Allows using a different clusterIP for primary | `""` | -| `readReplicas.podAffinityPreset` | PostgreSQL read only pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `readReplicas.podAntiAffinityPreset` | PostgreSQL read only pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `soft` | -| `readReplicas.nodeAffinityPreset.type` | PostgreSQL read only node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `readReplicas.nodeAffinityPreset.key` | PostgreSQL read only node label key to match Ignored if `primary.affinity` is set. | `""` | -| `readReplicas.nodeAffinityPreset.values` | PostgreSQL read only node label values to match. Ignored if `primary.affinity` is set. | `[]` | -| `readReplicas.affinity` | Affinity for PostgreSQL read only pods assignment | `{}` | -| `readReplicas.nodeSelector` | Node labels for PostgreSQL read only pods assignment | `{}` | -| `readReplicas.tolerations` | Tolerations for PostgreSQL read only pods assignment | `[]` | -| `readReplicas.topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `[]` | -| `readReplicas.extraPodSpec` | Optionally specify extra PodSpec | `{}` | -| `readReplicas.labels` | Map of labels to add to the statefulsets (postgresql readReplicas) | `{}` | -| `readReplicas.annotations` | Annotations for PostgreSQL read only pods | `{}` | -| `readReplicas.podLabels` | Map of labels to add to the pods (postgresql readReplicas) | `{}` | -| `readReplicas.podAnnotations` | Map of annotations to add to the pods (postgresql readReplicas) | `{}` | -| `readReplicas.priorityClassName` | Priority Class to use for each pod (postgresql readReplicas) | `""` | -| `readReplicas.extraInitContainers` | Extra init containers to add to the pods (postgresql readReplicas) | `[]` | -| `readReplicas.extraVolumeMounts` | Extra volume mounts to add to the pods (postgresql readReplicas) | `[]` | -| `readReplicas.extraVolumes` | Extra volumes to add to the pods (postgresql readReplicas) | `[]` | -| `readReplicas.sidecars` | Extra containers to the pod | `[]` | -| `readReplicas.service.type` | Allows using a different service type for readReplicas | `""` | -| `readReplicas.service.nodePort` | Allows using a different nodePort for readReplicas | `""` | -| `readReplicas.service.clusterIP` | Allows using a different clusterIP for readReplicas | `""` | -| `readReplicas.persistence.enabled` | Whether to enable PostgreSQL read replicas replicas persistence | `true` | -| `readReplicas.resources` | CPU/Memory resource requests/limits override for readReplicass. Will fallback to `values.resources` if not defined. | `{}` | -| `resources.requests` | The requested resources for the container | `{}` | -| `networkPolicy.enabled` | Enable creation of NetworkPolicy resources. Only Ingress traffic is filtered for now. | `false` | -| `networkPolicy.allowExternal` | Don't require client label for connections | `true` | -| `networkPolicy.explicitNamespacesSelector` | A Kubernetes LabelSelector to explicitly select namespaces from which ingress traffic could be allowed | `{}` | -| `startupProbe.enabled` | Enable startupProbe | `false` | -| `startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `30` | -| `startupProbe.periodSeconds` | Period seconds for startupProbe | `15` | -| `startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` | -| `startupProbe.failureThreshold` | Failure threshold for startupProbe | `10` | -| `startupProbe.successThreshold` | Success threshold for startupProbe | `1` | -| `livenessProbe.enabled` | Enable livenessProbe | `true` | -| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `30` | -| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` | -| `livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | -| `livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `6` | -| `livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | -| `readinessProbe.enabled` | Enable readinessProbe | `true` | -| `readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` | -| `readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | -| `readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `5` | -| `readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` | -| `readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | -| `customStartupProbe` | Override default startup probe | `{}` | -| `customLivenessProbe` | Override default liveness probe | `{}` | -| `customReadinessProbe` | Override default readiness probe | `{}` | -| `tls.enabled` | Enable TLS traffic support | `false` | -| `tls.autoGenerated` | Generate automatically self-signed TLS certificates | `false` | -| `tls.preferServerCiphers` | Whether to use the server's TLS cipher preferences rather than the client's | `true` | -| `tls.certificatesSecret` | Name of an existing secret that contains the certificates | `""` | -| `tls.certFilename` | Certificate filename | `""` | -| `tls.certKeyFilename` | Certificate key filename | `""` | -| `tls.certCAFilename` | CA Certificate filename | `""` | -| `tls.crlFilename` | File containing a Certificate Revocation List | `""` | -| `metrics.enabled` | Start a prometheus exporter | `false` | -| `metrics.resources` | Prometheus exporter container resources | `{}` | -| `metrics.service.type` | Kubernetes Service type | `ClusterIP` | -| `metrics.service.annotations` | Additional annotations for metrics exporter pod | `{}` | -| `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `""` | -| `metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | -| `metrics.serviceMonitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | -| `metrics.serviceMonitor.namespace` | Optional namespace in which to create ServiceMonitor | `""` | -| `metrics.serviceMonitor.interval` | Scrape interval. If not set, the Prometheus default scrape interval is used | `""` | -| `metrics.serviceMonitor.scrapeTimeout` | Scrape timeout. If not set, the Prometheus default scrape timeout is used | `""` | -| `metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping | `[]` | -| `metrics.serviceMonitor.metricRelabelings` | MetricRelabelConfigs to apply to samples before ingestion | `[]` | -| `metrics.prometheusRule.enabled` | Set this to true to create prometheusRules for Prometheus operator | `false` | -| `metrics.prometheusRule.additionalLabels` | Additional labels that can be used so prometheusRules will be discovered by Prometheus | `{}` | -| `metrics.prometheusRule.namespace` | namespace where prometheusRules resource should be created | `""` | -| `metrics.prometheusRule.rules` | Create specified [Rules](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) | `[]` | -| `metrics.image.registry` | PostgreSQL Exporter image registry | `docker.io` | -| `metrics.image.repository` | PostgreSQL Exporter image repository | `bitnami/postgres-exporter` | -| `metrics.image.tag` | PostgreSQL Exporter image tag (immutable tags are recommended) | `0.10.0-debian-10-r172` | -| `metrics.image.pullPolicy` | PostgreSQL Exporter image pull policy | `IfNotPresent` | -| `metrics.image.pullSecrets` | Specify image pull secrets | `[]` | -| `metrics.customMetrics` | Define additional custom metrics | `{}` | -| `metrics.extraEnvVars` | Extra environment variables to add to postgres-exporter | `[]` | -| `metrics.securityContext.enabled` | Enable security context for metrics | `false` | -| `metrics.securityContext.runAsUser` | User ID for the container for metrics | `1001` | -| `metrics.livenessProbe.enabled` | Enable livenessProbe | `true` | -| `metrics.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `5` | -| `metrics.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` | -| `metrics.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | -| `metrics.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `6` | -| `metrics.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | -| `metrics.readinessProbe.enabled` | Enable readinessProbe | `true` | -| `metrics.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` | -| `metrics.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | -| `metrics.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `5` | -| `metrics.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` | -| `metrics.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | - - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```console -$ helm install my-release \ - --set postgresqlPassword=secretpassword,postgresqlDatabase=my-database \ - bitnami/postgresql -``` - -The above command sets the PostgreSQL `postgres` account password to `secretpassword`. Additionally it creates a database named `my-database`. - -> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available. - -Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, - -```console -$ helm install my-release -f values.yaml bitnami/postgresql -``` - -> **Tip**: You can use the default [values.yaml](values.yaml) - -## Configuration and installation details - -### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/) - -It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image. - -Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist. - -### Customizing primary and read replica services in a replicated configuration - -At the top level, there is a service object which defines the services for both primary and readReplicas. For deeper customization, there are service objects for both the primary and read types individually. This allows you to override the values in the top level service object so that the primary and read can be of different service types and with different clusterIPs / nodePorts. Also in the case you want the primary and read to be of type nodePort, you will need to set the nodePorts to different values to prevent a collision. The values that are deeper in the primary.service or readReplicas.service objects will take precedence over the top level service object. - -### Use a different PostgreSQL version - -To modify the application version used in this chart, specify a different version of the image using the `image.tag` parameter and/or a different repository using the `image.repository` parameter. Refer to the [chart documentation for more information on these parameters and how to use them with images from a private registry](https://docs.bitnami.com/kubernetes/infrastructure/postgresql/configuration/change-image-version/). - -### postgresql.conf / pg_hba.conf files as configMap - -This helm chart also supports to customize the whole configuration file. - -Add your custom file to "files/postgresql.conf" in your working directory. This file will be mounted as configMap to the containers and it will be used for configuring the PostgreSQL server. - -Alternatively, you can add additional PostgreSQL configuration parameters using the `postgresqlExtendedConf` parameter as a dict, using camelCase, e.g. {"sharedBuffers": "500MB"}. Alternatively, to replace the entire default configuration use `postgresqlConfiguration`. - -In addition to these options, you can also set an external ConfigMap with all the configuration files. This is done by setting the `configurationConfigMap` parameter. Note that this will override the two previous options. - -### Allow settings to be loaded from files other than the default `postgresql.conf` - -If you don't want to provide the whole PostgreSQL configuration file and only specify certain parameters, you can add your extended `.conf` files to "files/conf.d/" in your working directory. -Those files will be mounted as configMap to the containers adding/overwriting the default configuration using the `include_dir` directive that allows settings to be loaded from files other than the default `postgresql.conf`. - -Alternatively, you can also set an external ConfigMap with all the extra configuration files. This is done by setting the `extendedConfConfigMap` parameter. Note that this will override the previous option. - -### Initialize a fresh instance - -The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder `files/docker-entrypoint-initdb.d` so they can be consumed as a ConfigMap. - -Alternatively, you can specify custom scripts using the `initdbScripts` parameter as dict. - -In addition to these options, you can also set an external ConfigMap with all the initialization scripts. This is done by setting the `initdbScriptsConfigMap` parameter. Note that this will override the two previous options. If your initialization scripts contain sensitive information such as credentials or passwords, you can use the `initdbScriptsSecret` parameter. - -The allowed extensions are `.sh`, `.sql` and `.sql.gz`. - -### Securing traffic using TLS - -TLS support can be enabled in the chart by specifying the `tls.` parameters while creating a release. The following parameters should be configured to properly enable the TLS support in the chart: - -- `tls.enabled`: Enable TLS support. Defaults to `false` -- `tls.certificatesSecret`: Name of an existing secret that contains the certificates. No defaults. -- `tls.certFilename`: Certificate filename. No defaults. -- `tls.certKeyFilename`: Certificate key filename. No defaults. - -For example: - -* First, create the secret with the cetificates files: - - ```console - kubectl create secret generic certificates-tls-secret --from-file=./cert.crt --from-file=./cert.key --from-file=./ca.crt - ``` - -* Then, use the following parameters: - - ```console - volumePermissions.enabled=true - tls.enabled=true - tls.certificatesSecret="certificates-tls-secret" - tls.certFilename="cert.crt" - tls.certKeyFilename="cert.key" - ``` - - > Note TLS and VolumePermissions: PostgreSQL requires certain permissions on sensitive files (such as certificate keys) to start up. Due to an on-going [issue](https://github.com/kubernetes/kubernetes/issues/57923) regarding kubernetes permissions and the use of `containerSecurityContext.runAsUser`, you must enable `volumePermissions` to ensure everything works as expected. - -### Sidecars - -If you need additional containers to run within the same pod as PostgreSQL (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec. - -```yaml -# For the PostgreSQL primary -primary: - sidecars: - - name: your-image-name - image: your-image - imagePullPolicy: Always - ports: - - name: portname - containerPort: 1234 -# For the PostgreSQL replicas -readReplicas: - sidecars: - - name: your-image-name - image: your-image - imagePullPolicy: Always - ports: - - name: portname - containerPort: 1234 -``` - -### Metrics - -The chart optionally can start a metrics exporter for [prometheus](https://prometheus.io). The metrics endpoint (port 9187) is not exposed and it is expected that the metrics are collected from inside the k8s cluster using something similar as the described in the [example Prometheus scrape configuration](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml). - -The exporter allows to create custom metrics from additional SQL queries. See the Chart's `values.yaml` for an example and consult the [exporters documentation](https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file) for more details. - -### Use of global variables - -In more complex scenarios, we may have the following tree of dependencies - -``` - +--------------+ - | | - +------------+ Chart 1 +-----------+ - | | | | - | --------+------+ | - | | | - | | | - | | | - | | | - v v v -+-------+------+ +--------+------+ +--------+------+ -| | | | | | -| PostgreSQL | | Sub-chart 1 | | Sub-chart 2 | -| | | | | | -+--------------+ +---------------+ +---------------+ -``` - -The three charts below depend on the parent chart Chart 1. However, subcharts 1 and 2 may need to connect to PostgreSQL as well. In order to do so, subcharts 1 and 2 need to know the PostgreSQL credentials, so one option for deploying could be deploy Chart 1 with the following parameters: - -``` -postgresql.postgresqlPassword=testtest -subchart1.postgresql.postgresqlPassword=testtest -subchart2.postgresql.postgresqlPassword=testtest -postgresql.postgresqlDatabase=db1 -subchart1.postgresql.postgresqlDatabase=db1 -subchart2.postgresql.postgresqlDatabase=db1 -``` - -If the number of dependent sub-charts increases, installing the chart with parameters can become increasingly difficult. An alternative would be to set the credentials using global variables as follows: - -``` -global.postgresql.postgresqlPassword=testtest -global.postgresql.postgresqlDatabase=db1 -``` - -This way, the credentials will be available in all of the subcharts. - -## Persistence - -The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) image stores the PostgreSQL data and configurations at the `/bitnami/postgresql` path of the container. - -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. -See the [Parameters](#parameters) section to configure the PVC or to disable persistence. - -If you already have data in it, you will fail to sync to standby nodes for all commits, details can refer to [code](https://github.com/bitnami/bitnami-docker-postgresql/blob/8725fe1d7d30ebe8d9a16e9175d05f7ad9260c93/9.6/debian-9/rootfs/libpostgresql.sh#L518-L556). If you need to use those data, please covert them to sql and import after `helm install` finished. - -## NetworkPolicy - -To enable network policy for PostgreSQL, install [a networking plugin that implements the Kubernetes NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin), and set `networkPolicy.enabled` to `true`. - -For Kubernetes v1.5 & v1.6, you must also turn on NetworkPolicy by setting the DefaultDeny namespace annotation. Note: this will enforce policy for _all_ pods in the namespace: - -```console -$ kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}" -``` - -With NetworkPolicy enabled, traffic will be limited to just port 5432. - -For more precise policy, set `networkPolicy.allowExternal=false`. This will only allow pods with the generated client label to connect to PostgreSQL. -This label will be displayed in the output of a successful install. - -## Differences between Bitnami PostgreSQL image and [Docker Official](https://hub.docker.com/_/postgres) image - -- The Docker Official PostgreSQL image does not support replication. If you pass any replication environment variable, this would be ignored. The only environment variables supported by the Docker Official image are POSTGRES_USER, POSTGRES_DB, POSTGRES_PASSWORD, POSTGRES_INITDB_ARGS, POSTGRES_INITDB_WALDIR and PGDATA. All the remaining environment variables are specific to the Bitnami PostgreSQL image. -- The Bitnami PostgreSQL image is non-root by default. This requires that you run the pod with `securityContext` and updates the permissions of the volume with an `initContainer`. A key benefit of this configuration is that the pod follows security best practices and is prepared to run on Kubernetes distributions with hard security constraints like OpenShift. -- For OpenShift, one may either define the runAsUser and fsGroup accordingly, or try this more dynamic option: volumePermissions.securityContext.runAsUser="auto",securityContext.enabled=false,containerSecurityContext.enabled=false,shmVolume.chmod.enabled=false - -### Deploy chart using Docker Official PostgreSQL Image - -From chart version 4.0.0, it is possible to use this chart with the Docker Official PostgreSQL image. -Besides specifying the new Docker repository and tag, it is important to modify the PostgreSQL data directory and volume mount point. Basically, the PostgreSQL data dir cannot be the mount point directly, it has to be a subdirectory. - -``` -image.repository=postgres -image.tag=10.6 -postgresqlDataDir=/data/pgdata -persistence.mountPath=/data/ -``` - -### Setting Pod's affinity - -This chart allows you to set your custom affinity using the `XXX.affinity` paremeter(s). Find more infomation about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). - -As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `XXX.podAffinityPreset`, `XXX.podAntiAffinityPreset`, or `XXX.nodeAffinityPreset` parameters. - -## Troubleshooting - -Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues). - -## Upgrading - -It's necessary to specify the existing passwords while performing an upgrade to ensure the secrets are not updated with invalid randomly generated passwords. Remember to specify the existing values of the `postgresqlPassword` and `replication.password` parameters when upgrading the chart: - -```bash -$ helm upgrade my-release bitnami/postgresql \ - --set postgresqlPassword=[POSTGRESQL_PASSWORD] \ - --set replication.password=[REPLICATION_PASSWORD] -``` - -> Note: you need to substitute the placeholders _[POSTGRESQL_PASSWORD]_, and _[REPLICATION_PASSWORD]_ with the values obtained from instructions in the installation notes. - -### To 10.0.0 - -[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL. - -**What changes were introduced in this major version?** - -- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field. -- Move dependency information from the *requirements.yaml* to the *Chart.yaml* -- After running `helm dependency update`, a *Chart.lock* file is generated containing the same structure used in the previous *requirements.lock* -- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Chart. - -**Considerations when upgrading to this version** - -- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore -- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3 - -**Useful links** - -- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/ -- https://helm.sh/docs/topics/v2_v3_migration/ -- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/ - -#### Breaking changes - -- The term `master` has been replaced with `primary` and `slave` with `readReplicas` throughout the chart. Role names have changed from `master` and `slave` to `primary` and `read`. - -To upgrade to `10.0.0`, it should be done reusing the PVCs used to hold the PostgreSQL data on your previous release. To do so, follow the instructions below (the following example assumes that the release name is `postgresql`): - -> NOTE: Please, create a backup of your database before running any of those actions. - -Obtain the credentials and the names of the PVCs used to hold the PostgreSQL data on your current release: - -```console -$ export POSTGRESQL_PASSWORD=$(kubectl get secret --namespace default postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode) -$ export POSTGRESQL_PVC=$(kubectl get pvc -l app.kubernetes.io/instance=postgresql,role=master -o jsonpath="{.items[0].metadata.name}") -``` - -Delete the PostgreSQL statefulset. Notice the option `--cascade=false`: - -```console -$ kubectl delete statefulsets.apps postgresql-postgresql --cascade=false -``` - -Now the upgrade works: - -```console -$ helm upgrade postgresql bitnami/postgresql --set postgresqlPassword=$POSTGRESQL_PASSWORD --set persistence.existingClaim=$POSTGRESQL_PVC -``` - -You will have to delete the existing PostgreSQL pod and the new statefulset is going to create a new one - -```console -$ kubectl delete pod postgresql-postgresql-0 -``` - -Finally, you should see the lines below in PostgreSQL container logs: - -```console -$ kubectl logs $(kubectl get pods -l app.kubernetes.io/instance=postgresql,app.kubernetes.io/name=postgresql,role=primary -o jsonpath="{.items[0].metadata.name}") -... -postgresql 08:05:12.59 INFO ==> Deploying PostgreSQL with persisted data... -... -``` - -### To 9.0.0 - -In this version the chart was adapted to follow the Helm label best practices, see [PR 3021](https://github.com/bitnami/charts/pull/3021). That means the backward compatibility is not guarantee when upgrading the chart to this major version. - -As a workaround, you can delete the existing statefulset (using the `--cascade=false` flag pods are not deleted) before upgrade the chart. For example, this can be a valid workflow: - -- Deploy an old version (8.X.X) - -```console -$ helm install postgresql bitnami/postgresql --version 8.10.14 -``` - -- Old version is up and running - -```console -$ helm ls -NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -postgresql default 1 2020-08-04 13:39:54.783480286 +0000 UTC deployed postgresql-8.10.14 11.8.0 - -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -postgresql-postgresql-0 1/1 Running 0 76s -``` - -- The upgrade to the latest one (9.X.X) is going to fail - -```console -$ helm upgrade postgresql bitnami/postgresql -Error: UPGRADE FAILED: cannot patch "postgresql-postgresql" with kind StatefulSet: StatefulSet.apps "postgresql-postgresql" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden -``` - -- Delete the statefulset - -```console -$ kubectl delete statefulsets.apps --cascade=false postgresql-postgresql -statefulset.apps "postgresql-postgresql" deleted -``` - -- Now the upgrade works - -```console -$ helm upgrade postgresql bitnami/postgresql -$ helm ls -NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION -postgresql default 3 2020-08-04 13:42:08.020385884 +0000 UTC deployed postgresql-9.1.2 11.8.0 -``` - -- We can kill the existing pod and the new statefulset is going to create a new one: - -```console -$ kubectl delete pod postgresql-postgresql-0 -pod "postgresql-postgresql-0" deleted - -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -postgresql-postgresql-0 1/1 Running 0 19s -``` - -Please, note that without the `--cascade=false` both objects (statefulset and pod) are going to be removed and both objects will be deployed again with the `helm upgrade` command - -### To 8.0.0 - -Prefixes the port names with their protocols to comply with Istio conventions. - -If you depend on the port names in your setup, make sure to update them to reflect this change. - -### To 7.1.0 - -Adds support for LDAP configuration. - -### To 7.0.0 - -Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec. - -In https://github.com/helm/charts/pull/17281 the `apiVersion` of the statefulset resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage. - -This major version bump signifies this change. - -### To 6.5.7 - -In this version, the chart will use PostgreSQL with the Postgis extension included. The version used with Postgresql version 10, 11 and 12 is Postgis 2.5. It has been compiled with the following dependencies: - -- protobuf -- protobuf-c -- json-c -- geos -- proj - -### To 5.0.0 - -In this version, the **chart is using PostgreSQL 11 instead of PostgreSQL 10**. You can find the main difference and notable changes in the following links: [https://www.postgresql.org/about/news/1894/](https://www.postgresql.org/about/news/1894/) and [https://www.postgresql.org/about/featurematrix/](https://www.postgresql.org/about/featurematrix/). - -For major releases of PostgreSQL, the internal data storage format is subject to change, thus complicating upgrades, you can see some errors like the following one in the logs: - -```console -Welcome to the Bitnami postgresql container -Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql -Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues -Send us your feedback at containers@bitnami.com - -INFO ==> ** Starting PostgreSQL setup ** -NFO ==> Validating settings in POSTGRESQL_* env vars.. -INFO ==> Initializing PostgreSQL database... -INFO ==> postgresql.conf file not detected. Generating it... -INFO ==> pg_hba.conf file not detected. Generating it... -INFO ==> Deploying PostgreSQL with persisted data... -INFO ==> Configuring replication parameters -INFO ==> Loading custom scripts... -INFO ==> Enabling remote connections -INFO ==> Stopping PostgreSQL... -INFO ==> ** PostgreSQL setup finished! ** - -INFO ==> ** Starting PostgreSQL ** - [1] FATAL: database files are incompatible with server - [1] DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.3. -``` - -In this case, you should migrate the data from the old chart to the new one following an approach similar to that described in [this section](https://www.postgresql.org/docs/current/upgrading.html#UPGRADING-VIA-PGDUMPALL) from the official documentation. Basically, create a database dump in the old chart, move and restore it in the new one. - -### To 4.0.0 - -This chart will use by default the Bitnami PostgreSQL container starting from version `10.7.0-r68`. This version moves the initialization logic from node.js to bash. This new version of the chart requires setting the `POSTGRES_PASSWORD` in the slaves as well, in order to properly configure the `pg_hba.conf` file. Users from previous versions of the chart are advised to upgrade immediately. - -IMPORTANT: If you do not want to upgrade the chart version then make sure you use the `10.7.0-r68` version of the container. Otherwise, you will get this error - -``` -The POSTGRESQL_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development -``` - -### To 3.0.0 - -This releases make it possible to specify different nodeSelector, affinity and tolerations for master and slave pods. -It also fixes an issue with `postgresql.master.fullname` helper template not obeying fullnameOverride. - -#### Breaking changes - -- `affinty` has been renamed to `master.affinity` and `slave.affinity`. -- `tolerations` has been renamed to `master.tolerations` and `slave.tolerations`. -- `nodeSelector` has been renamed to `master.nodeSelector` and `slave.nodeSelector`. - -### To 2.0.0 - -In order to upgrade from the `0.X.X` branch to `1.X.X`, you should follow the below steps: - -- Obtain the service name (`SERVICE_NAME`) and password (`OLD_PASSWORD`) of the existing postgresql chart. You can find the instructions to obtain the password in the NOTES.txt, the service name can be obtained by running - -```console -$ kubectl get svc -``` - -- Install (not upgrade) the new version - -```console -$ helm repo update -$ helm install my-release bitnami/postgresql -``` - -- Connect to the new pod (you can obtain the name by running `kubectl get pods`): - -```console -$ kubectl exec -it NAME bash -``` - -- Once logged in, create a dump file from the previous database using `pg_dump`, for that we should connect to the previous postgresql chart: - -```console -$ pg_dump -h SERVICE_NAME -U postgres DATABASE_NAME > /tmp/backup.sql -``` - -After run above command you should be prompted for a password, this password is the previous chart password (`OLD_PASSWORD`). -This operation could take some time depending on the database size. - -- Once you have the backup file, you can restore it with a command like the one below: - -```console -$ psql -U postgres DATABASE_NAME < /tmp/backup.sql -``` - -In this case, you are accessing to the local postgresql, so the password should be the new one (you can find it in NOTES.txt). - -If you want to restore the database and the database schema does not exist, it is necessary to first follow the steps described below. - -```console -$ psql -U postgres -postgres=# drop database DATABASE_NAME; -postgres=# create database DATABASE_NAME; -postgres=# create user USER_NAME; -postgres=# alter role USER_NAME with password 'BITNAMI_USER_PASSWORD'; -postgres=# grant all privileges on database DATABASE_NAME to USER_NAME; -postgres=# alter database DATABASE_NAME owner to USER_NAME; -``` - -## License - -Copyright © 2022 Bitnami - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/Chart.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/Chart.yaml deleted file mode 100644 index 5db0444..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/Chart.yaml +++ /dev/null @@ -1,22 +0,0 @@ -annotations: - category: Infrastructure -apiVersion: v2 -appVersion: 1.10.0 -description: A Library Helm Chart for grouping common logic between bitnami charts. This chart is not deployable by itself. -home: https://github.com/bitnami/charts/tree/master/bitnami/common -icon: https://bitnami.com/downloads/logos/bitnami-mark.png -keywords: -- common -- helper -- template -- function -- bitnami -maintainers: -- email: containers@bitnami.com - name: Bitnami -name: common -sources: -- https://github.com/bitnami/charts -- https://www.bitnami.com/ -type: library -version: 1.10.3 diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/README.md b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/README.md deleted file mode 100644 index cbbc31d..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/README.md +++ /dev/null @@ -1,328 +0,0 @@ -# Bitnami Common Library Chart - -A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between bitnami charts. - -## TL;DR - -```yaml -dependencies: - - name: common - version: 0.x.x - repository: https://charts.bitnami.com/bitnami -``` - -```bash -$ helm dependency update -``` - -```yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.names.fullname" . }} -data: - myvalue: "Hello World" -``` - -## Introduction - -This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager. - -Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications. - -## Prerequisites - -- Kubernetes 1.12+ -- Helm 3.1.0 - -## Parameters - -The following table lists the helpers available in the library which are scoped in different sections. - -### Affinities - -| Helper identifier | Description | Expected Input | -|-------------------------------|------------------------------------------------------|------------------------------------------------| -| `common.affinities.node.soft` | Return a soft nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` | -| `common.affinities.node.hard` | Return a hard nodeAffinity definition | `dict "key" "FOO" "values" (list "BAR" "BAZ")` | -| `common.affinities.pod.soft` | Return a soft podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` | -| `common.affinities.pod.hard` | Return a hard podAffinity/podAntiAffinity definition | `dict "component" "FOO" "context" $` | - -### Capabilities - -| Helper identifier | Description | Expected Input | -|------------------------------------------------|------------------------------------------------------------------------------------------------|-------------------| -| `common.capabilities.kubeVersion` | Return the target Kubernetes version (using client default if .Values.kubeVersion is not set). | `.` Chart context | -| `common.capabilities.cronjob.apiVersion` | Return the appropriate apiVersion for cronjob. | `.` Chart context | -| `common.capabilities.deployment.apiVersion` | Return the appropriate apiVersion for deployment. | `.` Chart context | -| `common.capabilities.statefulset.apiVersion` | Return the appropriate apiVersion for statefulset. | `.` Chart context | -| `common.capabilities.ingress.apiVersion` | Return the appropriate apiVersion for ingress. | `.` Chart context | -| `common.capabilities.rbac.apiVersion` | Return the appropriate apiVersion for RBAC resources. | `.` Chart context | -| `common.capabilities.crd.apiVersion` | Return the appropriate apiVersion for CRDs. | `.` Chart context | -| `common.capabilities.policy.apiVersion` | Return the appropriate apiVersion for podsecuritypolicy. | `.` Chart context | -| `common.capabilities.networkPolicy.apiVersion` | Return the appropriate apiVersion for networkpolicy. | `.` Chart context | -| `common.capabilities.supportsHelmVersion` | Returns true if the used Helm version is 3.3+ | `.` Chart context | - -### Errors - -| Helper identifier | Description | Expected Input | -|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------| -| `common.errors.upgrade.passwords.empty` | It will ensure required passwords are given when we are upgrading a chart. If `validationErrors` is not empty it will throw an error and will stop the upgrade action. | `dict "validationErrors" (list $validationError00 $validationError01) "context" $` | - -### Images - -| Helper identifier | Description | Expected Input | -|-----------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------| -| `common.images.image` | Return the proper and full image name | `dict "imageRoot" .Values.path.to.the.image "global" $`, see [ImageRoot](#imageroot) for the structure. | -| `common.images.pullSecrets` | Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global` | -| `common.images.renderPullSecrets` | Return the proper Docker Image Registry Secret Names (evaluates values as templates) | `dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $` | - -### Ingress - -| Helper identifier | Description | Expected Input | -|-------------------------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `common.ingress.backend` | Generate a proper Ingress backend entry depending on the API version | `dict "serviceName" "foo" "servicePort" "bar"`, see the [Ingress deprecation notice](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/) for the syntax differences | -| `common.ingress.supportsPathType` | Prints "true" if the pathType field is supported | `.` Chart context | -| `common.ingress.supportsIngressClassname` | Prints "true" if the ingressClassname field is supported | `.` Chart context | - -### Labels - -| Helper identifier | Description | Expected Input | -|-----------------------------|------------------------------------------------------|-------------------| -| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context | -| `common.labels.matchLabels` | Return the proper Docker Image Registry Secret Names | `.` Chart context | - -### Names - -| Helper identifier | Description | Expected Input | -|-------------------------|------------------------------------------------------------|-------------------| -| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context | -| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context | -| `common.names.chart` | Chart name plus version | `.` Chart context | - -### Secrets - -| Helper identifier | Description | Expected Input | -|---------------------------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `common.secrets.name` | Generate the name of the secret. | `dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $` see [ExistingSecret](#existingsecret) for the structure. | -| `common.secrets.key` | Generate secret key. | `dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName"` see [ExistingSecret](#existingsecret) for the structure. | -| `common.passwords.manage` | Generate secret password or retrieve one if already created. | `dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $`, length, strong and chartNAme fields are optional. | -| `common.secrets.exists` | Returns whether a previous generated secret already exists. | `dict "secret" "secret-name" "context" $` | - -### Storage - -| Helper identifier | Description | Expected Input | -|-------------------------------|---------------------------------------|---------------------------------------------------------------------------------------------------------------------| -| `common.storage.class` | Return the proper Storage Class | `dict "persistence" .Values.path.to.the.persistence "global" $`, see [Persistence](#persistence) for the structure. | - -### TplValues - -| Helper identifier | Description | Expected Input | -|---------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------| -| `common.tplvalues.render` | Renders a value that contains template | `dict "value" .Values.path.to.the.Value "context" $`, value is the value should rendered as template, context frequently is the chart context `$` or `.` | - -### Utils - -| Helper identifier | Description | Expected Input | -|--------------------------------|------------------------------------------------------------------------------------------|------------------------------------------------------------------------| -| `common.utils.fieldToEnvVar` | Build environment variable name given a field. | `dict "field" "my-password"` | -| `common.utils.secret.getvalue` | Print instructions to get a secret value. | `dict "secret" "secret-name" "field" "secret-value-field" "context" $` | -| `common.utils.getValueFromKey` | Gets a value from `.Values` object given its key path | `dict "key" "path.to.key" "context" $` | -| `common.utils.getKeyFromList` | Returns first `.Values` key with a defined value or first of the list if all non-defined | `dict "keys" (list "path.to.key1" "path.to.key2") "context" $` | - -### Validations - -| Helper identifier | Description | Expected Input | -|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `common.validations.values.single.empty` | Validate a value must not be empty. | `dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $` secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See [ValidateValue](#validatevalue) | -| `common.validations.values.multiple.empty` | Validate a multiple values must not be empty. It returns a shared error for all the values. | `dict "required" (list $validateValueConf00 $validateValueConf01) "context" $`. See [ValidateValue](#validatevalue) | -| `common.validations.values.mariadb.passwords` | This helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values. | `dict "secret" "mariadb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper. | -| `common.validations.values.postgresql.passwords` | This helper will ensure required password for PostgreSQL are not empty. It returns a shared error for all the values. | `dict "secret" "postgresql-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use postgresql chart and the helper. | -| `common.validations.values.redis.passwords` | This helper will ensure required password for Redis™ are not empty. It returns a shared error for all the values. | `dict "secret" "redis-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use redis chart and the helper. | -| `common.validations.values.cassandra.passwords` | This helper will ensure required password for Cassandra are not empty. It returns a shared error for all the values. | `dict "secret" "cassandra-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use cassandra chart and the helper. | -| `common.validations.values.mongodb.passwords` | This helper will ensure required password for MongoDB® are not empty. It returns a shared error for all the values. | `dict "secret" "mongodb-secret" "subchart" "true" "context" $` subchart field is optional and could be true or false it depends on where you will use mongodb chart and the helper. | - -### Warnings - -| Helper identifier | Description | Expected Input | -|------------------------------|----------------------------------|------------------------------------------------------------| -| `common.warnings.rollingTag` | Warning about using rolling tag. | `ImageRoot` see [ImageRoot](#imageroot) for the structure. | - -## Special input schemas - -### ImageRoot - -```yaml -registry: - type: string - description: Docker registry where the image is located - example: docker.io - -repository: - type: string - description: Repository and image name - example: bitnami/nginx - -tag: - type: string - description: image tag - example: 1.16.1-debian-10-r63 - -pullPolicy: - type: string - description: Specify a imagePullPolicy. Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - -pullSecrets: - type: array - items: - type: string - description: Optionally specify an array of imagePullSecrets (evaluated as templates). - -debug: - type: boolean - description: Set to true if you would like to see extra information on logs - example: false - -## An instance would be: -# registry: docker.io -# repository: bitnami/nginx -# tag: 1.16.1-debian-10-r63 -# pullPolicy: IfNotPresent -# debug: false -``` - -### Persistence - -```yaml -enabled: - type: boolean - description: Whether enable persistence. - example: true - -storageClass: - type: string - description: Ghost data Persistent Volume Storage Class, If set to "-", storageClassName: "" which disables dynamic provisioning. - example: "-" - -accessMode: - type: string - description: Access mode for the Persistent Volume Storage. - example: ReadWriteOnce - -size: - type: string - description: Size the Persistent Volume Storage. - example: 8Gi - -path: - type: string - description: Path to be persisted. - example: /bitnami - -## An instance would be: -# enabled: true -# storageClass: "-" -# accessMode: ReadWriteOnce -# size: 8Gi -# path: /bitnami -``` - -### ExistingSecret - -```yaml -name: - type: string - description: Name of the existing secret. - example: mySecret -keyMapping: - description: Mapping between the expected key name and the name of the key in the existing secret. - type: object - -## An instance would be: -# name: mySecret -# keyMapping: -# password: myPasswordKey -``` - -#### Example of use - -When we store sensitive data for a deployment in a secret, some times we want to give to users the possibility of using theirs existing secrets. - -```yaml -# templates/secret.yaml ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "common.names.fullname" . }} - labels: - app: {{ include "common.names.fullname" . }} -type: Opaque -data: - password: {{ .Values.password | b64enc | quote }} - -# templates/dpl.yaml ---- -... - env: - - name: PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }} - key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "password") }} -... - -# values.yaml ---- -name: mySecret -keyMapping: - password: myPasswordKey -``` - -### ValidateValue - -#### NOTES.txt - -```console -{{- $validateValueConf00 := (dict "valueKey" "path.to.value00" "secret" "secretName" "field" "password-00") -}} -{{- $validateValueConf01 := (dict "valueKey" "path.to.value01" "secret" "secretName" "field" "password-01") -}} - -{{ include "common.validations.values.multiple.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }} -``` - -If we force those values to be empty we will see some alerts - -```console -$ helm install test mychart --set path.to.value00="",path.to.value01="" - 'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value: - - export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 --decode) - - 'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value: - - export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 --decode) -``` - -## Upgrading - -### To 1.0.0 - -[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL. - -**What changes were introduced in this major version?** - -- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field. -- Use `type: library`. [Here](https://v3.helm.sh/docs/faq/#library-chart-support) you can find more information. -- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts - -**Considerations when upgrading to this version** - -- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues -- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore -- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3 - -**Useful links** - -- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/ -- https://helm.sh/docs/topics/v2_v3_migration/ -- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/ diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_affinities.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_affinities.tpl deleted file mode 100644 index 189ea40..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_affinities.tpl +++ /dev/null @@ -1,102 +0,0 @@ -{{/* vim: set filetype=mustache: */}} - -{{/* -Return a soft nodeAffinity definition -{{ include "common.affinities.nodes.soft" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}} -*/}} -{{- define "common.affinities.nodes.soft" -}} -preferredDuringSchedulingIgnoredDuringExecution: - - preference: - matchExpressions: - - key: {{ .key }} - operator: In - values: - {{- range .values }} - - {{ . | quote }} - {{- end }} - weight: 1 -{{- end -}} - -{{/* -Return a hard nodeAffinity definition -{{ include "common.affinities.nodes.hard" (dict "key" "FOO" "values" (list "BAR" "BAZ")) -}} -*/}} -{{- define "common.affinities.nodes.hard" -}} -requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: {{ .key }} - operator: In - values: - {{- range .values }} - - {{ . | quote }} - {{- end }} -{{- end -}} - -{{/* -Return a nodeAffinity definition -{{ include "common.affinities.nodes" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}} -*/}} -{{- define "common.affinities.nodes" -}} - {{- if eq .type "soft" }} - {{- include "common.affinities.nodes.soft" . -}} - {{- else if eq .type "hard" }} - {{- include "common.affinities.nodes.hard" . -}} - {{- end -}} -{{- end -}} - -{{/* -Return a soft podAffinity/podAntiAffinity definition -{{ include "common.affinities.pods.soft" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}} -*/}} -{{- define "common.affinities.pods.soft" -}} -{{- $component := default "" .component -}} -{{- $extraMatchLabels := default (dict) .extraMatchLabels -}} -preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 10 }} - {{- if not (empty $component) }} - {{ printf "app.kubernetes.io/component: %s" $component }} - {{- end }} - {{- range $key, $value := $extraMatchLabels }} - {{ $key }}: {{ $value | quote }} - {{- end }} - namespaces: - - {{ .context.Release.Namespace | quote }} - topologyKey: kubernetes.io/hostname - weight: 1 -{{- end -}} - -{{/* -Return a hard podAffinity/podAntiAffinity definition -{{ include "common.affinities.pods.hard" (dict "component" "FOO" "extraMatchLabels" .Values.extraMatchLabels "context" $) -}} -*/}} -{{- define "common.affinities.pods.hard" -}} -{{- $component := default "" .component -}} -{{- $extraMatchLabels := default (dict) .extraMatchLabels -}} -requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchLabels: {{- (include "common.labels.matchLabels" .context) | nindent 8 }} - {{- if not (empty $component) }} - {{ printf "app.kubernetes.io/component: %s" $component }} - {{- end }} - {{- range $key, $value := $extraMatchLabels }} - {{ $key }}: {{ $value | quote }} - {{- end }} - namespaces: - - {{ .context.Release.Namespace | quote }} - topologyKey: kubernetes.io/hostname -{{- end -}} - -{{/* -Return a podAffinity/podAntiAffinity definition -{{ include "common.affinities.pods" (dict "type" "soft" "key" "FOO" "values" (list "BAR" "BAZ")) -}} -*/}} -{{- define "common.affinities.pods" -}} - {{- if eq .type "soft" }} - {{- include "common.affinities.pods.soft" . -}} - {{- else if eq .type "hard" }} - {{- include "common.affinities.pods.hard" . -}} - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_capabilities.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_capabilities.tpl deleted file mode 100644 index b94212b..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_capabilities.tpl +++ /dev/null @@ -1,128 +0,0 @@ -{{/* vim: set filetype=mustache: */}} - -{{/* -Return the target Kubernetes version -*/}} -{{- define "common.capabilities.kubeVersion" -}} -{{- if .Values.global }} - {{- if .Values.global.kubeVersion }} - {{- .Values.global.kubeVersion -}} - {{- else }} - {{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}} - {{- end -}} -{{- else }} -{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for poddisruptionbudget. -*/}} -{{- define "common.capabilities.policy.apiVersion" -}} -{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "policy/v1beta1" -}} -{{- else -}} -{{- print "policy/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for networkpolicy. -*/}} -{{- define "common.capabilities.networkPolicy.apiVersion" -}} -{{- if semverCompare "<1.7-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "extensions/v1beta1" -}} -{{- else -}} -{{- print "networking.k8s.io/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for cronjob. -*/}} -{{- define "common.capabilities.cronjob.apiVersion" -}} -{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "batch/v1beta1" -}} -{{- else -}} -{{- print "batch/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for deployment. -*/}} -{{- define "common.capabilities.deployment.apiVersion" -}} -{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "extensions/v1beta1" -}} -{{- else -}} -{{- print "apps/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for statefulset. -*/}} -{{- define "common.capabilities.statefulset.apiVersion" -}} -{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "apps/v1beta1" -}} -{{- else -}} -{{- print "apps/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for ingress. -*/}} -{{- define "common.capabilities.ingress.apiVersion" -}} -{{- if .Values.ingress -}} -{{- if .Values.ingress.apiVersion -}} -{{- .Values.ingress.apiVersion -}} -{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "extensions/v1beta1" -}} -{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "networking.k8s.io/v1beta1" -}} -{{- else -}} -{{- print "networking.k8s.io/v1" -}} -{{- end }} -{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "extensions/v1beta1" -}} -{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "networking.k8s.io/v1beta1" -}} -{{- else -}} -{{- print "networking.k8s.io/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for RBAC resources. -*/}} -{{- define "common.capabilities.rbac.apiVersion" -}} -{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "rbac.authorization.k8s.io/v1beta1" -}} -{{- else -}} -{{- print "rbac.authorization.k8s.io/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for CRDs. -*/}} -{{- define "common.capabilities.crd.apiVersion" -}} -{{- if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "apiextensions.k8s.io/v1beta1" -}} -{{- else -}} -{{- print "apiextensions.k8s.io/v1" -}} -{{- end -}} -{{- end -}} - -{{/* -Returns true if the used Helm version is 3.3+. -A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure. -This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error. -**To be removed when the catalog's minimun Helm version is 3.3** -*/}} -{{- define "common.capabilities.supportsHelmVersion" -}} -{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }} - {{- true -}} -{{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_errors.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_errors.tpl deleted file mode 100644 index a79cc2e..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_errors.tpl +++ /dev/null @@ -1,23 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Through error when upgrading using empty passwords values that must not be empty. - -Usage: -{{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}} -{{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}} -{{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }} - -Required password params: - - validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error. - - context - Context - Required. Parent context. -*/}} -{{- define "common.errors.upgrade.passwords.empty" -}} - {{- $validationErrors := join "" .validationErrors -}} - {{- if and $validationErrors .context.Release.IsUpgrade -}} - {{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}} - {{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}} - {{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}} - {{- $errorString = print $errorString "\n%s" -}} - {{- printf $errorString $validationErrors | fail -}} - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_images.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_images.tpl deleted file mode 100644 index 42ffbc7..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_images.tpl +++ /dev/null @@ -1,75 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Return the proper image name -{{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }} -*/}} -{{- define "common.images.image" -}} -{{- $registryName := .imageRoot.registry -}} -{{- $repositoryName := .imageRoot.repository -}} -{{- $tag := .imageRoot.tag | toString -}} -{{- if .global }} - {{- if .global.imageRegistry }} - {{- $registryName = .global.imageRegistry -}} - {{- end -}} -{{- end -}} -{{- if $registryName }} -{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} -{{- else -}} -{{- printf "%s:%s" $repositoryName $tag -}} -{{- end -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) -{{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }} -*/}} -{{- define "common.images.pullSecrets" -}} - {{- $pullSecrets := list }} - - {{- if .global }} - {{- range .global.imagePullSecrets -}} - {{- $pullSecrets = append $pullSecrets . -}} - {{- end -}} - {{- end -}} - - {{- range .images -}} - {{- range .pullSecrets -}} - {{- $pullSecrets = append $pullSecrets . -}} - {{- end -}} - {{- end -}} - - {{- if (not (empty $pullSecrets)) }} -imagePullSecrets: - {{- range $pullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names evaluating values as templates -{{ include "common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }} -*/}} -{{- define "common.images.renderPullSecrets" -}} - {{- $pullSecrets := list }} - {{- $context := .context }} - - {{- if $context.Values.global }} - {{- range $context.Values.global.imagePullSecrets -}} - {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}} - {{- end -}} - {{- end -}} - - {{- range .images -}} - {{- range .pullSecrets -}} - {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}} - {{- end -}} - {{- end -}} - - {{- if (not (empty $pullSecrets)) }} -imagePullSecrets: - {{- range $pullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_ingress.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_ingress.tpl deleted file mode 100644 index f905f20..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_ingress.tpl +++ /dev/null @@ -1,55 +0,0 @@ -{{/* vim: set filetype=mustache: */}} - -{{/* -Generate backend entry that is compatible with all Kubernetes API versions. - -Usage: -{{ include "common.ingress.backend" (dict "serviceName" "backendName" "servicePort" "backendPort" "context" $) }} - -Params: - - serviceName - String. Name of an existing service backend - - servicePort - String/Int. Port name (or number) of the service. It will be translated to different yaml depending if it is a string or an integer. - - context - Dict - Required. The context for the template evaluation. -*/}} -{{- define "common.ingress.backend" -}} -{{- $apiVersion := (include "common.capabilities.ingress.apiVersion" .context) -}} -{{- if or (eq $apiVersion "extensions/v1beta1") (eq $apiVersion "networking.k8s.io/v1beta1") -}} -serviceName: {{ .serviceName }} -servicePort: {{ .servicePort }} -{{- else -}} -service: - name: {{ .serviceName }} - port: - {{- if typeIs "string" .servicePort }} - name: {{ .servicePort }} - {{- else if or (typeIs "int" .servicePort) (typeIs "float64" .servicePort) }} - number: {{ .servicePort | int }} - {{- end }} -{{- end -}} -{{- end -}} - -{{/* -Print "true" if the API pathType field is supported -Usage: -{{ include "common.ingress.supportsPathType" . }} -*/}} -{{- define "common.ingress.supportsPathType" -}} -{{- if (semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .)) -}} -{{- print "false" -}} -{{- else -}} -{{- print "true" -}} -{{- end -}} -{{- end -}} - -{{/* -Returns true if the ingressClassname field is supported -Usage: -{{ include "common.ingress.supportsIngressClassname" . }} -*/}} -{{- define "common.ingress.supportsIngressClassname" -}} -{{- if semverCompare "<1.18-0" (include "common.capabilities.kubeVersion" .) -}} -{{- print "false" -}} -{{- else -}} -{{- print "true" -}} -{{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_labels.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_labels.tpl deleted file mode 100644 index 252066c..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_labels.tpl +++ /dev/null @@ -1,18 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Kubernetes standard labels -*/}} -{{- define "common.labels.standard" -}} -app.kubernetes.io/name: {{ include "common.names.name" . }} -helm.sh/chart: {{ include "common.names.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector -*/}} -{{- define "common.labels.matchLabels" -}} -app.kubernetes.io/name: {{ include "common.names.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_names.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_names.tpl deleted file mode 100644 index cf03231..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "common.names.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "common.names.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "common.names.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create a default fully qualified dependency name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -Usage: -{{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }} -*/}} -{{- define "common.names.dependency.fullname" -}} -{{- if .chartValues.fullnameOverride -}} -{{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .chartName .chartValues.nameOverride -}} -{{- if contains $name .context.Release.Name -}} -{{- .context.Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_secrets.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_secrets.tpl deleted file mode 100644 index 60b84a7..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_secrets.tpl +++ /dev/null @@ -1,129 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Generate secret name. - -Usage: -{{ include "common.secrets.name" (dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $) }} - -Params: - - existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user - to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility. - +info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret - - defaultNameSuffix - String - Optional. It is used only if we have several secrets in the same deployment. - - context - Dict - Required. The context for the template evaluation. -*/}} -{{- define "common.secrets.name" -}} -{{- $name := (include "common.names.fullname" .context) -}} - -{{- if .defaultNameSuffix -}} -{{- $name = printf "%s-%s" $name .defaultNameSuffix | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- with .existingSecret -}} -{{- if not (typeIs "string" .) -}} -{{- with .name -}} -{{- $name = . -}} -{{- end -}} -{{- else -}} -{{- $name = . -}} -{{- end -}} -{{- end -}} - -{{- printf "%s" $name -}} -{{- end -}} - -{{/* -Generate secret key. - -Usage: -{{ include "common.secrets.key" (dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName") }} - -Params: - - existingSecret - ExistingSecret/String - Optional. The path to the existing secrets in the values.yaml given by the user - to be used instead of the default one. Allows for it to be of type String (just the secret name) for backwards compatibility. - +info: https://github.com/bitnami/charts/tree/master/bitnami/common#existingsecret - - key - String - Required. Name of the key in the secret. -*/}} -{{- define "common.secrets.key" -}} -{{- $key := .key -}} - -{{- if .existingSecret -}} - {{- if not (typeIs "string" .existingSecret) -}} - {{- if .existingSecret.keyMapping -}} - {{- $key = index .existingSecret.keyMapping $.key -}} - {{- end -}} - {{- end }} -{{- end -}} - -{{- printf "%s" $key -}} -{{- end -}} - -{{/* -Generate secret password or retrieve one if already created. - -Usage: -{{ include "common.secrets.passwords.manage" (dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $) }} - -Params: - - secret - String - Required - Name of the 'Secret' resource where the password is stored. - - key - String - Required - Name of the key in the secret. - - providedValues - List - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value. - - length - int - Optional - Length of the generated random password. - - strong - Boolean - Optional - Whether to add symbols to the generated random password. - - chartName - String - Optional - Name of the chart used when said chart is deployed as a subchart. - - context - Context - Required - Parent context. -*/}} -{{- define "common.secrets.passwords.manage" -}} - -{{- $password := "" }} -{{- $subchart := "" }} -{{- $chartName := default "" .chartName }} -{{- $passwordLength := default 10 .length }} -{{- $providedPasswordKey := include "common.utils.getKeyFromList" (dict "keys" .providedValues "context" $.context) }} -{{- $providedPasswordValue := include "common.utils.getValueFromKey" (dict "key" $providedPasswordKey "context" $.context) }} -{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }} -{{- if $secret }} - {{- if index $secret.data .key }} - {{- $password = index $secret.data .key }} - {{- end -}} -{{- else if $providedPasswordValue }} - {{- $password = $providedPasswordValue | toString | b64enc | quote }} -{{- else }} - - {{- if .context.Values.enabled }} - {{- $subchart = $chartName }} - {{- end -}} - - {{- $requiredPassword := dict "valueKey" $providedPasswordKey "secret" .secret "field" .key "subchart" $subchart "context" $.context -}} - {{- $requiredPasswordError := include "common.validations.values.single.empty" $requiredPassword -}} - {{- $passwordValidationErrors := list $requiredPasswordError -}} - {{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $.context) -}} - - {{- if .strong }} - {{- $subStr := list (lower (randAlpha 1)) (randNumeric 1) (upper (randAlpha 1)) | join "_" }} - {{- $password = randAscii $passwordLength }} - {{- $password = regexReplaceAllLiteral "\\W" $password "@" | substr 5 $passwordLength }} - {{- $password = printf "%s%s" $subStr $password | toString | shuffle | b64enc | quote }} - {{- else }} - {{- $password = randAlphaNum $passwordLength | b64enc | quote }} - {{- end }} -{{- end -}} -{{- printf "%s" $password -}} -{{- end -}} - -{{/* -Returns whether a previous generated secret already exists - -Usage: -{{ include "common.secrets.exists" (dict "secret" "secret-name" "context" $) }} - -Params: - - secret - String - Required - Name of the 'Secret' resource where the password is stored. - - context - Context - Required - Parent context. -*/}} -{{- define "common.secrets.exists" -}} -{{- $secret := (lookup "v1" "Secret" $.context.Release.Namespace .secret) }} -{{- if $secret }} - {{- true -}} -{{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_storage.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_storage.tpl deleted file mode 100644 index 60e2a84..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_storage.tpl +++ /dev/null @@ -1,23 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Return the proper Storage Class -{{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }} -*/}} -{{- define "common.storage.class" -}} - -{{- $storageClass := .persistence.storageClass -}} -{{- if .global -}} - {{- if .global.storageClass -}} - {{- $storageClass = .global.storageClass -}} - {{- end -}} -{{- end -}} - -{{- if $storageClass -}} - {{- if (eq "-" $storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" $storageClass -}} - {{- end -}} -{{- end -}} - -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_tplvalues.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_tplvalues.tpl deleted file mode 100644 index 2db1668..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_tplvalues.tpl +++ /dev/null @@ -1,13 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Renders a value that contains template. -Usage: -{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }} -*/}} -{{- define "common.tplvalues.render" -}} - {{- if typeIs "string" .value }} - {{- tpl .value .context }} - {{- else }} - {{- tpl (.value | toYaml) .context }} - {{- end }} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_utils.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_utils.tpl deleted file mode 100644 index ea083a2..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_utils.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Print instructions to get a secret value. -Usage: -{{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }} -*/}} -{{- define "common.utils.secret.getvalue" -}} -{{- $varname := include "common.utils.fieldToEnvVar" . -}} -export {{ $varname }}=$(kubectl get secret --namespace {{ .context.Release.Namespace | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 --decode) -{{- end -}} - -{{/* -Build env var name given a field -Usage: -{{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }} -*/}} -{{- define "common.utils.fieldToEnvVar" -}} - {{- $fieldNameSplit := splitList "-" .field -}} - {{- $upperCaseFieldNameSplit := list -}} - - {{- range $fieldNameSplit -}} - {{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}} - {{- end -}} - - {{ join "_" $upperCaseFieldNameSplit }} -{{- end -}} - -{{/* -Gets a value from .Values given -Usage: -{{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }} -*/}} -{{- define "common.utils.getValueFromKey" -}} -{{- $splitKey := splitList "." .key -}} -{{- $value := "" -}} -{{- $latestObj := $.context.Values -}} -{{- range $splitKey -}} - {{- if not $latestObj -}} - {{- printf "please review the entire path of '%s' exists in values" $.key | fail -}} - {{- end -}} - {{- $value = ( index $latestObj . ) -}} - {{- $latestObj = $value -}} -{{- end -}} -{{- printf "%v" (default "" $value) -}} -{{- end -}} - -{{/* -Returns first .Values key with a defined value or first of the list if all non-defined -Usage: -{{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }} -*/}} -{{- define "common.utils.getKeyFromList" -}} -{{- $key := first .keys -}} -{{- $reverseKeys := reverse .keys }} -{{- range $reverseKeys }} - {{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }} - {{- if $value -}} - {{- $key = . }} - {{- end -}} -{{- end -}} -{{- printf "%s" $key -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_warnings.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_warnings.tpl deleted file mode 100644 index ae10fa4..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/_warnings.tpl +++ /dev/null @@ -1,14 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Warning about using rolling tag. -Usage: -{{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }} -*/}} -{{- define "common.warnings.rollingTag" -}} - -{{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }} -WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. -+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ -{{- end }} - -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_cassandra.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_cassandra.tpl deleted file mode 100644 index ded1ae3..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_cassandra.tpl +++ /dev/null @@ -1,72 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Validate Cassandra required passwords are not empty. - -Usage: -{{ include "common.validations.values.cassandra.passwords" (dict "secret" "secretName" "subchart" false "context" $) }} -Params: - - secret - String - Required. Name of the secret where Cassandra values are stored, e.g: "cassandra-passwords-secret" - - subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false -*/}} -{{- define "common.validations.values.cassandra.passwords" -}} - {{- $existingSecret := include "common.cassandra.values.existingSecret" . -}} - {{- $enabled := include "common.cassandra.values.enabled" . -}} - {{- $dbUserPrefix := include "common.cassandra.values.key.dbUser" . -}} - {{- $valueKeyPassword := printf "%s.password" $dbUserPrefix -}} - - {{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}} - {{- $requiredPasswords := list -}} - - {{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "cassandra-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredPassword -}} - - {{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}} - - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for existingSecret. - -Usage: -{{ include "common.cassandra.values.existingSecret" (dict "context" $) }} -Params: - - subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false -*/}} -{{- define "common.cassandra.values.existingSecret" -}} - {{- if .subchart -}} - {{- .context.Values.cassandra.dbUser.existingSecret | quote -}} - {{- else -}} - {{- .context.Values.dbUser.existingSecret | quote -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for enabled cassandra. - -Usage: -{{ include "common.cassandra.values.enabled" (dict "context" $) }} -*/}} -{{- define "common.cassandra.values.enabled" -}} - {{- if .subchart -}} - {{- printf "%v" .context.Values.cassandra.enabled -}} - {{- else -}} - {{- printf "%v" (not .context.Values.enabled) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for the key dbUser - -Usage: -{{ include "common.cassandra.values.key.dbUser" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether Cassandra is used as subchart or not. Default: false -*/}} -{{- define "common.cassandra.values.key.dbUser" -}} - {{- if .subchart -}} - cassandra.dbUser - {{- else -}} - dbUser - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mariadb.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mariadb.tpl deleted file mode 100644 index b6906ff..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mariadb.tpl +++ /dev/null @@ -1,103 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Validate MariaDB required passwords are not empty. - -Usage: -{{ include "common.validations.values.mariadb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }} -Params: - - secret - String - Required. Name of the secret where MariaDB values are stored, e.g: "mysql-passwords-secret" - - subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false -*/}} -{{- define "common.validations.values.mariadb.passwords" -}} - {{- $existingSecret := include "common.mariadb.values.auth.existingSecret" . -}} - {{- $enabled := include "common.mariadb.values.enabled" . -}} - {{- $architecture := include "common.mariadb.values.architecture" . -}} - {{- $authPrefix := include "common.mariadb.values.key.auth" . -}} - {{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}} - {{- $valueKeyUsername := printf "%s.username" $authPrefix -}} - {{- $valueKeyPassword := printf "%s.password" $authPrefix -}} - {{- $valueKeyReplicationPassword := printf "%s.replicationPassword" $authPrefix -}} - - {{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}} - {{- $requiredPasswords := list -}} - - {{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mariadb-root-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}} - - {{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }} - {{- if not (empty $valueUsername) -}} - {{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mariadb-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredPassword -}} - {{- end -}} - - {{- if (eq $architecture "replication") -}} - {{- $requiredReplicationPassword := dict "valueKey" $valueKeyReplicationPassword "secret" .secret "field" "mariadb-replication-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredReplicationPassword -}} - {{- end -}} - - {{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}} - - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for existingSecret. - -Usage: -{{ include "common.mariadb.values.auth.existingSecret" (dict "context" $) }} -Params: - - subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false -*/}} -{{- define "common.mariadb.values.auth.existingSecret" -}} - {{- if .subchart -}} - {{- .context.Values.mariadb.auth.existingSecret | quote -}} - {{- else -}} - {{- .context.Values.auth.existingSecret | quote -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for enabled mariadb. - -Usage: -{{ include "common.mariadb.values.enabled" (dict "context" $) }} -*/}} -{{- define "common.mariadb.values.enabled" -}} - {{- if .subchart -}} - {{- printf "%v" .context.Values.mariadb.enabled -}} - {{- else -}} - {{- printf "%v" (not .context.Values.enabled) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for architecture - -Usage: -{{ include "common.mariadb.values.architecture" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false -*/}} -{{- define "common.mariadb.values.architecture" -}} - {{- if .subchart -}} - {{- .context.Values.mariadb.architecture -}} - {{- else -}} - {{- .context.Values.architecture -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for the key auth - -Usage: -{{ include "common.mariadb.values.key.auth" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false -*/}} -{{- define "common.mariadb.values.key.auth" -}} - {{- if .subchart -}} - mariadb.auth - {{- else -}} - auth - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mongodb.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mongodb.tpl deleted file mode 100644 index a071ea4..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_mongodb.tpl +++ /dev/null @@ -1,108 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Validate MongoDB® required passwords are not empty. - -Usage: -{{ include "common.validations.values.mongodb.passwords" (dict "secret" "secretName" "subchart" false "context" $) }} -Params: - - secret - String - Required. Name of the secret where MongoDB® values are stored, e.g: "mongodb-passwords-secret" - - subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false -*/}} -{{- define "common.validations.values.mongodb.passwords" -}} - {{- $existingSecret := include "common.mongodb.values.auth.existingSecret" . -}} - {{- $enabled := include "common.mongodb.values.enabled" . -}} - {{- $authPrefix := include "common.mongodb.values.key.auth" . -}} - {{- $architecture := include "common.mongodb.values.architecture" . -}} - {{- $valueKeyRootPassword := printf "%s.rootPassword" $authPrefix -}} - {{- $valueKeyUsername := printf "%s.username" $authPrefix -}} - {{- $valueKeyDatabase := printf "%s.database" $authPrefix -}} - {{- $valueKeyPassword := printf "%s.password" $authPrefix -}} - {{- $valueKeyReplicaSetKey := printf "%s.replicaSetKey" $authPrefix -}} - {{- $valueKeyAuthEnabled := printf "%s.enabled" $authPrefix -}} - - {{- $authEnabled := include "common.utils.getValueFromKey" (dict "key" $valueKeyAuthEnabled "context" .context) -}} - - {{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") (eq $authEnabled "true") -}} - {{- $requiredPasswords := list -}} - - {{- $requiredRootPassword := dict "valueKey" $valueKeyRootPassword "secret" .secret "field" "mongodb-root-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredRootPassword -}} - - {{- $valueUsername := include "common.utils.getValueFromKey" (dict "key" $valueKeyUsername "context" .context) }} - {{- $valueDatabase := include "common.utils.getValueFromKey" (dict "key" $valueKeyDatabase "context" .context) }} - {{- if and $valueUsername $valueDatabase -}} - {{- $requiredPassword := dict "valueKey" $valueKeyPassword "secret" .secret "field" "mongodb-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredPassword -}} - {{- end -}} - - {{- if (eq $architecture "replicaset") -}} - {{- $requiredReplicaSetKey := dict "valueKey" $valueKeyReplicaSetKey "secret" .secret "field" "mongodb-replica-set-key" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredReplicaSetKey -}} - {{- end -}} - - {{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}} - - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for existingSecret. - -Usage: -{{ include "common.mongodb.values.auth.existingSecret" (dict "context" $) }} -Params: - - subchart - Boolean - Optional. Whether MongoDb is used as subchart or not. Default: false -*/}} -{{- define "common.mongodb.values.auth.existingSecret" -}} - {{- if .subchart -}} - {{- .context.Values.mongodb.auth.existingSecret | quote -}} - {{- else -}} - {{- .context.Values.auth.existingSecret | quote -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for enabled mongodb. - -Usage: -{{ include "common.mongodb.values.enabled" (dict "context" $) }} -*/}} -{{- define "common.mongodb.values.enabled" -}} - {{- if .subchart -}} - {{- printf "%v" .context.Values.mongodb.enabled -}} - {{- else -}} - {{- printf "%v" (not .context.Values.enabled) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for the key auth - -Usage: -{{ include "common.mongodb.values.key.auth" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether MongoDB® is used as subchart or not. Default: false -*/}} -{{- define "common.mongodb.values.key.auth" -}} - {{- if .subchart -}} - mongodb.auth - {{- else -}} - auth - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for architecture - -Usage: -{{ include "common.mongodb.values.architecture" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether MariaDB is used as subchart or not. Default: false -*/}} -{{- define "common.mongodb.values.architecture" -}} - {{- if .subchart -}} - {{- .context.Values.mongodb.architecture -}} - {{- else -}} - {{- .context.Values.architecture -}} - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_postgresql.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_postgresql.tpl deleted file mode 100644 index 164ec0d..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_postgresql.tpl +++ /dev/null @@ -1,129 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Validate PostgreSQL required passwords are not empty. - -Usage: -{{ include "common.validations.values.postgresql.passwords" (dict "secret" "secretName" "subchart" false "context" $) }} -Params: - - secret - String - Required. Name of the secret where postgresql values are stored, e.g: "postgresql-passwords-secret" - - subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false -*/}} -{{- define "common.validations.values.postgresql.passwords" -}} - {{- $existingSecret := include "common.postgresql.values.existingSecret" . -}} - {{- $enabled := include "common.postgresql.values.enabled" . -}} - {{- $valueKeyPostgresqlPassword := include "common.postgresql.values.key.postgressPassword" . -}} - {{- $valueKeyPostgresqlReplicationEnabled := include "common.postgresql.values.key.replicationPassword" . -}} - {{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}} - {{- $requiredPasswords := list -}} - {{- $requiredPostgresqlPassword := dict "valueKey" $valueKeyPostgresqlPassword "secret" .secret "field" "postgresql-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlPassword -}} - - {{- $enabledReplication := include "common.postgresql.values.enabled.replication" . -}} - {{- if (eq $enabledReplication "true") -}} - {{- $requiredPostgresqlReplicationPassword := dict "valueKey" $valueKeyPostgresqlReplicationEnabled "secret" .secret "field" "postgresql-replication-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredPostgresqlReplicationPassword -}} - {{- end -}} - - {{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to decide whether evaluate global values. - -Usage: -{{ include "common.postgresql.values.use.global" (dict "key" "key-of-global" "context" $) }} -Params: - - key - String - Required. Field to be evaluated within global, e.g: "existingSecret" -*/}} -{{- define "common.postgresql.values.use.global" -}} - {{- if .context.Values.global -}} - {{- if .context.Values.global.postgresql -}} - {{- index .context.Values.global.postgresql .key | quote -}} - {{- end -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for existingSecret. - -Usage: -{{ include "common.postgresql.values.existingSecret" (dict "context" $) }} -*/}} -{{- define "common.postgresql.values.existingSecret" -}} - {{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "existingSecret" "context" .context) -}} - - {{- if .subchart -}} - {{- default (.context.Values.postgresql.existingSecret | quote) $globalValue -}} - {{- else -}} - {{- default (.context.Values.existingSecret | quote) $globalValue -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for enabled postgresql. - -Usage: -{{ include "common.postgresql.values.enabled" (dict "context" $) }} -*/}} -{{- define "common.postgresql.values.enabled" -}} - {{- if .subchart -}} - {{- printf "%v" .context.Values.postgresql.enabled -}} - {{- else -}} - {{- printf "%v" (not .context.Values.enabled) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for the key postgressPassword. - -Usage: -{{ include "common.postgresql.values.key.postgressPassword" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false -*/}} -{{- define "common.postgresql.values.key.postgressPassword" -}} - {{- $globalValue := include "common.postgresql.values.use.global" (dict "key" "postgresqlUsername" "context" .context) -}} - - {{- if not $globalValue -}} - {{- if .subchart -}} - postgresql.postgresqlPassword - {{- else -}} - postgresqlPassword - {{- end -}} - {{- else -}} - global.postgresql.postgresqlPassword - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for enabled.replication. - -Usage: -{{ include "common.postgresql.values.enabled.replication" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false -*/}} -{{- define "common.postgresql.values.enabled.replication" -}} - {{- if .subchart -}} - {{- printf "%v" .context.Values.postgresql.replication.enabled -}} - {{- else -}} - {{- printf "%v" .context.Values.replication.enabled -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for the key replication.password. - -Usage: -{{ include "common.postgresql.values.key.replicationPassword" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether postgresql is used as subchart or not. Default: false -*/}} -{{- define "common.postgresql.values.key.replicationPassword" -}} - {{- if .subchart -}} - postgresql.replication.password - {{- else -}} - replication.password - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_redis.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_redis.tpl deleted file mode 100644 index 5d72959..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_redis.tpl +++ /dev/null @@ -1,76 +0,0 @@ - -{{/* vim: set filetype=mustache: */}} -{{/* -Validate Redis™ required passwords are not empty. - -Usage: -{{ include "common.validations.values.redis.passwords" (dict "secret" "secretName" "subchart" false "context" $) }} -Params: - - secret - String - Required. Name of the secret where redis values are stored, e.g: "redis-passwords-secret" - - subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false -*/}} -{{- define "common.validations.values.redis.passwords" -}} - {{- $enabled := include "common.redis.values.enabled" . -}} - {{- $valueKeyPrefix := include "common.redis.values.keys.prefix" . -}} - {{- $standarizedVersion := include "common.redis.values.standarized.version" . }} - - {{- $existingSecret := ternary (printf "%s%s" $valueKeyPrefix "auth.existingSecret") (printf "%s%s" $valueKeyPrefix "existingSecret") (eq $standarizedVersion "true") }} - {{- $existingSecretValue := include "common.utils.getValueFromKey" (dict "key" $existingSecret "context" .context) }} - - {{- $valueKeyRedisPassword := ternary (printf "%s%s" $valueKeyPrefix "auth.password") (printf "%s%s" $valueKeyPrefix "password") (eq $standarizedVersion "true") }} - {{- $valueKeyRedisUseAuth := ternary (printf "%s%s" $valueKeyPrefix "auth.enabled") (printf "%s%s" $valueKeyPrefix "usePassword") (eq $standarizedVersion "true") }} - - {{- if and (or (not $existingSecret) (eq $existingSecret "\"\"")) (eq $enabled "true") -}} - {{- $requiredPasswords := list -}} - - {{- $useAuth := include "common.utils.getValueFromKey" (dict "key" $valueKeyRedisUseAuth "context" .context) -}} - {{- if eq $useAuth "true" -}} - {{- $requiredRedisPassword := dict "valueKey" $valueKeyRedisPassword "secret" .secret "field" "redis-password" -}} - {{- $requiredPasswords = append $requiredPasswords $requiredRedisPassword -}} - {{- end -}} - - {{- include "common.validations.values.multiple.empty" (dict "required" $requiredPasswords "context" .context) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right value for enabled redis. - -Usage: -{{ include "common.redis.values.enabled" (dict "context" $) }} -*/}} -{{- define "common.redis.values.enabled" -}} - {{- if .subchart -}} - {{- printf "%v" .context.Values.redis.enabled -}} - {{- else -}} - {{- printf "%v" (not .context.Values.enabled) -}} - {{- end -}} -{{- end -}} - -{{/* -Auxiliary function to get the right prefix path for the values - -Usage: -{{ include "common.redis.values.key.prefix" (dict "subchart" "true" "context" $) }} -Params: - - subchart - Boolean - Optional. Whether redis is used as subchart or not. Default: false -*/}} -{{- define "common.redis.values.keys.prefix" -}} - {{- if .subchart -}}redis.{{- else -}}{{- end -}} -{{- end -}} - -{{/* -Checks whether the redis chart's includes the standarizations (version >= 14) - -Usage: -{{ include "common.redis.values.standarized.version" (dict "context" $) }} -*/}} -{{- define "common.redis.values.standarized.version" -}} - - {{- $standarizedAuth := printf "%s%s" (include "common.redis.values.keys.prefix" .) "auth" -}} - {{- $standarizedAuthValues := include "common.utils.getValueFromKey" (dict "key" $standarizedAuth "context" .context) }} - - {{- if $standarizedAuthValues -}} - {{- true -}} - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_validations.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_validations.tpl deleted file mode 100644 index 9a814cf..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/templates/validations/_validations.tpl +++ /dev/null @@ -1,46 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Validate values must not be empty. - -Usage: -{{- $validateValueConf00 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-00") -}} -{{- $validateValueConf01 := (dict "valueKey" "path.to.value" "secret" "secretName" "field" "password-01") -}} -{{ include "common.validations.values.empty" (dict "required" (list $validateValueConf00 $validateValueConf01) "context" $) }} - -Validate value params: - - valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password" - - secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret" - - field - String - Optional. Name of the field in the secret data, e.g: "mysql-password" -*/}} -{{- define "common.validations.values.multiple.empty" -}} - {{- range .required -}} - {{- include "common.validations.values.single.empty" (dict "valueKey" .valueKey "secret" .secret "field" .field "context" $.context) -}} - {{- end -}} -{{- end -}} - -{{/* -Validate a value must not be empty. - -Usage: -{{ include "common.validations.value.empty" (dict "valueKey" "mariadb.password" "secret" "secretName" "field" "my-password" "subchart" "subchart" "context" $) }} - -Validate value params: - - valueKey - String - Required. The path to the validating value in the values.yaml, e.g: "mysql.password" - - secret - String - Optional. Name of the secret where the validating value is generated/stored, e.g: "mysql-passwords-secret" - - field - String - Optional. Name of the field in the secret data, e.g: "mysql-password" - - subchart - String - Optional - Name of the subchart that the validated password is part of. -*/}} -{{- define "common.validations.values.single.empty" -}} - {{- $value := include "common.utils.getValueFromKey" (dict "key" .valueKey "context" .context) }} - {{- $subchart := ternary "" (printf "%s." .subchart) (empty .subchart) }} - - {{- if not $value -}} - {{- $varname := "my-value" -}} - {{- $getCurrentValue := "" -}} - {{- if and .secret .field -}} - {{- $varname = include "common.utils.fieldToEnvVar" . -}} - {{- $getCurrentValue = printf " To get the current value:\n\n %s\n" (include "common.utils.secret.getvalue" .) -}} - {{- end -}} - {{- printf "\n '%s' must not be empty, please add '--set %s%s=$%s' to the command.%s" .valueKey $subchart .valueKey $varname $getCurrentValue -}} - {{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/values.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/values.yaml deleted file mode 100644 index f2df68e..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/values.yaml +++ /dev/null @@ -1,5 +0,0 @@ -## bitnami/common -## It is required by CI/CD tools and processes. -## @skip exampleValue -## -exampleValue: common-chart diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/commonAnnotations.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/commonAnnotations.yaml deleted file mode 100644 index 97e18a4..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/commonAnnotations.yaml +++ /dev/null @@ -1,3 +0,0 @@ -commonAnnotations: - helm.sh/hook: "\"pre-install, pre-upgrade\"" - helm.sh/hook-weight: "-1" diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/default-values.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/default-values.yaml deleted file mode 100644 index fc2ba60..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/default-values.yaml +++ /dev/null @@ -1 +0,0 @@ -# Leave this file empty to ensure that CI runs builds against the default configuration in values.yaml. diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/shmvolume-disabled-values.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/shmvolume-disabled-values.yaml deleted file mode 100644 index 347d3b4..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/ci/shmvolume-disabled-values.yaml +++ /dev/null @@ -1,2 +0,0 @@ -shmVolume: - enabled: false diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/files/README.md b/manifests/helm/keycloak/18.4.0/charts/postgresql/files/README.md deleted file mode 100644 index 1813a2f..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/files/README.md +++ /dev/null @@ -1 +0,0 @@ -Copy here your postgresql.conf and/or pg_hba.conf files to use it as a config map. diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/files/conf.d/README.md b/manifests/helm/keycloak/18.4.0/charts/postgresql/files/conf.d/README.md deleted file mode 100644 index 184c187..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/files/conf.d/README.md +++ /dev/null @@ -1,4 +0,0 @@ -If you don't want to provide the whole configuration file and only specify certain parameters, you can copy here your extended `.conf` files. -These files will be injected as a config maps and add/overwrite the default configuration using the `include_dir` directive that allows settings to be loaded from files other than the default `postgresql.conf`. - -More info in the [bitnami-docker-postgresql README](https://github.com/bitnami/bitnami-docker-postgresql#configuration-file). diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/files/docker-entrypoint-initdb.d/README.md b/manifests/helm/keycloak/18.4.0/charts/postgresql/files/docker-entrypoint-initdb.d/README.md deleted file mode 100644 index cba3809..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/files/docker-entrypoint-initdb.d/README.md +++ /dev/null @@ -1,3 +0,0 @@ -You can copy here your custom `.sh`, `.sql` or `.sql.gz` file so they are executed during the first boot of the image. - -More info in the [bitnami-docker-postgresql](https://github.com/bitnami/bitnami-docker-postgresql#initializing-a-new-instance) repository. \ No newline at end of file diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/NOTES.txt b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/NOTES.txt deleted file mode 100644 index ccb581d..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/NOTES.txt +++ /dev/null @@ -1,89 +0,0 @@ -CHART NAME: {{ .Chart.Name }} -CHART VERSION: {{ .Chart.Version }} -APP VERSION: {{ .Chart.AppVersion }} - -** Please be patient while the chart is being deployed ** - -{{- if .Values.diagnosticMode.enabled }} -The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with: - - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }} - -Get the list of pods by executing: - - kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }} - -Access the pod you want to debug by executing - - kubectl exec --namespace {{ .Release.Namespace }} -ti -- bash - -In order to replicate the container startup scripts execute this command: - - /opt/bitnami/scripts/postgresql/entrypoint.sh /opt/bitnami/scripts/postgresql/run.sh - -{{- else }} - -PostgreSQL can be accessed via port {{ template "postgresql.servicePort" . }} on the following DNS names from within your cluster: - - {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read/Write connection -{{- if .Values.replication.enabled }} -{{- if .Values.replication.singleService }} - {{ template "common.names.fullname" . }}-read.{{ .Release.Namespace }}.svc.cluster.local - Read only connection -{{- end }} -{{- if .Values.replication.uniqueServices }} -{{- $replicaCount := .Values.replication.readReplicas | int }} -{{- $root := . }} -{{- range $i, $e := until $replicaCount }} - {{ template "common.names.fullname" $root }}-read-{{ $i }}.{{ $root.Release.Namespace }}.svc.cluster.local - Read only connection to replica {{ $i }} -{{- end }} -{{- end }} -{{- end }} - -{{- if not (eq (include "postgresql.username" .) "postgres") }} - -To get the password for "postgres" run: - - export POSTGRES_ADMIN_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "postgresql.secretName" . }} -o jsonpath="{.data.postgresql-postgres-password}" | base64 --decode) -{{- end }} - -To get the password for "{{ template "postgresql.username" . }}" run: - - export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "postgresql.secretName" . }} -o jsonpath="{.data.postgresql-password}" | base64 --decode) - -To connect to your database run the following command: - - kubectl run {{ template "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image {{ template "postgresql.image" . }} --env="PGPASSWORD=$POSTGRES_PASSWORD" {{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} - --labels="{{ template "common.names.fullname" . }}-client=true" {{- end }} --command -- psql --host {{ template "common.names.fullname" . }} -U {{ .Values.postgresqlUsername }} -d {{- if .Values.postgresqlDatabase }} {{ .Values.postgresqlDatabase }}{{- else }} postgres{{- end }} -p {{ template "postgresql.servicePort" . }} - -{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} -Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to this PostgreSQL cluster. -{{- end }} - -To connect to your database from outside the cluster execute the following commands: - -{{- if contains "NodePort" .Values.service.type }} - - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "common.names.fullname" . }}) - {{ if (include "postgresql.password" . ) }}PGPASSWORD="$POSTGRES_PASSWORD" {{ end }}psql --host $NODE_IP --port $NODE_PORT -U {{ .Values.postgresqlUsername }} -d {{- if .Values.postgresqlDatabase }} {{ .Values.postgresqlDatabase }}{{- else }} postgres{{- end }} - -{{- else if contains "LoadBalancer" .Values.service.type }} - - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}' - - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") - {{ if (include "postgresql.password" . ) }}PGPASSWORD="$POSTGRES_PASSWORD" {{ end }}psql --host $SERVICE_IP --port {{ template "postgresql.servicePort" . }} -U {{ .Values.postgresqlUsername }} -d {{- if .Values.postgresqlDatabase }} {{ .Values.postgresqlDatabase }}{{- else }} postgres{{- end }} - -{{- else if contains "ClusterIP" .Values.service.type }} - - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "common.names.fullname" . }} {{ template "postgresql.servicePort" . }}:{{ template "postgresql.servicePort" . }} & - {{ if (include "postgresql.password" . ) }}PGPASSWORD="$POSTGRES_PASSWORD" {{ end }}psql --host 127.0.0.1 -U {{ .Values.postgresqlUsername }} -d {{- if .Values.postgresqlDatabase }} {{ .Values.postgresqlDatabase }}{{- else }} postgres{{- end }} -p {{ template "postgresql.servicePort" . }} - -{{- end }} -{{- end }} - -{{- include "postgresql.validateValues" . -}} -{{- include "common.warnings.rollingTag" .Values.image -}} -{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/_helpers.tpl b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/_helpers.tpl deleted file mode 100644 index 16e4456..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/_helpers.tpl +++ /dev/null @@ -1,361 +0,0 @@ -{{/* vim: set filetype=mustache: */}} - -{{/* -Expand the name of the chart. -*/}} -{{- define "postgresql.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "postgresql.primary.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- $fullname := default (printf "%s-%s" .Release.Name $name) .Values.fullnameOverride -}} -{{- if .Values.replication.enabled -}} -{{- printf "%s-%s" $fullname "primary" | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s" $fullname | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the proper PostgreSQL image name -*/}} -{{- define "postgresql.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper PostgreSQL metrics image name -*/}} -{{- define "postgresql.metrics.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "postgresql.volumePermissions.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "postgresql.imagePullSecrets" -}} -{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image) "global" .Values.global) }} -{{- end -}} - -{{/* -Returns the available value for certain key in an existing secret (if it exists), -otherwise it generates a random value. -*/}} -{{- define "getValueFromSecret" }} -{{- $len := (default 16 .Length) | int -}} -{{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}} -{{- if $obj }} -{{- index $obj .Key | b64dec -}} -{{- else -}} -{{- randAlphaNum $len -}} -{{- end -}} -{{- end }} - -{{/* -Return PostgreSQL postgres user password -*/}} -{{- define "postgresql.postgres.password" -}} -{{- if .Values.global.postgresql.postgresqlPostgresPassword }} - {{- .Values.global.postgresql.postgresqlPostgresPassword -}} -{{- else if .Values.postgresqlPostgresPassword -}} - {{- .Values.postgresqlPostgresPassword -}} -{{- else -}} - {{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "postgresql-postgres-password") -}} -{{- end -}} -{{- end -}} - -{{/* -Return PostgreSQL password -*/}} -{{- define "postgresql.password" -}} -{{- if .Values.global.postgresql.postgresqlPassword }} - {{- .Values.global.postgresql.postgresqlPassword -}} -{{- else if .Values.postgresqlPassword -}} - {{- .Values.postgresqlPassword -}} -{{- else -}} - {{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "postgresql-password") -}} -{{- end -}} -{{- end -}} - -{{/* -Return PostgreSQL replication password -*/}} -{{- define "postgresql.replication.password" -}} -{{- if .Values.global.postgresql.replicationPassword }} - {{- .Values.global.postgresql.replicationPassword -}} -{{- else if .Values.replication.password -}} - {{- .Values.replication.password -}} -{{- else -}} - {{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "postgresql-replication-password") -}} -{{- end -}} -{{- end -}} - -{{/* -Return PostgreSQL username -*/}} -{{- define "postgresql.username" -}} -{{- if .Values.global.postgresql.postgresqlUsername }} - {{- .Values.global.postgresql.postgresqlUsername -}} -{{- else -}} - {{- .Values.postgresqlUsername -}} -{{- end -}} -{{- end -}} - -{{/* -Return PostgreSQL replication username -*/}} -{{- define "postgresql.replication.username" -}} -{{- if .Values.global.postgresql.replicationUser }} - {{- .Values.global.postgresql.replicationUser -}} -{{- else -}} - {{- .Values.replication.user -}} -{{- end -}} -{{- end -}} - -{{/* -Return PostgreSQL port -*/}} -{{- define "postgresql.servicePort" -}} -{{- if .Values.global.postgresql.servicePort }} - {{- .Values.global.postgresql.servicePort -}} -{{- else -}} - {{- .Values.service.port -}} -{{- end -}} -{{- end -}} - -{{/* -Return PostgreSQL created database -*/}} -{{- define "postgresql.database" -}} -{{- if .Values.global.postgresql.postgresqlDatabase }} - {{- .Values.global.postgresql.postgresqlDatabase -}} -{{- else if .Values.postgresqlDatabase -}} - {{- .Values.postgresqlDatabase -}} -{{- end -}} -{{- end -}} - -{{/* -Get the password secret. -*/}} -{{- define "postgresql.secretName" -}} -{{- if .Values.global.postgresql.existingSecret }} - {{- printf "%s" (tpl .Values.global.postgresql.existingSecret $) -}} -{{- else if .Values.existingSecret -}} - {{- printf "%s" (tpl .Values.existingSecret $) -}} -{{- else -}} - {{- printf "%s" (include "common.names.fullname" .) -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if we should use an existingSecret. -*/}} -{{- define "postgresql.useExistingSecret" -}} -{{- if or .Values.global.postgresql.existingSecret .Values.existingSecret -}} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a secret object should be created -*/}} -{{- define "postgresql.createSecret" -}} -{{- if not (include "postgresql.useExistingSecret" .) -}} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Get the configuration ConfigMap name. -*/}} -{{- define "postgresql.configurationCM" -}} -{{- if .Values.configurationConfigMap -}} -{{- printf "%s" (tpl .Values.configurationConfigMap $) -}} -{{- else -}} -{{- printf "%s-configuration" (include "common.names.fullname" .) -}} -{{- end -}} -{{- end -}} - -{{/* -Get the extended configuration ConfigMap name. -*/}} -{{- define "postgresql.extendedConfigurationCM" -}} -{{- if .Values.extendedConfConfigMap -}} -{{- printf "%s" (tpl .Values.extendedConfConfigMap $) -}} -{{- else -}} -{{- printf "%s-extended-configuration" (include "common.names.fullname" .) -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a configmap should be mounted with PostgreSQL configuration -*/}} -{{- define "postgresql.mountConfigurationCM" -}} -{{- if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration .Values.configurationConfigMap }} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Get the initialization scripts ConfigMap name. -*/}} -{{- define "postgresql.initdbScriptsCM" -}} -{{- if .Values.initdbScriptsConfigMap -}} -{{- printf "%s" (tpl .Values.initdbScriptsConfigMap $) -}} -{{- else -}} -{{- printf "%s-init-scripts" (include "common.names.fullname" .) -}} -{{- end -}} -{{- end -}} - -{{/* -Get the initialization scripts Secret name. -*/}} -{{- define "postgresql.initdbScriptsSecret" -}} -{{- printf "%s" (tpl .Values.initdbScriptsSecret $) -}} -{{- end -}} - -{{/* -Get the metrics ConfigMap name. -*/}} -{{- define "postgresql.metricsCM" -}} -{{- printf "%s-metrics" (include "common.names.fullname" .) -}} -{{- end -}} - -{{/* -Get the readiness probe command -*/}} -{{- define "postgresql.readinessProbeCommand" -}} -- | -{{- if (include "postgresql.database" .) }} - exec pg_isready -U {{ include "postgresql.username" . | quote }} -d "dbname={{ include "postgresql.database" . }} {{- if .Values.tls.enabled }} sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} -{{- else }} - exec pg_isready -U {{ include "postgresql.username" . | quote }} {{- if .Values.tls.enabled }} -d "sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} -{{- end }} -{{- if contains "bitnami/" .Values.image.repository }} - [ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ] -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message, and call fail. -*/}} -{{- define "postgresql.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "postgresql.validateValues.ldapConfigurationMethod" .) -}} -{{- $messages := append $messages (include "postgresql.validateValues.psp" .) -}} -{{- $messages := append $messages (include "postgresql.validateValues.tls" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}} -{{- end -}} -{{- end -}} - -{{/* -Validate values of Postgresql - If ldap.url is used then you don't need the other settings for ldap -*/}} -{{- define "postgresql.validateValues.ldapConfigurationMethod" -}} -{{- if and .Values.ldap.enabled (and (not (empty .Values.ldap.url)) (not (empty .Values.ldap.server))) }} -postgresql: ldap.url, ldap.server - You cannot set both `ldap.url` and `ldap.server` at the same time. - Please provide a unique way to configure LDAP. - More info at https://www.postgresql.org/docs/current/auth-ldap.html -{{- end -}} -{{- end -}} - -{{/* -Validate values of Postgresql - If PSP is enabled RBAC should be enabled too -*/}} -{{- define "postgresql.validateValues.psp" -}} -{{- if and .Values.psp.create (not .Values.rbac.create) }} -postgresql: psp.create, rbac.create - RBAC should be enabled if PSP is enabled in order for PSP to work. - More info at https://kubernetes.io/docs/concepts/policy/pod-security-policy/#authorizing-policies -{{- end -}} -{{- end -}} - -{{/* -Validate values of Postgresql TLS - When TLS is enabled, so must be VolumePermissions -*/}} -{{- define "postgresql.validateValues.tls" -}} -{{- if and .Values.tls.enabled (not .Values.volumePermissions.enabled) }} -postgresql: tls.enabled, volumePermissions.enabled - When TLS is enabled you must enable volumePermissions as well to ensure certificates files have - the right permissions. -{{- end -}} -{{- end -}} - -{{/* -Return the path to the cert file. -*/}} -{{- define "postgresql.tlsCert" -}} -{{- if .Values.tls.autoGenerated }} - {{- printf "/opt/bitnami/postgresql/certs/tls.crt" -}} -{{- else -}} - {{- required "Certificate filename is required when TLS in enabled" .Values.tls.certFilename | printf "/opt/bitnami/postgresql/certs/%s" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the path to the cert key file. -*/}} -{{- define "postgresql.tlsCertKey" -}} -{{- if .Values.tls.autoGenerated }} - {{- printf "/opt/bitnami/postgresql/certs/tls.key" -}} -{{- else -}} -{{- required "Certificate Key filename is required when TLS in enabled" .Values.tls.certKeyFilename | printf "/opt/bitnami/postgresql/certs/%s" -}} -{{- end -}} -{{- end -}} - -{{/* -Return the path to the CA cert file. -*/}} -{{- define "postgresql.tlsCACert" -}} -{{- if .Values.tls.autoGenerated }} - {{- printf "/opt/bitnami/postgresql/certs/ca.crt" -}} -{{- else -}} - {{- printf "/opt/bitnami/postgresql/certs/%s" .Values.tls.certCAFilename -}} -{{- end -}} -{{- end -}} - -{{/* -Return the path to the CRL file. -*/}} -{{- define "postgresql.tlsCRL" -}} -{{- if .Values.tls.crlFilename -}} -{{- printf "/opt/bitnami/postgresql/certs/%s" .Values.tls.crlFilename -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a TLS credentials secret object should be created -*/}} -{{- define "postgresql.createTlsSecret" -}} -{{- if and .Values.tls.autoGenerated (not .Values.tls.certificatesSecret) }} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Return the path to the CA cert file. -*/}} -{{- define "postgresql.tlsSecretName" -}} -{{- if .Values.tls.autoGenerated }} - {{- printf "%s-crt" (include "common.names.fullname" .) -}} -{{- else -}} - {{ required "A secret containing TLS certificates is required when TLS is enabled" .Values.tls.certificatesSecret }} -{{- end -}} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/configmap.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/configmap.yaml deleted file mode 100644 index 0ff4dfe..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/configmap.yaml +++ /dev/null @@ -1,34 +0,0 @@ -{{ if and (or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration) (not .Values.configurationConfigMap) }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "common.names.fullname" . }}-configuration - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -data: -{{- if (.Files.Glob "files/postgresql.conf") }} -{{ (.Files.Glob "files/postgresql.conf").AsConfig | indent 2 }} -{{- else if .Values.postgresqlConfiguration }} - postgresql.conf: | -{{- range $key, $value := default dict .Values.postgresqlConfiguration }} - {{- if kindIs "string" $value }} - {{ $key | snakecase }} = '{{ $value }}' - {{- else }} - {{ $key | snakecase }} = {{ $value }} - {{- end }} -{{- end }} -{{- end }} -{{- if (.Files.Glob "files/pg_hba.conf") }} -{{ (.Files.Glob "files/pg_hba.conf").AsConfig | indent 2 }} -{{- else if .Values.pgHbaConfiguration }} - pg_hba.conf: | -{{ .Values.pgHbaConfiguration | indent 4 }} -{{- end }} -{{ end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extended-config-configmap.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extended-config-configmap.yaml deleted file mode 100644 index a94e06f..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extended-config-configmap.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- if and (or (.Files.Glob "files/conf.d/*.conf") .Values.postgresqlExtendedConf) (not .Values.extendedConfConfigMap) }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "common.names.fullname" . }}-extended-configuration - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -data: -{{- with .Files.Glob "files/conf.d/*.conf" }} -{{ .AsConfig | indent 2 }} -{{- end }} -{{ with .Values.postgresqlExtendedConf }} - override.conf: | -{{- range $key, $value := . }} - {{- if kindIs "string" $value }} - {{ $key | snakecase }} = '{{ $value }}' - {{- else }} - {{ $key | snakecase }} = {{ $value }} - {{- end }} -{{- end }} -{{- end }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extra-list.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/initialization-configmap.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/initialization-configmap.yaml deleted file mode 100644 index c681e5c..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/initialization-configmap.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{{- if and (or (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql,sql.gz}") .Values.initdbScripts) (not .Values.initdbScriptsConfigMap) }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "common.names.fullname" . }}-init-scripts - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -{{- with .Files.Glob "files/docker-entrypoint-initdb.d/*.sql.gz" }} -binaryData: -{{- range $path, $bytes := . }} - {{ base $path }}: {{ $.Files.Get $path | b64enc | quote }} -{{- end }} -{{- end }} -data: -{{- with .Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql}" }} -{{ .AsConfig | indent 2 }} -{{- end }} -{{- include "common.tplvalues.render" (dict "value" .Values.initdbScripts "context" .) | nindent 2 }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-configmap.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-configmap.yaml deleted file mode 100644 index b6411f3..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-configmap.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.customMetrics }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "postgresql.metricsCM" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -data: - custom-metrics.yaml: {{ toYaml .Values.metrics.customMetrics | quote }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-svc.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-svc.yaml deleted file mode 100644 index 06c52fd..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/metrics-svc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- if .Values.metrics.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.names.fullname" . }}-metrics - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- toYaml .Values.metrics.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace }} -spec: - type: {{ .Values.metrics.service.type }} - {{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerIP }} - loadBalancerIP: {{ .Values.metrics.service.loadBalancerIP }} - {{- end }} - ports: - - name: http-metrics - port: 9187 - targetPort: http-metrics - selector: - {{- include "common.labels.matchLabels" . | nindent 4 }} - role: primary -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/networkpolicy.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/networkpolicy.yaml deleted file mode 100644 index c51f678..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/networkpolicy.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if .Values.networkPolicy.enabled }} -kind: NetworkPolicy -apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }} -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} - ingress: - # Allow inbound connections - - ports: - - port: {{ template "postgresql.servicePort" . }} - {{- if not .Values.networkPolicy.allowExternal }} - from: - - podSelector: - matchLabels: - {{ template "common.names.fullname" . }}-client: "true" - {{- if .Values.networkPolicy.explicitNamespacesSelector }} - namespaceSelector: -{{ toYaml .Values.networkPolicy.explicitNamespacesSelector | indent 12 }} - {{- end }} - - podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 14 }} - role: read - {{- end }} - {{- if .Values.metrics.enabled }} - # Allow prometheus scrapes - - ports: - - port: 9187 - {{- end }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/podsecuritypolicy.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/podsecuritypolicy.yaml deleted file mode 100644 index 0eefb3b..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/podsecuritypolicy.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}} -{{- if and $pspAvailable .Values.psp.create }} -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - privileged: false - volumes: - - 'configMap' - - 'secret' - - 'persistentVolumeClaim' - - 'emptyDir' - - 'projected' - hostNetwork: false - hostIPC: false - hostPID: false - runAsUser: - rule: 'RunAsAny' - seLinux: - rule: 'RunAsAny' - supplementalGroups: - rule: 'MustRunAs' - ranges: - - min: 1 - max: 65535 - fsGroup: - rule: 'MustRunAs' - ranges: - - min: 1 - max: 65535 - readOnlyRootFilesystem: false -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/prometheusrule.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/prometheusrule.yaml deleted file mode 100644 index 727a6b7..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/prometheusrule.yaml +++ /dev/null @@ -1,26 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: PrometheusRule -metadata: - name: {{ template "common.names.fullname" . }} -{{- with .Values.metrics.prometheusRule.namespace }} - namespace: {{ . }} -{{- end }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.metrics.prometheusRule.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: -{{- with .Values.metrics.prometheusRule.rules }} - groups: - - name: {{ template "postgresql.name" $ }} - rules: {{ tpl (toYaml .) $ | nindent 8 }} -{{- end }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/role.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/role.yaml deleted file mode 100644 index 1366eda..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if .Values.rbac.create }} -kind: Role -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -rules: - {{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}} - {{- if and $pspAvailable .Values.psp.create }} - - apiGroups: ["extensions"] - resources: ["podsecuritypolicies"] - verbs: ["use"] - resourceNames: - - {{ template "common.names.fullname" . }} - {{- end }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/rolebinding.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/rolebinding.yaml deleted file mode 100644 index 988cb73..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/rolebinding.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if .Values.rbac.create }} -kind: RoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -roleRef: - kind: Role - name: {{ template "common.names.fullname" . }} - apiGroup: rbac.authorization.k8s.io -subjects: - - kind: ServiceAccount - name: {{ default (include "common.names.fullname" . ) .Values.serviceAccount.name }} - namespace: {{ .Release.Namespace }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/secrets.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/secrets.yaml deleted file mode 100644 index 6bab462..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/secrets.yaml +++ /dev/null @@ -1,27 +0,0 @@ -{{- if (include "postgresql.createSecret" .) }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - namespace: {{ .Release.Namespace }} -type: Opaque -data: - {{- if not (eq (include "postgresql.username" .) "postgres") }} - postgresql-postgres-password: {{ include "postgresql.postgres.password" . | b64enc | quote }} - {{- end }} - postgresql-password: {{ include "postgresql.password" . | b64enc | quote }} - {{- if .Values.replication.enabled }} - postgresql-replication-password: {{ include "postgresql.replication.password" . | b64enc | quote }} - {{- end }} - {{- if (and .Values.ldap.enabled .Values.ldap.bind_password) }} - postgresql-ldap-password: {{ .Values.ldap.bind_password | b64enc | quote }} - {{- end }} -{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/serviceaccount.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/serviceaccount.yaml deleted file mode 100644 index 8e951b8..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/serviceaccount.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if and (.Values.serviceAccount.enabled) (not .Values.serviceAccount.name) }} -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/servicemonitor.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/servicemonitor.yaml deleted file mode 100644 index 6cd6a1d..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/servicemonitor.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ include "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- end }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - -spec: - endpoints: - - port: http-metrics - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabelings }} - relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.metricRelabelings }} - metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace }} - selector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset-readreplicas.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset-readreplicas.yaml deleted file mode 100644 index 830fadb..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset-readreplicas.yaml +++ /dev/null @@ -1,436 +0,0 @@ -{{- if .Values.replication.enabled }} -{{- $readReplicasResources := coalesce .Values.readReplicas.resources .Values.resources -}} -apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }} -kind: StatefulSet -metadata: - name: "{{ template "common.names.fullname" . }}-read" - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: read - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.readReplicas.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.labels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.readReplicas.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - serviceName: {{ template "common.names.fullname" . }}-headless - replicas: {{ .Values.replication.readReplicas }} - selector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} - role: read - template: - metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: read - role: read - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.readReplicas.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.podLabels "context" $) | nindent 8 }} - {{- end }} -{{- with .Values.readReplicas.podAnnotations }} - annotations: -{{ toYaml . | indent 8 }} -{{- end }} - spec: - {{- if .Values.schedulerName }} - schedulerName: "{{ .Values.schedulerName }}" - {{- end }} -{{- include "postgresql.imagePullSecrets" . | indent 6 }} - {{- if .Values.readReplicas.affinity }} - affinity: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.readReplicas.podAffinityPreset "component" "read" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.readReplicas.podAntiAffinityPreset "component" "read" "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.readReplicas.nodeAffinityPreset.type "key" .Values.readReplicas.nodeAffinityPreset.key "values" .Values.readReplicas.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.readReplicas.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.readReplicas.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.tolerations "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.readReplicas.topologySpreadConstraints }} - topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.topologySpreadConstraints "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.terminationGracePeriodSeconds }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} - {{- end }} - {{- if .Values.securityContext.enabled }} - securityContext: {{- omit .Values.securityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - automountServiceAccountToken: {{ .Values.serviceAccount.autoMount }} - {{- if .Values.serviceAccount.enabled }} - serviceAccountName: {{ default (include "common.names.fullname" . ) .Values.serviceAccount.name }} - {{- end }} - {{- if or .Values.readReplicas.extraInitContainers (and .Values.volumePermissions.enabled (or .Values.persistence.enabled (and .Values.shmVolume.enabled .Values.shmVolume.chmod.enabled))) }} - initContainers: - {{- if and .Values.volumePermissions.enabled (or .Values.persistence.enabled (and .Values.shmVolume.enabled .Values.shmVolume.chmod.enabled) .Values.tls.enabled) }} - - name: init-chmod-data - image: {{ template "postgresql.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - command: - - /bin/sh - - -cx - - | - {{- if .Values.persistence.enabled }} - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - chown `id -u`:`id -G | cut -d " " -f2` {{ .Values.persistence.mountPath }} - {{- else }} - chown {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} {{ .Values.persistence.mountPath }} - {{- end }} - mkdir -p {{ .Values.persistence.mountPath }}/data {{- if (include "postgresql.mountConfigurationCM" .) }} {{ .Values.persistence.mountPath }}/conf {{- end }} - chmod 700 {{ .Values.persistence.mountPath }}/data {{- if (include "postgresql.mountConfigurationCM" .) }} {{ .Values.persistence.mountPath }}/conf {{- end }} - find {{ .Values.persistence.mountPath }} -mindepth 1 -maxdepth 1 {{- if not (include "postgresql.mountConfigurationCM" .) }} -not -name "conf" {{- end }} -not -name ".snapshot" -not -name "lost+found" | \ - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - xargs chown -R `id -u`:`id -G | cut -d " " -f2` - {{- else }} - xargs chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} - {{- end }} - {{- end }} - {{- if and .Values.shmVolume.enabled .Values.shmVolume.chmod.enabled }} - chmod -R 777 /dev/shm - {{- end }} - {{- if .Values.tls.enabled }} - cp /tmp/certs/* /opt/bitnami/postgresql/certs/ - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - chown -R `id -u`:`id -G | cut -d " " -f2` /opt/bitnami/postgresql/certs/ - {{- else }} - chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} /opt/bitnami/postgresql/certs/ - {{- end }} - chmod 600 {{ template "postgresql.tlsCertKey" . }} - {{- end }} - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - securityContext: {{- omit .Values.volumePermissions.securityContext "runAsUser" | toYaml | nindent 12 }} - {{- else }} - securityContext: {{- .Values.volumePermissions.securityContext | toYaml | nindent 12 }} - {{- end }} - volumeMounts: - {{ if .Values.persistence.enabled }} - - name: data - mountPath: {{ .Values.persistence.mountPath }} - subPath: {{ .Values.persistence.subPath }} - {{- end }} - {{- if .Values.shmVolume.enabled }} - - name: dshm - mountPath: /dev/shm - {{- end }} - {{- if .Values.tls.enabled }} - - name: raw-certificates - mountPath: /tmp/certs - - name: postgresql-certificates - mountPath: /opt/bitnami/postgresql/certs - {{- end }} - {{- end }} - {{- if .Values.readReplicas.extraInitContainers }} - {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.extraInitContainers "context" $ ) | nindent 8 }} - {{- end }} - {{- end }} - {{- if .Values.readReplicas.priorityClassName }} - priorityClassName: {{ .Values.readReplicas.priorityClassName }} - {{- end }} - containers: - - name: {{ template "common.names.fullname" . }} - image: {{ template "postgresql.image" . }} - imagePullPolicy: "{{ .Values.image.pullPolicy }}" - {{- if $readReplicasResources }} - resources: {{- toYaml $readReplicasResources | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: BITNAMI_DEBUG - value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} - - name: POSTGRESQL_VOLUME_DIR - value: "{{ .Values.persistence.mountPath }}" - - name: POSTGRESQL_PORT_NUMBER - value: {{ .Values.containerPorts.postgresql | quote }} - {{- if .Values.persistence.mountPath }} - - name: PGDATA - value: {{ .Values.postgresqlDataDir | quote }} - {{- end }} - - name: POSTGRES_REPLICATION_MODE - value: "slave" - - name: POSTGRES_REPLICATION_USER - value: {{ include "postgresql.replication.username" . | quote }} - {{- if .Values.usePasswordFile }} - - name: POSTGRES_REPLICATION_PASSWORD_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-replication-password" - {{- else }} - - name: POSTGRES_REPLICATION_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-replication-password - {{- end }} - - name: POSTGRES_CLUSTER_APP_NAME - value: {{ .Values.replication.applicationName }} - - name: POSTGRES_MASTER_HOST - value: {{ template "common.names.fullname" . }} - - name: POSTGRES_MASTER_PORT_NUMBER - value: {{ include "postgresql.servicePort" . | quote }} - {{- if not (eq (include "postgresql.username" .) "postgres") }} - {{- if .Values.usePasswordFile }} - - name: POSTGRES_POSTGRES_PASSWORD_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-postgres-password" - {{- else }} - - name: POSTGRES_POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-postgres-password - {{- end }} - {{- end }} - {{- if .Values.usePasswordFile }} - - name: POSTGRES_PASSWORD_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-password" - {{- else }} - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-password - {{- end }} - - name: POSTGRESQL_ENABLE_TLS - value: {{ ternary "yes" "no" .Values.tls.enabled | quote }} - {{- if .Values.tls.enabled }} - - name: POSTGRESQL_TLS_PREFER_SERVER_CIPHERS - value: {{ ternary "yes" "no" .Values.tls.preferServerCiphers | quote }} - - name: POSTGRESQL_TLS_CERT_FILE - value: {{ template "postgresql.tlsCert" . }} - - name: POSTGRESQL_TLS_KEY_FILE - value: {{ template "postgresql.tlsCertKey" . }} - {{- if .Values.tls.certCAFilename }} - - name: POSTGRESQL_TLS_CA_FILE - value: {{ template "postgresql.tlsCACert" . }} - {{- end }} - {{- if .Values.tls.crlFilename }} - - name: POSTGRESQL_TLS_CRL_FILE - value: {{ template "postgresql.tlsCRL" . }} - {{- end }} - {{- end }} - - name: POSTGRESQL_LOG_HOSTNAME - value: {{ .Values.audit.logHostname | quote }} - - name: POSTGRESQL_LOG_CONNECTIONS - value: {{ .Values.audit.logConnections | quote }} - - name: POSTGRESQL_LOG_DISCONNECTIONS - value: {{ .Values.audit.logDisconnections | quote }} - {{- if .Values.audit.logLinePrefix }} - - name: POSTGRESQL_LOG_LINE_PREFIX - value: {{ .Values.audit.logLinePrefix | quote }} - {{- end }} - {{- if .Values.audit.logTimezone }} - - name: POSTGRESQL_LOG_TIMEZONE - value: {{ .Values.audit.logTimezone | quote }} - {{- end }} - {{- if .Values.audit.pgAuditLog }} - - name: POSTGRESQL_PGAUDIT_LOG - value: {{ .Values.audit.pgAuditLog | quote }} - {{- end }} - - name: POSTGRESQL_PGAUDIT_LOG_CATALOG - value: {{ .Values.audit.pgAuditLogCatalog | quote }} - - name: POSTGRESQL_CLIENT_MIN_MESSAGES - value: {{ .Values.audit.clientMinMessages | quote }} - - name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES - value: {{ .Values.postgresqlSharedPreloadLibraries | quote }} - {{- if .Values.postgresqlMaxConnections }} - - name: POSTGRESQL_MAX_CONNECTIONS - value: {{ .Values.postgresqlMaxConnections | quote }} - {{- end }} - {{- if .Values.postgresqlPostgresConnectionLimit }} - - name: POSTGRESQL_POSTGRES_CONNECTION_LIMIT - value: {{ .Values.postgresqlPostgresConnectionLimit | quote }} - {{- end }} - {{- if .Values.postgresqlDbUserConnectionLimit }} - - name: POSTGRESQL_USERNAME_CONNECTION_LIMIT - value: {{ .Values.postgresqlDbUserConnectionLimit | quote }} - {{- end }} - {{- if .Values.postgresqlTcpKeepalivesInterval }} - - name: POSTGRESQL_TCP_KEEPALIVES_INTERVAL - value: {{ .Values.postgresqlTcpKeepalivesInterval | quote }} - {{- end }} - {{- if .Values.postgresqlTcpKeepalivesIdle }} - - name: POSTGRESQL_TCP_KEEPALIVES_IDLE - value: {{ .Values.postgresqlTcpKeepalivesIdle | quote }} - {{- end }} - {{- if .Values.postgresqlStatementTimeout }} - - name: POSTGRESQL_STATEMENT_TIMEOUT - value: {{ .Values.postgresqlStatementTimeout | quote }} - {{- end }} - {{- if .Values.postgresqlTcpKeepalivesCount }} - - name: POSTGRESQL_TCP_KEEPALIVES_COUNT - value: {{ .Values.postgresqlTcpKeepalivesCount | quote }} - {{- end }} - {{- if .Values.postgresqlPghbaRemoveFilters }} - - name: POSTGRESQL_PGHBA_REMOVE_FILTERS - value: {{ .Values.postgresqlPghbaRemoveFilters | quote }} - {{- end }} - ports: - - name: tcp-postgresql - containerPort: {{ .Values.containerPorts.postgresql }} - {{- if not .Values.diagnosticMode.enabled }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: - exec: - command: - - /bin/sh - - -c - {{- if (include "postgresql.database" .) }} - - exec pg_isready -U {{ include "postgresql.username" . | quote }} -d "dbname={{ include "postgresql.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} - {{- else }} - - exec pg_isready -U {{ include "postgresql.username" . | quote }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} - {{- end }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: - exec: - command: - - /bin/sh - - -c - - -e - {{- include "postgresql.readinessProbeCommand" . | nindent 16 }} - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.readinessProbe.failureThreshold }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- end }} - volumeMounts: - {{- if .Values.usePasswordFile }} - - name: postgresql-password - mountPath: /opt/bitnami/postgresql/secrets/ - {{- end }} - {{- if .Values.shmVolume.enabled }} - - name: dshm - mountPath: /dev/shm - {{- end }} - {{- if .Values.persistence.enabled }} - - name: data - mountPath: {{ .Values.persistence.mountPath }} - subPath: {{ .Values.persistence.subPath }} - {{ end }} - {{- if or (.Files.Glob "files/conf.d/*.conf") .Values.postgresqlExtendedConf .Values.extendedConfConfigMap }} - - name: postgresql-extended-config - mountPath: /bitnami/postgresql/conf/conf.d/ - {{- end }} - {{- if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration .Values.configurationConfigMap }} - - name: postgresql-config - mountPath: /bitnami/postgresql/conf - {{- end }} - {{- if .Values.tls.enabled }} - - name: postgresql-certificates - mountPath: /opt/bitnami/postgresql/certs - readOnly: true - {{- end }} - {{- if .Values.readReplicas.extraVolumeMounts }} - {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraVolumeMounts "context" $) | nindent 12 }} - {{- end }} -{{- if .Values.readReplicas.sidecars }} -{{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.sidecars "context" $ ) | nindent 8 }} -{{- end }} - volumes: - {{- if .Values.usePasswordFile }} - - name: postgresql-password - secret: - secretName: {{ template "postgresql.secretName" . }} - {{- end }} - {{- if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration .Values.configurationConfigMap }} - - name: postgresql-config - configMap: - name: {{ template "postgresql.configurationCM" . }} - {{- end }} - {{- if or (.Files.Glob "files/conf.d/*.conf") .Values.postgresqlExtendedConf .Values.extendedConfConfigMap }} - - name: postgresql-extended-config - configMap: - name: {{ template "postgresql.extendedConfigurationCM" . }} - {{- end }} - {{- if .Values.tls.enabled }} - - name: raw-certificates - secret: - secretName: {{ template "postgresql.tlsSecretName" . }} - - name: postgresql-certificates - emptyDir: {} - {{- end }} - {{- if .Values.shmVolume.enabled }} - - name: dshm - emptyDir: - medium: Memory - sizeLimit: 1Gi - {{- end }} - {{- if or (not .Values.persistence.enabled) (not .Values.readReplicas.persistence.enabled) }} - - name: data - emptyDir: {} - {{- end }} - {{- if .Values.readReplicas.extraVolumes }} - {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.extraVolumes "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.readReplicas.extraPodSpec }} - {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraPodSpec "context" $) | nindent 6 }} - {{- end }} - updateStrategy: - type: {{ .Values.updateStrategy.type }} - {{- if (eq "Recreate" .Values.updateStrategy.type) }} - rollingUpdate: null - {{- end }} -{{- if and .Values.persistence.enabled .Values.readReplicas.persistence.enabled }} - volumeClaimTemplates: - - metadata: - name: data - {{- with .Values.persistence.annotations }} - annotations: - {{- range $key, $value := . }} - {{ $key }}: {{ $value }} - {{- end }} - {{- end }} - spec: - accessModes: - {{- range .Values.persistence.accessModes }} - - {{ . | quote }} - {{- end }} - {{- if .Values.persistence.snapshotName }} - dataSource: - name: {{ .Values.persistence.snapshotName }} - kind: VolumeSnapshot - apiGroup: snapshot.storage.k8s.io - {{- end }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} - {{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }} - - {{- if .Values.persistence.selector }} - selector: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.selector "context" $) | nindent 10 }} - {{- end -}} -{{- end }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset.yaml deleted file mode 100644 index b819b4c..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/statefulset.yaml +++ /dev/null @@ -1,642 +0,0 @@ -apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }} -kind: StatefulSet -metadata: - name: {{ template "postgresql.primary.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: primary - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.primary.labels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.primary.labels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.primary.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - serviceName: {{ template "common.names.fullname" . }}-headless - replicas: 1 - updateStrategy: - type: {{ .Values.updateStrategy.type }} - {{- if (eq "Recreate" .Values.updateStrategy.type) }} - rollingUpdate: null - {{- end }} - selector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} - role: primary - template: - metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 8 }} - role: primary - app.kubernetes.io/component: primary - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.primary.podLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.primary.podLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- with .Values.primary.podAnnotations }} - annotations: {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- if .Values.schedulerName }} - schedulerName: "{{ .Values.schedulerName }}" - {{- end }} -{{- include "postgresql.imagePullSecrets" . | indent 6 }} - {{- if .Values.primary.affinity }} - affinity: {{- include "common.tplvalues.render" (dict "value" .Values.primary.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAffinityPreset "component" "primary" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.primary.podAntiAffinityPreset "component" "primary" "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.primary.nodeAffinityPreset.type "key" .Values.primary.nodeAffinityPreset.key "values" .Values.primary.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.primary.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.primary.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.primary.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.primary.tolerations "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.terminationGracePeriodSeconds }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} - {{- end }} - {{- if .Values.securityContext.enabled }} - securityContext: {{- omit .Values.securityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - automountServiceAccountToken: {{ .Values.serviceAccount.autoMount }} - {{- if .Values.serviceAccount.enabled }} - serviceAccountName: {{ default (include "common.names.fullname" . ) .Values.serviceAccount.name }} - {{- end }} - {{- if or .Values.primary.extraInitContainers (and .Values.volumePermissions.enabled (or .Values.persistence.enabled (and .Values.shmVolume.enabled .Values.shmVolume.chmod.enabled))) }} - initContainers: - {{- if and .Values.volumePermissions.enabled (or .Values.persistence.enabled (and .Values.shmVolume.enabled .Values.shmVolume.chmod.enabled) .Values.tls.enabled) }} - - name: init-chmod-data - image: {{ template "postgresql.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - command: - - /bin/sh - - -cx - - | - {{- if .Values.persistence.enabled }} - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - chown `id -u`:`id -G | cut -d " " -f2` {{ .Values.persistence.mountPath }} - {{- else }} - chown {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} {{ .Values.persistence.mountPath }} - {{- end }} - mkdir -p {{ .Values.persistence.mountPath }}/data {{- if (include "postgresql.mountConfigurationCM" .) }} {{ .Values.persistence.mountPath }}/conf {{- end }} - chmod 700 {{ .Values.persistence.mountPath }}/data {{- if (include "postgresql.mountConfigurationCM" .) }} {{ .Values.persistence.mountPath }}/conf {{- end }} - find {{ .Values.persistence.mountPath }} -mindepth 1 -maxdepth 1 {{- if not (include "postgresql.mountConfigurationCM" .) }} -not -name "conf" {{- end }} -not -name ".snapshot" -not -name "lost+found" | \ - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - xargs chown -R `id -u`:`id -G | cut -d " " -f2` - {{- else }} - xargs chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} - {{- end }} - {{- end }} - {{- if and .Values.shmVolume.enabled .Values.shmVolume.chmod.enabled }} - chmod -R 777 /dev/shm - {{- end }} - {{- if .Values.tls.enabled }} - cp /tmp/certs/* /opt/bitnami/postgresql/certs/ - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - chown -R `id -u`:`id -G | cut -d " " -f2` /opt/bitnami/postgresql/certs/ - {{- else }} - chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }} /opt/bitnami/postgresql/certs/ - {{- end }} - chmod 600 {{ template "postgresql.tlsCertKey" . }} - {{- end }} - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - securityContext: {{- omit .Values.volumePermissions.securityContext "runAsUser" | toYaml | nindent 12 }} - {{- else }} - securityContext: {{- .Values.volumePermissions.securityContext | toYaml | nindent 12 }} - {{- end }} - volumeMounts: - {{- if .Values.persistence.enabled }} - - name: data - mountPath: {{ .Values.persistence.mountPath }} - subPath: {{ .Values.persistence.subPath }} - {{- end }} - {{- if .Values.shmVolume.enabled }} - - name: dshm - mountPath: /dev/shm - {{- end }} - {{- if .Values.tls.enabled }} - - name: raw-certificates - mountPath: /tmp/certs - - name: postgresql-certificates - mountPath: /opt/bitnami/postgresql/certs - {{- end }} - {{- end }} - {{- if .Values.primary.extraInitContainers }} - {{- include "common.tplvalues.render" ( dict "value" .Values.primary.extraInitContainers "context" $ ) | nindent 8 }} - {{- end }} - {{- end }} - {{- if .Values.primary.priorityClassName }} - priorityClassName: {{ .Values.primary.priorityClassName }} - {{- end }} - containers: - - name: {{ template "common.names.fullname" . }} - image: {{ template "postgresql.image" . }} - imagePullPolicy: "{{ .Values.image.pullPolicy }}" - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: BITNAMI_DEBUG - value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} - - name: POSTGRESQL_PORT_NUMBER - value: {{ .Values.containerPorts.postgresql | quote }} - - name: POSTGRESQL_VOLUME_DIR - value: "{{ .Values.persistence.mountPath }}" - {{- if .Values.postgresqlInitdbArgs }} - - name: POSTGRES_INITDB_ARGS - value: {{ .Values.postgresqlInitdbArgs | quote }} - {{- end }} - {{- if .Values.postgresqlInitdbWalDir }} - - name: POSTGRES_INITDB_WALDIR - value: {{ .Values.postgresqlInitdbWalDir | quote }} - {{- end }} - {{- if .Values.initdbUser }} - - name: POSTGRESQL_INITSCRIPTS_USERNAME - value: {{ .Values.initdbUser }} - {{- end }} - {{- if .Values.initdbPassword }} - - name: POSTGRESQL_INITSCRIPTS_PASSWORD - value: {{ .Values.initdbPassword }} - {{- end }} - {{- if .Values.persistence.mountPath }} - - name: PGDATA - value: {{ .Values.postgresqlDataDir | quote }} - {{- end }} - {{- if .Values.primaryAsStandBy.enabled }} - - name: POSTGRES_MASTER_HOST - value: {{ .Values.primaryAsStandBy.primaryHost }} - - name: POSTGRES_MASTER_PORT_NUMBER - value: {{ .Values.primaryAsStandBy.primaryPort | quote }} - {{- end }} - {{- if or .Values.replication.enabled .Values.primaryAsStandBy.enabled }} - - name: POSTGRES_REPLICATION_MODE - {{- if .Values.primaryAsStandBy.enabled }} - value: "slave" - {{- else }} - value: "master" - {{- end }} - - name: POSTGRES_REPLICATION_USER - value: {{ include "postgresql.replication.username" . | quote }} - {{- if .Values.usePasswordFile }} - - name: POSTGRES_REPLICATION_PASSWORD_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-replication-password" - {{- else }} - - name: POSTGRES_REPLICATION_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-replication-password - {{- end }} - {{- if not (eq .Values.replication.synchronousCommit "off") }} - - name: POSTGRES_SYNCHRONOUS_COMMIT_MODE - value: {{ .Values.replication.synchronousCommit | quote }} - - name: POSTGRES_NUM_SYNCHRONOUS_REPLICAS - value: {{ .Values.replication.numSynchronousReplicas | quote }} - {{- end }} - - name: POSTGRES_CLUSTER_APP_NAME - value: {{ .Values.replication.applicationName }} - {{- end }} - {{- if not (eq (include "postgresql.username" .) "postgres") }} - {{- if .Values.usePasswordFile }} - - name: POSTGRES_POSTGRES_PASSWORD_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-postgres-password" - {{- else }} - - name: POSTGRES_POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-postgres-password - {{- end }} - {{- end }} - - name: POSTGRES_USER - value: {{ include "postgresql.username" . | quote }} - {{- if .Values.usePasswordFile }} - - name: POSTGRES_PASSWORD_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-password" - {{- else }} - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-password - {{- end }} - {{- if (include "postgresql.database" .) }} - - name: POSTGRES_DB - value: {{ (include "postgresql.database" .) | quote }} - {{- end }} - {{- if .Values.extraEnv }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnv "context" $) | nindent 12 }} - {{- end }} - - name: POSTGRESQL_ENABLE_LDAP - value: {{ ternary "yes" "no" .Values.ldap.enabled | quote }} - {{- if .Values.ldap.enabled }} - - name: POSTGRESQL_LDAP_SERVER - value: {{ .Values.ldap.server }} - - name: POSTGRESQL_LDAP_PORT - value: {{ .Values.ldap.port | quote }} - - name: POSTGRESQL_LDAP_SCHEME - value: {{ .Values.ldap.scheme }} - {{- if .Values.ldap.tls }} - - name: POSTGRESQL_LDAP_TLS - value: "1" - {{- end }} - - name: POSTGRESQL_LDAP_PREFIX - value: {{ .Values.ldap.prefix | quote }} - - name: POSTGRESQL_LDAP_SUFFIX - value: {{ .Values.ldap.suffix | quote }} - - name: POSTGRESQL_LDAP_BASE_DN - value: {{ .Values.ldap.baseDN }} - - name: POSTGRESQL_LDAP_BIND_DN - value: {{ .Values.ldap.bindDN }} - {{- if (not (empty .Values.ldap.bind_password)) }} - - name: POSTGRESQL_LDAP_BIND_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-ldap-password - {{- end }} - - name: POSTGRESQL_LDAP_SEARCH_ATTR - value: {{ .Values.ldap.search_attr }} - - name: POSTGRESQL_LDAP_SEARCH_FILTER - value: {{ .Values.ldap.search_filter }} - - name: POSTGRESQL_LDAP_URL - value: {{ .Values.ldap.url }} - {{- end }} - - name: POSTGRESQL_ENABLE_TLS - value: {{ ternary "yes" "no" .Values.tls.enabled | quote }} - {{- if .Values.tls.enabled }} - - name: POSTGRESQL_TLS_PREFER_SERVER_CIPHERS - value: {{ ternary "yes" "no" .Values.tls.preferServerCiphers | quote }} - - name: POSTGRESQL_TLS_CERT_FILE - value: {{ template "postgresql.tlsCert" . }} - - name: POSTGRESQL_TLS_KEY_FILE - value: {{ template "postgresql.tlsCertKey" . }} - {{- if .Values.tls.certCAFilename }} - - name: POSTGRESQL_TLS_CA_FILE - value: {{ template "postgresql.tlsCACert" . }} - {{- end }} - {{- if .Values.tls.crlFilename }} - - name: POSTGRESQL_TLS_CRL_FILE - value: {{ template "postgresql.tlsCRL" . }} - {{- end }} - {{- end }} - - name: POSTGRESQL_LOG_HOSTNAME - value: {{ .Values.audit.logHostname | quote }} - - name: POSTGRESQL_LOG_CONNECTIONS - value: {{ .Values.audit.logConnections | quote }} - - name: POSTGRESQL_LOG_DISCONNECTIONS - value: {{ .Values.audit.logDisconnections | quote }} - {{- if .Values.audit.logLinePrefix }} - - name: POSTGRESQL_LOG_LINE_PREFIX - value: {{ .Values.audit.logLinePrefix | quote }} - {{- end }} - {{- if .Values.audit.logTimezone }} - - name: POSTGRESQL_LOG_TIMEZONE - value: {{ .Values.audit.logTimezone | quote }} - {{- end }} - {{- if .Values.audit.pgAuditLog }} - - name: POSTGRESQL_PGAUDIT_LOG - value: {{ .Values.audit.pgAuditLog | quote }} - {{- end }} - - name: POSTGRESQL_PGAUDIT_LOG_CATALOG - value: {{ .Values.audit.pgAuditLogCatalog | quote }} - - name: POSTGRESQL_CLIENT_MIN_MESSAGES - value: {{ .Values.audit.clientMinMessages | quote }} - - name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES - value: {{ .Values.postgresqlSharedPreloadLibraries | quote }} - {{- if .Values.postgresqlMaxConnections }} - - name: POSTGRESQL_MAX_CONNECTIONS - value: {{ .Values.postgresqlMaxConnections | quote }} - {{- end }} - {{- if .Values.postgresqlPostgresConnectionLimit }} - - name: POSTGRESQL_POSTGRES_CONNECTION_LIMIT - value: {{ .Values.postgresqlPostgresConnectionLimit | quote }} - {{- end }} - {{- if .Values.postgresqlDbUserConnectionLimit }} - - name: POSTGRESQL_USERNAME_CONNECTION_LIMIT - value: {{ .Values.postgresqlDbUserConnectionLimit | quote }} - {{- end }} - {{- if .Values.postgresqlTcpKeepalivesInterval }} - - name: POSTGRESQL_TCP_KEEPALIVES_INTERVAL - value: {{ .Values.postgresqlTcpKeepalivesInterval | quote }} - {{- end }} - {{- if .Values.postgresqlTcpKeepalivesIdle }} - - name: POSTGRESQL_TCP_KEEPALIVES_IDLE - value: {{ .Values.postgresqlTcpKeepalivesIdle | quote }} - {{- end }} - {{- if .Values.postgresqlStatementTimeout }} - - name: POSTGRESQL_STATEMENT_TIMEOUT - value: {{ .Values.postgresqlStatementTimeout | quote }} - {{- end }} - {{- if .Values.postgresqlTcpKeepalivesCount }} - - name: POSTGRESQL_TCP_KEEPALIVES_COUNT - value: {{ .Values.postgresqlTcpKeepalivesCount | quote }} - {{- end }} - {{- if .Values.postgresqlPghbaRemoveFilters }} - - name: POSTGRESQL_PGHBA_REMOVE_FILTERS - value: {{ .Values.postgresqlPghbaRemoveFilters | quote }} - {{- end }} - {{- if .Values.extraEnvVarsCM }} - envFrom: - - configMapRef: - name: {{ tpl .Values.extraEnvVarsCM . }} - {{- end }} - ports: - - name: tcp-postgresql - containerPort: {{ .Values.containerPorts.postgresql }} - {{- if not .Values.diagnosticMode.enabled }} - {{- if .Values.startupProbe.enabled }} - startupProbe: - exec: - command: - - /bin/sh - - -c - {{- if (include "postgresql.database" .) }} - - exec pg_isready -U {{ include "postgresql.username" . | quote }} -d "dbname={{ include "postgresql.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} - {{- else }} - - exec pg_isready -U {{ include "postgresql.username" . | quote }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} - {{- end }} - initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.startupProbe.periodSeconds }} - timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }} - successThreshold: {{ .Values.startupProbe.successThreshold }} - failureThreshold: {{ .Values.startupProbe.failureThreshold }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: - exec: - command: - - /bin/sh - - -c - {{- if (include "postgresql.database" .) }} - - exec pg_isready -U {{ include "postgresql.username" . | quote }} -d "dbname={{ include "postgresql.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} - {{- else }} - - exec pg_isready -U {{ include "postgresql.username" . | quote }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }} - {{- end }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: - exec: - command: - - /bin/sh - - -c - - -e - {{- include "postgresql.readinessProbeCommand" . | nindent 16 }} - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.readinessProbe.failureThreshold }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- end }} - volumeMounts: - {{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql,sql.gz}") .Values.initdbScriptsConfigMap .Values.initdbScripts }} - - name: custom-init-scripts - mountPath: /docker-entrypoint-initdb.d/ - {{- end }} - {{- if .Values.initdbScriptsSecret }} - - name: custom-init-scripts-secret - mountPath: /docker-entrypoint-initdb.d/secret - {{- end }} - {{- if or (.Files.Glob "files/conf.d/*.conf") .Values.postgresqlExtendedConf .Values.extendedConfConfigMap }} - - name: postgresql-extended-config - mountPath: /bitnami/postgresql/conf/conf.d/ - {{- end }} - {{- if .Values.usePasswordFile }} - - name: postgresql-password - mountPath: /opt/bitnami/postgresql/secrets/ - {{- end }} - {{- if .Values.tls.enabled }} - - name: postgresql-certificates - mountPath: /opt/bitnami/postgresql/certs - readOnly: true - {{- end }} - {{- if .Values.shmVolume.enabled }} - - name: dshm - mountPath: /dev/shm - {{- end }} - {{- if .Values.persistence.enabled }} - - name: data - mountPath: {{ .Values.persistence.mountPath }} - subPath: {{ .Values.persistence.subPath }} - {{- end }} - {{- if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration .Values.configurationConfigMap }} - - name: postgresql-config - mountPath: /bitnami/postgresql/conf - {{- end }} - {{- if .Values.primary.extraVolumeMounts }} - {{- include "common.tplvalues.render" (dict "value" .Values.primary.extraVolumeMounts "context" $) | nindent 12 }} - {{- end }} -{{- if .Values.primary.sidecars }} -{{- include "common.tplvalues.render" ( dict "value" .Values.primary.sidecars "context" $ ) | nindent 8 }} -{{- end }} -{{- if .Values.metrics.enabled }} - - name: metrics - image: {{ template "postgresql.metrics.image" . }} - imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} - {{- if .Values.metrics.securityContext.enabled }} - securityContext: {{- omit .Values.metrics.securityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- end }} - env: - {{- $database := required "In order to enable metrics you need to specify a database (.Values.postgresqlDatabase or .Values.global.postgresql.postgresqlDatabase)" (include "postgresql.database" .) }} - {{- $sslmode := ternary "require" "disable" .Values.tls.enabled }} - {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} - - name: DATA_SOURCE_NAME - value: {{ printf "host=127.0.0.1 port=%d user=%s sslmode=%s sslcert=%s sslkey=%s" (int (include "postgresql.servicePort" .)) (include "postgresql.username" .) $sslmode (include "postgresql.tlsCert" .) (include "postgresql.tlsCertKey" .) }} - {{- else }} - - name: DATA_SOURCE_URI - value: {{ printf "127.0.0.1:%d/%s?sslmode=%s" (int (include "postgresql.servicePort" .)) $database $sslmode }} - {{- end }} - {{- if .Values.usePasswordFile }} - - name: DATA_SOURCE_PASS_FILE - value: "/opt/bitnami/postgresql/secrets/postgresql-password" - {{- else }} - - name: DATA_SOURCE_PASS - valueFrom: - secretKeyRef: - name: {{ template "postgresql.secretName" . }} - key: postgresql-password - {{- end }} - - name: DATA_SOURCE_USER - value: {{ template "postgresql.username" . }} - {{- if .Values.metrics.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - {{- if not .Values.diagnosticMode.enabled }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: - httpGet: - path: / - port: http-metrics - initialDelaySeconds: {{ .Values.metrics.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.metrics.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.metrics.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.metrics.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.metrics.livenessProbe.failureThreshold }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: - httpGet: - path: / - port: http-metrics - initialDelaySeconds: {{ .Values.metrics.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.metrics.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.metrics.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.metrics.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.metrics.readinessProbe.failureThreshold }} - {{- end }} - {{- end }} - volumeMounts: - {{- if .Values.usePasswordFile }} - - name: postgresql-password - mountPath: /opt/bitnami/postgresql/secrets/ - {{- end }} - {{- if .Values.tls.enabled }} - - name: postgresql-certificates - mountPath: /opt/bitnami/postgresql/certs - readOnly: true - {{- end }} - {{- if .Values.metrics.customMetrics }} - - name: custom-metrics - mountPath: /conf - readOnly: true - args: ["--extend.query-path", "/conf/custom-metrics.yaml"] - {{- end }} - ports: - - name: http-metrics - containerPort: 9187 - {{- if .Values.metrics.resources }} - resources: {{- toYaml .Values.metrics.resources | nindent 12 }} - {{- end }} -{{- end }} - volumes: - {{- if or (.Files.Glob "files/postgresql.conf") (.Files.Glob "files/pg_hba.conf") .Values.postgresqlConfiguration .Values.pgHbaConfiguration .Values.configurationConfigMap }} - - name: postgresql-config - configMap: - name: {{ template "postgresql.configurationCM" . }} - {{- end }} - {{- if or (.Files.Glob "files/conf.d/*.conf") .Values.postgresqlExtendedConf .Values.extendedConfConfigMap }} - - name: postgresql-extended-config - configMap: - name: {{ template "postgresql.extendedConfigurationCM" . }} - {{- end }} - {{- if .Values.usePasswordFile }} - - name: postgresql-password - secret: - secretName: {{ template "postgresql.secretName" . }} - {{- end }} - {{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql,sql.gz}") .Values.initdbScriptsConfigMap .Values.initdbScripts }} - - name: custom-init-scripts - configMap: - name: {{ template "postgresql.initdbScriptsCM" . }} - {{- end }} - {{- if .Values.initdbScriptsSecret }} - - name: custom-init-scripts-secret - secret: - secretName: {{ template "postgresql.initdbScriptsSecret" . }} - {{- end }} - {{- if .Values.tls.enabled }} - - name: raw-certificates - secret: - secretName: {{ template "postgresql.tlsSecretName" . }} - - name: postgresql-certificates - emptyDir: {} - {{- end }} - {{- if .Values.primary.extraVolumes }} - {{- include "common.tplvalues.render" ( dict "value" .Values.primary.extraVolumes "context" $ ) | nindent 8 }} - {{- end }} - {{- if and .Values.metrics.enabled .Values.metrics.customMetrics }} - - name: custom-metrics - configMap: - name: {{ template "postgresql.metricsCM" . }} - {{- end }} - {{- if .Values.shmVolume.enabled }} - - name: dshm - emptyDir: - medium: Memory -{{- with .Values.shmVolume.sizeLimit }} - sizeLimit: {{ . }} -{{- end }} - {{- end }} -{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }} - - name: data - persistentVolumeClaim: -{{- with .Values.persistence.existingClaim }} - claimName: {{ tpl . $ }} -{{- end }} -{{- else if not .Values.persistence.enabled }} - - name: data - emptyDir: {} - {{- if .Values.primary.extraPodSpec }} - {{- include "common.tplvalues.render" (dict "value" .Values.primary.extraPodSpec "context" $) | nindent 6 }} - {{- end }} -{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - volumeClaimTemplates: - - metadata: - name: data - {{- with .Values.persistence.annotations }} - annotations: - {{- range $key, $value := . }} - {{ $key }}: {{ $value }} - {{- end }} - {{- end }} - spec: - accessModes: - {{- range .Values.persistence.accessModes }} - - {{ . | quote }} - {{- end }} - {{- if .Values.persistence.snapshotName }} - dataSource: - name: {{ .Values.persistence.snapshotName }} - kind: VolumeSnapshot - apiGroup: snapshot.storage.k8s.io - {{- end }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} - {{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }} - {{- if .Values.persistence.selector }} - selector: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.selector "context" $) | nindent 10 }} - {{- end -}} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-headless.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-headless.yaml deleted file mode 100644 index fbbfd40..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-headless.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.names.fullname" . }}-headless - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} - # Use this annotation in addition to the actual publishNotReadyAddresses - # field below because the annotation will stop being respected soon but the - # field is broken in some versions of Kubernetes: - # https://github.com/kubernetes/kubernetes/issues/58662 - service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" - namespace: {{ .Release.Namespace }} -spec: - type: ClusterIP - clusterIP: None - # We want all pods in the StatefulSet to have their addresses published for - # the sake of the other Postgresql pods even before they're ready, since they - # have to be able to talk to each other in order to become ready. - publishNotReadyAddresses: true - ports: - - name: tcp-postgresql - port: {{ template "postgresql.servicePort" . }} - targetPort: tcp-postgresql - selector: - {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read-set.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read-set.yaml deleted file mode 100644 index 63b410a..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read-set.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if and .Values.replication.enabled .Values.replication.uniqueServices }} -{{- $serviceAnnotations := coalesce .Values.readReplicas.service.annotations .Values.service.annotations -}} - -{{- $fullName := include "common.names.fullname" . }} -{{- $replicaCount := .Values.replication.readReplicas | int }} -{{- $root := . }} - -{{- range $i, $e := until $replicaCount }} -{{- $targetPod := printf "%s-read-%d" (printf "%s" $fullName) $i }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ $fullName }}-read-{{ $i }} - labels: - pod: {{ $targetPod }} - {{- include "common.labels.standard" $root | nindent 4 }} - {{- if $root.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $root.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - - {{- if $root.Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" $root.Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if $serviceAnnotations }} - {{- include "common.tplvalues.render" (dict "value" $serviceAnnotations "context" $) | nindent 4 }} - {{- end }} - namespace: {{ $root.Release.Namespace }} -spec: - type: ClusterIP - ports: - - name: tcp-postgresql - port: {{ template "postgresql.servicePort" $root }} - targetPort: tcp-postgresql - selector: - {{- include "common.labels.matchLabels" $root | nindent 4 }} - role: read - statefulset.kubernetes.io/pod-name: {{ $targetPod }} - -{{- end }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read.yaml deleted file mode 100644 index ed1005f..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc-read.yaml +++ /dev/null @@ -1,47 +0,0 @@ -{{- if and .Values.replication.enabled .Values.replication.singleService }} -{{- $serviceAnnotations := coalesce .Values.readReplicas.service.annotations .Values.service.annotations -}} -{{- $serviceType := coalesce .Values.readReplicas.service.type .Values.service.type -}} -{{- $serviceLoadBalancerIP := coalesce .Values.readReplicas.service.loadBalancerIP .Values.service.loadBalancerIP -}} -{{- $serviceLoadBalancerSourceRanges := coalesce .Values.readReplicas.service.loadBalancerSourceRanges .Values.service.loadBalancerSourceRanges -}} -{{- $serviceClusterIP := coalesce .Values.readReplicas.service.clusterIP .Values.service.clusterIP -}} -{{- $serviceNodePort := coalesce .Values.readReplicas.service.nodePort .Values.service.nodePort -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.names.fullname" . }}-read - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if $serviceAnnotations }} - {{- include "common.tplvalues.render" (dict "value" $serviceAnnotations "context" $) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - type: {{ $serviceType }} - {{- if and $serviceLoadBalancerIP (eq $serviceType "LoadBalancer") }} - loadBalancerIP: {{ $serviceLoadBalancerIP }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{- if and (eq $serviceType "LoadBalancer") $serviceLoadBalancerSourceRanges }} - loadBalancerSourceRanges: {{- include "common.tplvalues.render" (dict "value" $serviceLoadBalancerSourceRanges "context" $) | nindent 4 }} - {{- end }} - {{- if and (eq $serviceType "ClusterIP") $serviceClusterIP }} - clusterIP: {{ $serviceClusterIP }} - {{- end }} - ports: - - name: tcp-postgresql - port: {{ template "postgresql.servicePort" . }} - targetPort: tcp-postgresql - {{- if $serviceNodePort }} - nodePort: {{ $serviceNodePort }} - {{- end }} - selector: - {{- include "common.labels.matchLabels" . | nindent 4 }} - role: read -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc.yaml deleted file mode 100644 index a47efb9..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/svc.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- $serviceAnnotations := coalesce .Values.primary.service.annotations .Values.service.annotations -}} -{{- $serviceType := coalesce .Values.primary.service.type .Values.service.type -}} -{{- $serviceLoadBalancerIP := coalesce .Values.primary.service.loadBalancerIP .Values.service.loadBalancerIP -}} -{{- $serviceLoadBalancerSourceRanges := coalesce .Values.primary.service.loadBalancerSourceRanges .Values.service.loadBalancerSourceRanges -}} -{{- $serviceClusterIP := coalesce .Values.primary.service.clusterIP .Values.service.clusterIP -}} -{{- $serviceNodePort := coalesce .Values.primary.service.nodePort .Values.service.nodePort -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if $serviceAnnotations }} - {{- include "common.tplvalues.render" (dict "value" $serviceAnnotations "context" $) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - type: {{ $serviceType }} - {{- if and $serviceLoadBalancerIP (eq $serviceType "LoadBalancer") }} - loadBalancerIP: {{ $serviceLoadBalancerIP }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{- if and (eq $serviceType "LoadBalancer") $serviceLoadBalancerSourceRanges }} - loadBalancerSourceRanges: {{- include "common.tplvalues.render" (dict "value" $serviceLoadBalancerSourceRanges "context" $) | nindent 4 }} - {{- end }} - {{- if and (eq $serviceType "ClusterIP") $serviceClusterIP }} - clusterIP: {{ $serviceClusterIP }} - {{- end }} - ports: - - name: tcp-postgresql - port: {{ template "postgresql.servicePort" . }} - targetPort: tcp-postgresql - {{- if $serviceNodePort }} - nodePort: {{ $serviceNodePort }} - {{- end }} - selector: - {{- include "common.labels.matchLabels" . | nindent 4 }} - role: primary diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/tls-secrets.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/tls-secrets.yaml deleted file mode 100644 index a5944fc..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/templates/tls-secrets.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{{- if (include "postgresql.createTlsSecret" . ) }} -{{- $ca := genCA "postgresql-ca" 365 }} -{{- $fullname := include "common.names.fullname" . }} -{{- $releaseNamespace := .Release.Namespace }} -{{- $clusterDomain := .Values.clusterDomain }} -{{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) }} -{{- $altNames := list (printf "*.%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) $fullname }} -{{- $crt := genSignedCert $fullname nil $altNames 365 $ca }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ printf "%s-crt" (include "common.names.fullname" .) }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- 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 }} - {{- end }} -type: kubernetes.io/tls -data: - ca.crt: {{ $ca.Cert | b64enc | quote }} - tls.crt: {{ $crt.Cert | b64enc | quote }} - tls.key: {{ $crt.Key | b64enc | quote }} -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/values.schema.json b/manifests/helm/keycloak/18.4.0/charts/postgresql/values.schema.json deleted file mode 100644 index 66a2a9d..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/values.schema.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "$schema": "http://json-schema.org/schema#", - "type": "object", - "properties": { - "postgresqlUsername": { - "type": "string", - "title": "Admin user", - "form": true - }, - "postgresqlPassword": { - "type": "string", - "title": "Password", - "form": true - }, - "persistence": { - "type": "object", - "properties": { - "size": { - "type": "string", - "title": "Persistent Volume Size", - "form": true, - "render": "slider", - "sliderMin": 1, - "sliderMax": 100, - "sliderUnit": "Gi" - } - } - }, - "resources": { - "type": "object", - "title": "Required Resources", - "description": "Configure resource requests", - "form": true, - "properties": { - "requests": { - "type": "object", - "properties": { - "memory": { - "type": "string", - "form": true, - "render": "slider", - "title": "Memory Request", - "sliderMin": 10, - "sliderMax": 2048, - "sliderUnit": "Mi" - }, - "cpu": { - "type": "string", - "form": true, - "render": "slider", - "title": "CPU Request", - "sliderMin": 10, - "sliderMax": 2000, - "sliderUnit": "m" - } - } - } - } - }, - "replication": { - "type": "object", - "form": true, - "title": "Replication Details", - "properties": { - "enabled": { - "type": "boolean", - "title": "Enable Replication", - "form": true - }, - "readReplicas": { - "type": "integer", - "title": "read Replicas", - "form": true, - "hidden": { - "value": false, - "path": "replication/enabled" - } - } - } - }, - "volumePermissions": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "form": true, - "title": "Enable Init Containers", - "description": "Change the owner of the persist volume mountpoint to RunAsUser:fsGroup" - } - } - }, - "metrics": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "title": "Configure metrics exporter", - "form": true - } - } - } - } -} diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/values.yaml b/manifests/helm/keycloak/18.4.0/charts/postgresql/values.yaml deleted file mode 100644 index a6959a0..0000000 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/values.yaml +++ /dev/null @@ -1,1001 +0,0 @@ -## @section Global parameters -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass -## - -## @param global.imageRegistry Global Docker image registry -## @param global.imagePullSecrets Global Docker registry secret names as an array -## @param global.storageClass Global StorageClass for Persistent Volume(s) -## -global: - imageRegistry: "" - ## E.g. - ## imagePullSecrets: - ## - myRegistryKeySecretName - ## - imagePullSecrets: [] - storageClass: "" - ## @param global.postgresql.postgresqlDatabase PostgreSQL database (overrides `postgresqlDatabase`) - ## @param global.postgresql.postgresqlUsername PostgreSQL username (overrides `postgresqlUsername`) - ## @param global.postgresql.existingSecret Name of existing secret to use for PostgreSQL passwords (overrides `existingSecret`) - ## @param global.postgresql.postgresqlPassword PostgreSQL admin password (overrides `postgresqlPassword`) - ## @param global.postgresql.servicePort PostgreSQL port (overrides `service.port` - ## @param global.postgresql.replicationPassword Replication user password (overrides `replication.password`) - ## - postgresql: - postgresqlDatabase: "" - postgresqlUsername: "" - existingSecret: "" - postgresqlPassword: "" - servicePort: "" - replicationPassword: "" - -## @section Common parameters -## - -## @param nameOverride String to partially override common.names.fullname template (will maintain the release name) -## -nameOverride: "" -## @param fullnameOverride String to fully override common.names.fullname template -## -fullnameOverride: "" -## @param extraDeploy Array of extra objects to deploy with the release (evaluated as a template) -## -extraDeploy: [] -## @param commonLabels Add labels to all the deployed resources -## -commonLabels: {} -## @param commonAnnotations Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Enable diagnostic mode in the deployment -## -diagnosticMode: - ## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden) - ## - enabled: false - ## @param diagnosticMode.command Command to override all containers in the deployment - ## - command: - - sleep - ## @param diagnosticMode.args Args to override all containers in the deployment - ## - args: - - infinity - -## @section PostgreSQL parameters -## - -## Bitnami PostgreSQL image version -## ref: https://hub.docker.com/r/bitnami/postgresql/tags/ -## @param image.registry PostgreSQL image registry -## @param image.repository PostgreSQL image repository -## @param image.tag PostgreSQL image tag (immutable tags are recommended) -## @param image.pullPolicy PostgreSQL image pull policy -## @param image.pullSecrets Specify image pull secrets -## @param image.debug Specify if debug values should be set -## -image: - registry: docker.io - repository: bitnamilegacy/postgresql - tag: 11.14.0-debian-10-r28 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: IfNotPresent - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## Example: - ## pullSecrets: - ## - myRegistryKeySecretName - ## - pullSecrets: [] - ## Set to true if you would like to see extra information on logs - ## It turns BASH and/or NAMI debugging in the image - ## - debug: false -## Init containers parameters: -## volumePermissions: Change the owner of the persist volume mountpoint to RunAsUser:fsGroup -## -volumePermissions: - ## @param volumePermissions.enabled Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) - ## - enabled: false - ## @param volumePermissions.image.registry Init container volume-permissions image registry - ## @param volumePermissions.image.repository Init container volume-permissions image repository - ## @param volumePermissions.image.tag Init container volume-permissions image tag (immutable tags are recommended) - ## @param volumePermissions.image.pullPolicy Init container volume-permissions image pull policy - ## @param volumePermissions.image.pullSecrets Init container volume-permissions image pull secrets - ## - image: - registry: docker.io - repository: bitnamilegacy/bitnami-shell - tag: 10-debian-10-r305 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: IfNotPresent - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## Example: - ## pullSecrets: - ## - myRegistryKeySecretName - ## - pullSecrets: [] - ## Init container Security Context - ## @param volumePermissions.securityContext.runAsUser User ID for the init container - ## Note: the chown of the data folder is done to securityContext.runAsUser - ## and not the below volumePermissions.securityContext.runAsUser - ## When runAsUser is set to special value "auto", init container will try to chwon the - ## data folder to autodetermined user&group, using commands: `id -u`:`id -G | cut -d" " -f2` - ## "auto" is especially useful for OpenShift which has scc with dynamic userids (and 0 is not allowed). - ## You may want to use this volumePermissions.securityContext.runAsUser="auto" in combination with - ## pod securityContext.enabled=false and shmVolume.chmod.enabled=false - ## - securityContext: - runAsUser: 0 -## @param schedulerName Use an alternate scheduler, e.g. "stork". -## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ -## -schedulerName: "" -## @param lifecycleHooks for the PostgreSQL container to automate configuration before or after startup -## -lifecycleHooks: {} -## Pod Security Context -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ -## @param securityContext.enabled Enable security context -## @param securityContext.fsGroup Group ID for the pod -## -securityContext: - enabled: true - fsGroup: 1001 -## Container Security Context -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ -## @param containerSecurityContext.enabled Enable container security context -## @param containerSecurityContext.runAsUser User ID for the container -## -containerSecurityContext: - enabled: true - runAsUser: 1001 -## Pod Service Account -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ -## -serviceAccount: - ## @param serviceAccount.enabled Enable service account (Note: Service Account will only be automatically created if `serviceAccount.name` is not set) - ## - enabled: false - ## @param serviceAccount.name Name of an already existing service account. Setting this value disables the automatic service account creation - ## - name: "" - ## @param serviceAccount.autoMount Auto-mount the service account token in the pod - ## - autoMount: false -## Pod Security Policy -## ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ -## @param psp.create Whether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or later -## -psp: - create: false -## Creates role for ServiceAccount -## Required for PSP -## @param rbac.create Create Role and RoleBinding (required for PSP to work) -## -rbac: - create: false -## @param replication.enabled Enable replication -## @param replication.user Replication user -## @param replication.password Replication user password -## @param replication.readReplicas Number of read replicas replicas -## @param replication.synchronousCommit Set synchronous commit mode. Allowed values: `on`, `remote_apply`, `remote_write`, `local` and `off` -## @param replication.numSynchronousReplicas Number of replicas that will have synchronous replication. Note: Cannot be greater than `replication.readReplicas`. -## @param replication.applicationName Cluster application name. Useful for advanced replication settings -## @param replication.singleService Create one service connecting to all read-replicas -## @param replication.uniqueServices Create a unique service for each independent read-replica -## -replication: - enabled: false - user: repl_user - password: repl_password - readReplicas: 1 - ## ref: https://www.postgresql.org/docs/9.6/runtime-config-wal.html#GUC-WAL-LEVEL - ## - synchronousCommit: "off" - ## NOTE: It cannot be > readReplicas - ## - numSynchronousReplicas: 0 - applicationName: my_application - singleService: true - uniqueServices: false -## @param postgresqlPostgresPassword PostgreSQL admin password (used when `postgresqlUsername` is not `postgres`, in which case`postgres` is the admin username) -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md#creating-a-database-user-on-first-run (see note!) -## -postgresqlPostgresPassword: "" -## @param postgresqlUsername PostgreSQL user (has superuser privileges if username is `postgres`) -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md#setting-the-root-password-on-first-run -## -postgresqlUsername: postgres -## @param postgresqlPassword PostgreSQL user password -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md#setting-the-root-password-on-first-run -## -postgresqlPassword: "" -## @param existingSecret Name of existing secret to use for PostgreSQL passwords -## The secret has to contain the keys postgresql-password which is the password for postgresqlUsername when it is -## different of postgres, postgresql-postgres-password which will override postgresqlPassword, -## postgresql-replication-password which will override replication.password and postgresql-ldap-password which will be -## used to authenticate on LDAP. The value is evaluated as a template. -## e.g: -## existingSecret: secret -## -existingSecret: "" -## @param usePasswordFile Mount PostgreSQL secret as a file instead of passing environment variable -## -usePasswordFile: false -## @param postgresqlDatabase PostgreSQL database -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md#creating-a-database-on-first-run -## -postgresqlDatabase: "" -## @param postgresqlDataDir PostgreSQL data dir folder -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md -## -postgresqlDataDir: /bitnami/postgresql/data -## @param extraEnv An array to add extra environment variables -## For example: -## extraEnv: -## - name: FOO -## value: "bar" -## -extraEnv: [] -## @param extraEnvVarsCM Name of a Config Map containing extra environment variables -## -extraEnvVarsCM: "" -## @param postgresqlInitdbArgs PostgreSQL initdb extra arguments -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md -## -postgresqlInitdbArgs: "" -## @param postgresqlInitdbWalDir Specify a custom location for the PostgreSQL transaction log -## ref: https://github.com/bitnami/bitnami-docker-postgresql/blob/master/README.md -## -postgresqlInitdbWalDir: "" -## @param postgresqlConfiguration PostgreSQL configuration -## Specify runtime configuration parameters as a dict, using camelCase, e.g. -## {"sharedBuffers": "500MB"} -## Alternatively, you can put your postgresql.conf under the files/ directory -## ref: https://www.postgresql.org/docs/current/static/runtime-config.html -## -postgresqlConfiguration: {} -## @param postgresqlExtendedConf Extended Runtime Config Parameters (appended to main or default configuration) -## Alternatively, you can put your *.conf under the files/conf.d/ directory -## https://github.com/bitnami/bitnami-docker-postgresql#allow-settings-to-be-loaded-from-files-other-than-the-default-postgresqlconf -## -postgresqlExtendedConf: {} -## Configure current cluster's primary server to be the standby server in other cluster. -## This will allow cross cluster replication and provide cross cluster high availability. -## You will need to configure pgHbaConfiguration if you want to enable this feature with local cluster replication enabled. -## @param primaryAsStandBy.enabled Whether to enable current cluster's primary as standby server of another cluster or not -## @param primaryAsStandBy.primaryHost The Host of replication primary in the other cluster -## @param primaryAsStandBy.primaryPort The Port of replication primary in the other cluster -## -primaryAsStandBy: - enabled: false - primaryHost: "" - primaryPort: "" -## @param pgHbaConfiguration PostgreSQL client authentication configuration -## Specify content for pg_hba.conf -## Default: do not create pg_hba.conf -## Alternatively, you can put your pg_hba.conf under the files/ directory -## pgHbaConfiguration: |- -## local all all trust -## host all all localhost trust -## host mydatabase mysuser 192.168.0.0/24 md5 -## -pgHbaConfiguration: "" -## @param configurationConfigMap ConfigMap with PostgreSQL configuration -## NOTE: This will override postgresqlConfiguration and pgHbaConfiguration -## -configurationConfigMap: "" -## @param extendedConfConfigMap ConfigMap with PostgreSQL extended configuration -## -extendedConfConfigMap: "" -## @param initdbScripts Dictionary of initdb scripts -## Specify dictionary of scripts to be run at first boot -## Alternatively, you can put your scripts under the files/docker-entrypoint-initdb.d directory -## e.g: -## initdbScripts: -## my_init_script.sh: | -## #!/bin/sh -## echo "Do something." -## -initdbScripts: {} -## @param initdbScriptsConfigMap ConfigMap with scripts to be run at first boot -## NOTE: This will override initdbScripts -## -initdbScriptsConfigMap: "" -## @param initdbScriptsSecret Secret with scripts to be run at first boot (in case it contains sensitive information) -## NOTE: This can work along initdbScripts or initdbScriptsConfigMap -## -initdbScriptsSecret: "" -## @param initdbUser Specify the PostgreSQL username to execute the initdb scripts -## -initdbUser: "" -## @param initdbPassword Specify the PostgreSQL password to execute the initdb scripts -## -initdbPassword: "" - -## @param containerPorts.postgresql PostgreSQL container port -## -containerPorts: - postgresql: 5432 -## Audit settings -## https://github.com/bitnami/bitnami-docker-postgresql#auditing -## -audit: - ## @param audit.logHostname Log client hostnames - ## - logHostname: false - ## @param audit.logConnections Add client log-in operations to the log file - ## - logConnections: false - ## @param audit.logDisconnections Add client log-outs operations to the log file - ## - logDisconnections: false - ## @param audit.pgAuditLog Add operations to log using the pgAudit extension - ## - pgAuditLog: "" - ## @param audit.pgAuditLogCatalog Log catalog using pgAudit - ## - pgAuditLogCatalog: "off" - ## @param audit.clientMinMessages Message log level to share with the user - ## - clientMinMessages: error - ## @param audit.logLinePrefix Template for log line prefix (default if not set) - ## - logLinePrefix: "" - ## @param audit.logTimezone Timezone for the log timestamps - ## - logTimezone: "" -## @param postgresqlSharedPreloadLibraries Shared preload libraries (comma-separated list) -## -postgresqlSharedPreloadLibraries: "pgaudit" -## @param postgresqlMaxConnections Maximum total connections -## -postgresqlMaxConnections: "" -## @param postgresqlPostgresConnectionLimit Maximum connections for the postgres user -## -postgresqlPostgresConnectionLimit: "" -## @param postgresqlDbUserConnectionLimit Maximum connections for the non-admin user -## -postgresqlDbUserConnectionLimit: "" -## @param postgresqlTcpKeepalivesInterval TCP keepalives interval -## -postgresqlTcpKeepalivesInterval: "" -## @param postgresqlTcpKeepalivesIdle TCP keepalives idle -## -postgresqlTcpKeepalivesIdle: "" -## @param postgresqlTcpKeepalivesCount TCP keepalives count -## -postgresqlTcpKeepalivesCount: "" -## @param postgresqlStatementTimeout Statement timeout -## -postgresqlStatementTimeout: "" -## @param postgresqlPghbaRemoveFilters Comma-separated list of patterns to remove from the pg_hba.conf file -## Cannot be used with custom pg_hba.conf -## -postgresqlPghbaRemoveFilters: "" -## @param terminationGracePeriodSeconds Seconds the pod needs to terminate gracefully -## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods -## e.g: -## terminationGracePeriodSeconds: 30 -## -terminationGracePeriodSeconds: "" -## LDAP configuration -## @param ldap.enabled Enable LDAP support -## @param ldap.url LDAP URL beginning in the form `ldap[s]://host[:port]/basedn` -## @param ldap.server IP address or name of the LDAP server. -## @param ldap.port Port number on the LDAP server to connect to -## @param ldap.prefix String to prepend to the user name when forming the DN to bind -## @param ldap.suffix String to append to the user name when forming the DN to bind -## @param ldap.baseDN Root DN to begin the search for the user in -## @param ldap.bindDN DN of user to bind to LDAP -## @param ldap.bind_password Password for the user to bind to LDAP -## @param ldap.search_attr Attribute to match against the user name in the search -## @param ldap.search_filter The search filter to use when doing search+bind authentication -## @param ldap.scheme Set to `ldaps` to use LDAPS -## @param ldap.tls Set to `1` to use TLS encryption -## -ldap: - enabled: false - url: "" - server: "" - port: "" - prefix: "" - suffix: "" - baseDN: "" - bindDN: "" - bind_password: "" - search_attr: "" - search_filter: "" - scheme: "" - tls: "" -## PostgreSQL service configuration -## -service: - ## @param service.type Kubernetes Service type - ## - type: ClusterIP - ## @param service.clusterIP Static clusterIP or None for headless services - ## e.g: - ## clusterIP: None - ## - clusterIP: "" - ## @param service.port PostgreSQL port - ## - port: 5432 - ## @param service.nodePort Specify the nodePort value for the LoadBalancer and NodePort service types - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - ## - nodePort: "" - ## @param service.annotations Annotations for PostgreSQL service - ## - annotations: {} - ## @param service.loadBalancerIP Load balancer IP if service type is `LoadBalancer` - ## Set the LoadBalancer service type to internal only - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer - ## - loadBalancerIP: "" - ## @param service.externalTrafficPolicy Enable client source IP preservation - ## ref https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - ## @param service.loadBalancerSourceRanges Addresses that are allowed when service is LoadBalancer - ## https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service - ## - ## loadBalancerSourceRanges: - ## - 10.10.10.0/24 - ## - loadBalancerSourceRanges: [] -## Start primary and read(s) pod(s) without limitations on shm memory. -## By default docker and containerd (and possibly other container runtimes) -## limit `/dev/shm` to `64M` (see e.g. the -## [docker issue](https://github.com/docker-library/postgres/issues/416) and the -## [containerd issue](https://github.com/containerd/containerd/issues/3654), -## which could be not enough if PostgreSQL uses parallel workers heavily. -## -shmVolume: - ## @param shmVolume.enabled Enable emptyDir volume for /dev/shm for primary and read replica(s) Pod(s) - ## Set `shmVolume.enabled` to `true` to mount a new tmpfs volume to remove the above limitation. - ## - enabled: true - ## @param shmVolume.chmod.enabled Set to `true` to `chmod 777 /dev/shm` on a initContainer (ignored if `volumePermissions.enabled` is `false`) - ## - chmod: - enabled: true - ## @param shmVolume.sizeLimit Set this to enable a size limit on the shm tmpfs. Note that the size of the tmpfs counts against container's memory limit - ## e.g: - ## sizeLimit: 1Gi - ## - sizeLimit: "" -persistence: - ## @param persistence.enabled Enable persistence using PVC - ## - enabled: true - ## @param persistence.existingClaim Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. - ## If defined, PVC must be created manually before volume will be bound - ## The value is evaluated as a template, so, for example, the name can depend on .Release or .Chart - ## - existingClaim: "" - ## @param persistence.mountPath The path the volume will be mounted at, useful when using different - ## PostgreSQL images. - ## - mountPath: /bitnami/postgresql - ## @param persistence.subPath The subdirectory of the volume to mount to - ## Useful in dev environments and one PV for multiple services - ## - subPath: "" - ## @param persistence.storageClass PVC Storage Class for PostgreSQL volume - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - storageClass: "" - ## @param persistence.accessModes PVC Access Mode for PostgreSQL volume - ## - accessModes: - - ReadWriteOnce - ## @param persistence.snapshotName Provide a VolumeSnapshot name which to create the PVC - ## The same snapshot will be used for the primary and any read replicas - ## ref: https://kubernetes.io/docs/concepts/storage/volume-snapshots/ - ## - snapshotName: "" - ## @param persistence.size PVC Storage Request for PostgreSQL volume - ## - size: 8Gi - ## @param persistence.annotations Annotations for the PVC - ## - annotations: {} - ## @param persistence.selector Selector to match an existing Persistent Volume (this value is evaluated as a template) - ## selector: - ## matchLabels: - ## app: my-app - ## - selector: {} -## @param updateStrategy.type updateStrategy for PostgreSQL StatefulSet and its reads StatefulSets -## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies -## -updateStrategy: - type: RollingUpdate -## -## PostgreSQL Primary parameters -## -primary: - ## @param primary.podAffinityPreset PostgreSQL primary pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` - ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity - ## - podAffinityPreset: "" - ## @param primary.podAntiAffinityPreset PostgreSQL primary pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` - ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity - ## - podAntiAffinityPreset: soft - ## PostgreSQL Primary node affinity preset - ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity - ## - nodeAffinityPreset: - ## @param primary.nodeAffinityPreset.type PostgreSQL primary node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` - ## - type: "" - ## @param primary.nodeAffinityPreset.key PostgreSQL primary node label key to match Ignored if `primary.affinity` is set. - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## @param primary.nodeAffinityPreset.values PostgreSQL primary node label values to match. Ignored if `primary.affinity` is set. - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - ## @param primary.affinity Affinity for PostgreSQL primary pods assignment - ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity - ## Note: primary.podAffinityPreset, primary.podAntiAffinityPreset, and primary.nodeAffinityPreset will be ignored when it's set - ## - affinity: {} - ## @param primary.nodeSelector Node labels for PostgreSQL primary pods assignment - ## ref: https://kubernetes.io/docs/user-guide/node-selection/ - ## - nodeSelector: {} - ## @param primary.tolerations Tolerations for PostgreSQL primary pods assignment - ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - ## - tolerations: [] - ## @param primary.extraPodSpec Optionally specify extra PodSpec - ## - extraPodSpec: {} - ## @param primary.labels Map of labels to add to the statefulset (postgresql primary) - ## - labels: {} - ## @param primary.annotations Annotations for PostgreSQL primary pods - ## - annotations: {} - ## @param primary.podLabels Map of labels to add to the pods (postgresql primary) - ## - podLabels: {} - ## @param primary.podAnnotations Map of annotations to add to the pods (postgresql primary) - ## - podAnnotations: {} - ## @param primary.priorityClassName Priority Class to use for each pod (postgresql primary) - ## - priorityClassName: "" - ## @param primary.extraInitContainers Extra init containers to add to the pods (postgresql primary) - ## Example - ## - ## extraInitContainers: - ## - name: do-something - ## image: busybox - ## command: ['do', 'something'] - ## - extraInitContainers: [] - ## @param primary.extraVolumeMounts Extra volume mounts to add to the pods (postgresql primary) - ## - extraVolumeMounts: [] - ## @param primary.extraVolumes Extra volumes to add to the pods (postgresql primary) - ## - extraVolumes: [] - ## @param primary.sidecars Extra containers to the pod - ## For example: - ## sidecars: - ## - name: your-image-name - ## image: your-image - ## imagePullPolicy: Always - ## ports: - ## - name: portname - ## containerPort: 1234 - ## - sidecars: [] - ## Override the service configuration for primary - ## @param primary.service.type Allows using a different service type for primary - ## @param primary.service.nodePort Allows using a different nodePort for primary - ## @param primary.service.clusterIP Allows using a different clusterIP for primary - ## - service: - type: "" - nodePort: "" - clusterIP: "" -## PostgreSQL read only replica parameters -## -readReplicas: - ## @param readReplicas.podAffinityPreset PostgreSQL read only pod affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` - ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity - ## - podAffinityPreset: "" - ## @param readReplicas.podAntiAffinityPreset PostgreSQL read only pod anti-affinity preset. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` - ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity - ## - podAntiAffinityPreset: soft - ## PostgreSQL read only node affinity preset - ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity - ## - nodeAffinityPreset: - ## @param readReplicas.nodeAffinityPreset.type PostgreSQL read only node affinity preset type. Ignored if `primary.affinity` is set. Allowed values: `soft` or `hard` - ## - type: "" - ## @param readReplicas.nodeAffinityPreset.key PostgreSQL read only node label key to match Ignored if `primary.affinity` is set. - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## @param readReplicas.nodeAffinityPreset.values PostgreSQL read only node label values to match. Ignored if `primary.affinity` is set. - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - ## @param readReplicas.affinity Affinity for PostgreSQL read only pods assignment - ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity - ## Note: readReplicas.podAffinityPreset, readReplicas.podAntiAffinityPreset, and readReplicas.nodeAffinityPreset will be ignored when it's set - ## - affinity: {} - ## @param readReplicas.nodeSelector Node labels for PostgreSQL read only pods assignment - ## ref: https://kubernetes.io/docs/user-guide/node-selection/ - ## - nodeSelector: {} - ## @param readReplicas.tolerations Tolerations for PostgreSQL read only pods assignment - ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - ## - tolerations: [] - ## @param readReplicas.topologySpreadConstraints Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template - ## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods - ## - topologySpreadConstraints: [] - ## @param readReplicas.extraPodSpec Optionally specify extra PodSpec - ## - extraPodSpec: {} - ## @param readReplicas.labels Map of labels to add to the statefulsets (postgresql readReplicas) - ## - labels: {} - ## @param readReplicas.annotations Annotations for PostgreSQL read only pods - ## - annotations: {} - ## @param readReplicas.podLabels Map of labels to add to the pods (postgresql readReplicas) - ## - podLabels: {} - ## @param readReplicas.podAnnotations Map of annotations to add to the pods (postgresql readReplicas) - ## - podAnnotations: {} - ## @param readReplicas.priorityClassName Priority Class to use for each pod (postgresql readReplicas) - ## - priorityClassName: "" - ## @param readReplicas.extraInitContainers Extra init containers to add to the pods (postgresql readReplicas) - ## Example - ## - ## extraInitContainers: - ## - name: do-something - ## image: busybox - ## command: ['do', 'something'] - ## - extraInitContainers: [] - ## @param readReplicas.extraVolumeMounts Extra volume mounts to add to the pods (postgresql readReplicas) - ## - extraVolumeMounts: [] - ## @param readReplicas.extraVolumes Extra volumes to add to the pods (postgresql readReplicas) - ## - extraVolumes: [] - ## @param readReplicas.sidecars Extra containers to the pod - ## - ## For example: - ## sidecars: - ## - name: your-image-name - ## image: your-image - ## imagePullPolicy: Always - ## ports: - ## - name: portname - ## containerPort: 1234 - ## - sidecars: [] - ## Override the service configuration for read - ## @param readReplicas.service.type Allows using a different service type for readReplicas - ## @param readReplicas.service.nodePort Allows using a different nodePort for readReplicas - ## @param readReplicas.service.clusterIP Allows using a different clusterIP for readReplicas - ## - service: - type: "" - nodePort: "" - clusterIP: "" - ## @param readReplicas.persistence.enabled Whether to enable PostgreSQL read replicas replicas persistence - ## - persistence: - enabled: true - ## @param readReplicas.resources CPU/Memory resource requests/limits override for readReplicass. Will fallback to `values.resources` if not defined. - ## - resources: {} -## Configure resource requests and limits -## ref: https://kubernetes.io/docs/user-guide/compute-resources/ -## @param resources.requests [object] The requested resources for the container -## -resources: - requests: - memory: 256Mi - cpu: 250m -networkPolicy: - ## @param networkPolicy.enabled Enable creation of NetworkPolicy resources. Only Ingress traffic is filtered for now. - ## - enabled: false - ## @param networkPolicy.allowExternal Don't require client label for connections - ## The Policy model to apply. When set to false, only pods with the correct - ## client label will have network access to the port PostgreSQL is listening - ## on. When true, PostgreSQL will accept connections from any source - ## (with the correct destination port). - ## - allowExternal: true - ## @param networkPolicy.explicitNamespacesSelector A Kubernetes LabelSelector to explicitly select namespaces from which ingress traffic could be allowed - ## If explicitNamespacesSelector is missing or set to {}, only client Pods that are in the networkPolicy's namespace - ## and that match other criteria, the ones that have the good label, can reach the DB. - ## But sometimes, we want the DB to be accessible to clients from other namespaces, in this case, we can use this - ## LabelSelector to select these namespaces, note that the networkPolicy's namespace should also be explicitly added. - ## - ## Example: - ## explicitNamespacesSelector: - ## matchLabels: - ## role: frontend - ## matchExpressions: - ## - {key: role, operator: In, values: [frontend]} - ## - explicitNamespacesSelector: {} -## Configure extra options for startup probe -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes -## @param startupProbe.enabled Enable startupProbe -## @param startupProbe.initialDelaySeconds Initial delay seconds for startupProbe -## @param startupProbe.periodSeconds Period seconds for startupProbe -## @param startupProbe.timeoutSeconds Timeout seconds for startupProbe -## @param startupProbe.failureThreshold Failure threshold for startupProbe -## @param startupProbe.successThreshold Success threshold for startupProbe -## -startupProbe: - enabled: false - initialDelaySeconds: 30 - periodSeconds: 15 - timeoutSeconds: 5 - failureThreshold: 10 - successThreshold: 1 -## Configure extra options for liveness probe -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes -## @param livenessProbe.enabled Enable livenessProbe -## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe -## @param livenessProbe.periodSeconds Period seconds for livenessProbe -## @param livenessProbe.timeoutSeconds Timeout seconds for livenessProbe -## @param livenessProbe.failureThreshold Failure threshold for livenessProbe -## @param livenessProbe.successThreshold Success threshold for livenessProbe -## -livenessProbe: - enabled: true - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 -## Configure extra options for readiness probe -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## @param readinessProbe.enabled Enable readinessProbe -## @param readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe -## @param readinessProbe.periodSeconds Period seconds for readinessProbe -## @param readinessProbe.timeoutSeconds Timeout seconds for readinessProbe -## @param readinessProbe.failureThreshold Failure threshold for readinessProbe -## @param readinessProbe.successThreshold Success threshold for readinessProbe -## -readinessProbe: - enabled: true - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 -## @param customStartupProbe Override default startup probe -## -customStartupProbe: {} -## @param customLivenessProbe Override default liveness probe -## -customLivenessProbe: {} -## @param customReadinessProbe Override default readiness probe -## -customReadinessProbe: {} -## -## TLS configuration -## -tls: - ## @param tls.enabled Enable TLS traffic support - ## - enabled: false - ## @param tls.autoGenerated Generate automatically self-signed TLS certificates - ## - autoGenerated: false - ## @param tls.preferServerCiphers Whether to use the server's TLS cipher preferences rather than the client's - ## - preferServerCiphers: true - ## @param tls.certificatesSecret Name of an existing secret that contains the certificates - ## - certificatesSecret: "" - ## @param tls.certFilename Certificate filename - ## - certFilename: "" - ## @param tls.certKeyFilename Certificate key filename - ## - certKeyFilename: "" - ## @param tls.certCAFilename CA Certificate filename - ## If provided, PostgreSQL will authenticate TLS/SSL clients by requesting them a certificate - ## ref: https://www.postgresql.org/docs/9.6/auth-methods.html - ## - certCAFilename: "" - ## @param tls.crlFilename File containing a Certificate Revocation List - ## - crlFilename: "" -## Configure metrics exporter -## -metrics: - ## @param metrics.enabled Start a prometheus exporter - ## - enabled: false - ## @param metrics.resources Prometheus exporter container resources - ## - resources: {} - ## @param metrics.service.type Kubernetes Service type - ## @param metrics.service.annotations [object] Additional annotations for metrics exporter pod - ## @param metrics.service.loadBalancerIP loadBalancerIP if redis metrics service type is `LoadBalancer` - ## - service: - type: ClusterIP - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "9187" - loadBalancerIP: "" - ## @param metrics.serviceMonitor.enabled Set this to `true` to create ServiceMonitor for Prometheus operator - ## @param metrics.serviceMonitor.additionalLabels Additional labels that can be used so ServiceMonitor will be discovered by Prometheus - ## @param metrics.serviceMonitor.namespace Optional namespace in which to create ServiceMonitor - ## @param metrics.serviceMonitor.interval Scrape interval. If not set, the Prometheus default scrape interval is used - ## @param metrics.serviceMonitor.scrapeTimeout Scrape timeout. If not set, the Prometheus default scrape timeout is used - ## @param metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping - ## @param metrics.serviceMonitor.metricRelabelings MetricRelabelConfigs to apply to samples before ingestion - ## - serviceMonitor: - enabled: false - additionalLabels: {} - namespace: "" - interval: "" - scrapeTimeout: "" - relabelings: [] - metricRelabelings: [] - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - ## @param metrics.prometheusRule.enabled Set this to true to create prometheusRules for Prometheus operator - ## - enabled: false - ## @param metrics.prometheusRule.additionalLabels Additional labels that can be used so prometheusRules will be discovered by Prometheus - ## - additionalLabels: {} - ## @param metrics.prometheusRule.namespace namespace where prometheusRules resource should be created - ## - namespace: "" - ## @param metrics.prometheusRule.rules Create specified [Rules](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) - ## Make sure to constraint the rules to the current postgresql service. - ## rules: - ## - alert: HugeReplicationLag - ## expr: pg_replication_lag{service="{{ template "common.names.fullname" . }}-metrics"} / 3600 > 1 - ## for: 1m - ## labels: - ## severity: critical - ## annotations: - ## description: replication for {{ template "common.names.fullname" . }} PostgreSQL is lagging by {{ "{{ $value }}" }} hour(s). - ## summary: PostgreSQL replication is lagging by {{ "{{ $value }}" }} hour(s). - ## - rules: [] - ## @param metrics.image.registry PostgreSQL Exporter image registry - ## @param metrics.image.repository PostgreSQL Exporter image repository - ## @param metrics.image.tag PostgreSQL Exporter image tag (immutable tags are recommended) - ## @param metrics.image.pullPolicy PostgreSQL Exporter image pull policy - ## @param metrics.image.pullSecrets Specify image pull secrets - ## - image: - registry: docker.io - repository: bitnamilegacy/postgres-exporter - tag: 0.10.0-debian-10-r172 - pullPolicy: IfNotPresent - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## Example: - ## pullSecrets: - ## - myRegistryKeySecretName - ## - pullSecrets: [] - ## @param metrics.customMetrics Define additional custom metrics - ## ref: https://github.com/wrouesnel/postgres_exporter#adding-new-metrics-via-a-config-file - ## customMetrics: - ## pg_database: - ## query: "SELECT d.datname AS name, CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT') THEN pg_catalog.pg_database_size(d.datname) ELSE 0 END AS size_bytes FROM pg_catalog.pg_database d where datname not in ('template0', 'template1', 'postgres')" - ## metrics: - ## - name: - ## usage: "LABEL" - ## description: "Name of the database" - ## - size_bytes: - ## usage: "GAUGE" - ## description: "Size of the database in bytes" - ## - customMetrics: {} - ## @param metrics.extraEnvVars Extra environment variables to add to postgres-exporter - ## see: https://github.com/wrouesnel/postgres_exporter#environment-variables - ## For example: - ## extraEnvVars: - ## - name: PG_EXPORTER_DISABLE_DEFAULT_METRICS - ## value: "true" - ## - extraEnvVars: [] - ## Pod Security Context - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - ## @param metrics.securityContext.enabled Enable security context for metrics - ## @param metrics.securityContext.runAsUser User ID for the container for metrics - ## - securityContext: - enabled: false - runAsUser: 1001 - ## Configure extra options for liveness probe - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes - ## @param metrics.livenessProbe.enabled Enable livenessProbe - ## @param metrics.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe - ## @param metrics.livenessProbe.periodSeconds Period seconds for livenessProbe - ## @param metrics.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe - ## @param metrics.livenessProbe.failureThreshold Failure threshold for livenessProbe - ## @param metrics.livenessProbe.successThreshold Success threshold for livenessProbe - ## - livenessProbe: - enabled: true - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - ## Configure extra options for readiness probe - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes - ## @param metrics.readinessProbe.enabled Enable readinessProbe - ## @param metrics.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe - ## @param metrics.readinessProbe.periodSeconds Period seconds for readinessProbe - ## @param metrics.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe - ## @param metrics.readinessProbe.failureThreshold Failure threshold for readinessProbe - ## @param metrics.readinessProbe.successThreshold Success threshold for readinessProbe - ## - readinessProbe: - enabled: true - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 diff --git a/manifests/helm/keycloak/18.4.0/ci/h2-and-ingress-values.yaml b/manifests/helm/keycloak/18.4.0/ci/h2-and-ingress-values.yaml deleted file mode 100644 index f61f15c..0000000 --- a/manifests/helm/keycloak/18.4.0/ci/h2-and-ingress-values.yaml +++ /dev/null @@ -1,75 +0,0 @@ -extraEnv: | - - name: DB_VENDOR - value: h2 - - name: KEYCLOAK_USER_FILE - value: /secrets/admin-creds/user - - name: KEYCLOAK_PASSWORD_FILE - value: /secrets/admin-creds/password - - name: JAVA_OPTS - value: >- - -XX:+UseContainerSupport - -XX:MaxRAMPercentage=50.0 - -Djava.net.preferIPv4Stack=true - -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS - -Djava.awt.headless=true - -secrets: - admin-creds: - annotations: - my-test-annotation: Test secret for {{ include "keycloak.fullname" . }} - stringData: - user: admin - password: secret - -extraVolumeMounts: | - - name: admin-creds - mountPath: /secrets/admin-creds - readOnly: true - -extraVolumes: | - - name: admin-creds - secret: - secretName: '{{ include "keycloak.fullname" . }}-admin-creds' - -postgresql: - enabled: false - - -ingress: - enabled: true - annotations: - test-annotation1: annotationValue1 - test-annotation2: annotationValue2 - labels: - test-label1: labelValue1 - test-label2: labelValue2 - # List of rules for the Ingress - rules: - - - # Ingress host - host: '{{ .Release.Name }}.keycloak.example.com' - # Paths for the host - paths: - - path: / - pathType: Prefix - # TLS configuration - - console: - enabled: true - annotations: - test-annotation1: annotationValue1 - test-annotation2: annotationValue2 - labels: - test-label1: labelValue1 - test-label2: labelValue2 - ingressClassName: "" - rules: - - - host: '{{ .Release.Name }}.keycloak.example.com' - # Paths for the host - paths: - - path: /auth/admin/ - pathType: Prefix - -test: - enabled: true diff --git a/manifests/helm/keycloak/18.4.0/ci/postgres-ha-values.yaml b/manifests/helm/keycloak/18.4.0/ci/postgres-ha-values.yaml deleted file mode 100644 index e92c2c7..0000000 --- a/manifests/helm/keycloak/18.4.0/ci/postgres-ha-values.yaml +++ /dev/null @@ -1,73 +0,0 @@ -replicas: 2 - -podLabels: - test-label: test-label-value - -podAnnotations: - test-annotation: test-annotation-value-{{ .Release.Name }} - test-int-annotation: "12345" - -startupScripts: - hello.sh: | - #!/bin/sh - - echo '********************************************************************************' - echo '* *' - echo '* Hello from my startup script! *' - echo '* *' - echo '********************************************************************************' - -lifecycleHooks: | - postStart: - exec: - command: - - /bin/sh - - -c - - echo 'Hello from lifecycle hook!' - -extraEnv: | - - name: JGROUPS_DISCOVERY_PROTOCOL - value: dns.DNS_PING - - name: JGROUPS_DISCOVERY_PROPERTIES - value: 'dns_query={{ include "keycloak.serviceDnsName" . }}' - - name: CACHE_OWNERS_COUNT - value: "2" - - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - value: "2" - - name: KEYCLOAK_USER_FILE - value: /secrets/admin-creds/user - - name: KEYCLOAK_PASSWORD_FILE - value: /secrets/admin-creds/password - - name: KEYCLOAK_STATISTICS - value: all - - name: JAVA_OPTS - value: >- - -XX:+UseContainerSupport - -XX:MaxRAMPercentage=50.0 - -Djava.net.preferIPv4Stack=true - -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS - -Djava.awt.headless=true - -secrets: - admin-creds: - stringData: - user: admin - password: secret - -extraVolumeMounts: | - - name: admin-creds - mountPath: /secrets/admin-creds - readOnly: true - -extraVolumes: | - - name: admin-creds - secret: - secretName: '{{ include "keycloak.fullname" . }}-admin-creds' - -postgresql: - enabled: true - persistence: - enabled: true - -test: - enabled: true diff --git a/manifests/helm/keycloak/18.4.0/custom-values.yaml b/manifests/helm/keycloak/18.4.0/custom-values.yaml deleted file mode 100644 index 0e6728b..0000000 --- a/manifests/helm/keycloak/18.4.0/custom-values.yaml +++ /dev/null @@ -1,105 +0,0 @@ -image: - repository: paasup/keycloak - tag: 17.0.1-legacy - -ingress: - enabled: true - annotations: - cert-manager.io/cluster-issuer: "root-ca-issuer" - rules: - - host: keycloak.example.org - paths: - - path: / - pathType: Prefix - tls: - - hosts: - - keycloak.example.org - secretName: keycloak-tls - -resources: - requests: - cpu: 100m - memory: 500Mi - limits: - cpu: 4000m - memory: 1000Mi - -# 내장 DB 사용시 enable로 변경 -postgresql: - enabled: false - -# 외부 DB 사용 시 -# DB_VENDOR, DB_ADDR, DB_PORT, DB_DATABASE, DB_SCHEMA의 값을 배포된 DB의 값으로 변경 -extraEnv: | - - name: DB_VENDOR - value: postgres - - name: DB_ADDR - value: postgresql-postgresql-ha-postgresql - - name: DB_PORT - value: "5432" - - name: DB_DATABASE - value: keycloak - - name: DB_SCHEMA - value: keycloak - - name: KEYCLOAK_USER - value: admin - - name: KEYCLOAK_PASSWORD - value: Paasadm1234! - - name: KEYCLOAK_FRONTEND_URL - value: "https://keycloak.example.org/auth" - - name: JGROUPS_DISCOVERY_PROTOCOL - value: dns.DNS_PING - - name: JGROUPS_DISCOVERY_PROPERTIES - value: 'dns_query=keycloak-headless.platform.svc.cluster.local' - - name: CACHE_OWNERS_COUNT - value: "2" - - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - value: "2" - - name: TZ - value: Asia/Seoul - -extraEnvFrom: | - - secretRef: - name: 'keycloak-db' - -secrets: - db: - stringData: - DB_USER: keycloak # keycloak이 사용할 DB의 사용자 이름 - DB_PASSWORD: keycloak # keycloak이 사용할 DB의 사용자 비밀번호 - - -## themes 추가 시 주석 해제 / keycloak theme 컨테이너 생성 필요 -## Additional init containers, e. g. for providing custom themes -#extraInitContainers: | -# - name: theme-provider -# image: example.org/library/paasxpert:v2.3-231219 -# imagePullPolicy: IfNotPresent -# command: -# - sh -# args: -# - -c -# - | -# echo "Copying theme..." -# cp -R /theme/* /themes -# volumeMounts: -# - name: theme -# mountPath: /themes -# -# command: -# - /bin/sh -# -# args: -# - -c -# - | -# cp -R /themes/* /opt/jboss/keycloak/themes/ -# /opt/jboss/tools/docker-entrypoint.sh -b 0.0.0.0 -# -# extraVolumeMounts: | -# - name: theme -# mountPath: /themes -# -# extraVolumes: | -# - name: theme -# emptyDir: {} - diff --git a/manifests/helm/keycloak/18.4.0/scripts/keycloak.cli b/manifests/helm/keycloak/18.4.0/scripts/keycloak.cli deleted file mode 100644 index 1469963..0000000 --- a/manifests/helm/keycloak/18.4.0/scripts/keycloak.cli +++ /dev/null @@ -1,13 +0,0 @@ -embed-server --server-config=standalone-ha.xml --std-out=echo -batch - -echo Configuring node identifier - -## Sets the node identifier to the node name (= pod name). Node identifiers have to be unique. They can have a -## maximum length of 23 characters. Thus, the chart's fullname template truncates its length accordingly. -/subsystem=transactions:write-attribute(name=node-identifier, value=${jboss.node.name}) - -echo Finished configuring node identifier - -run-batch -stop-embedded-server diff --git a/manifests/helm/keycloak/18.4.0/templates/NOTES.txt b/manifests/helm/keycloak/18.4.0/templates/NOTES.txt deleted file mode 100644 index a6b49cf..0000000 --- a/manifests/helm/keycloak/18.4.0/templates/NOTES.txt +++ /dev/null @@ -1,65 +0,0 @@ -*********************************************************************** -* * -* Keycloak Helm Chart by codecentric AG * -* * -*********************************************************************** - -{{- if .Values.ingress.enabled }} - -Keycloak was installed with an Ingress and can be reached at the following URL(s): -{{ range $unused, $rule := .Values.ingress.rules }} - {{- range $rule.paths }} - {{- if $rule.host }} - - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ tpl $rule.host $ }}{{ .path }} - {{- else }} - - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .path }} - {{- end }} - {{- end }} -{{- end }} - -{{- else if eq "NodePort" .Values.service.type }} - -Keycloak was installed with a Service of type NodePort. -{{ if .Values.service.httpNodePort }} -Get its HTTP URL with the following commands: - -export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} service {{ include "keycloak.fullname" . }}-http --template='{{"{{ range .spec.ports }}{{ if eq .name \"http\" }}{{ .nodePort }}{{ end }}{{ end }}"}}') -export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -echo "http://$NODE_IP:$NODE_PORT" -{{- end }} -{{ if .Values.service.httpsNodePort }} -Get its HTTPS URL with the following commands: - -export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} service {{ include "keycloak.fullname" . }}-http --template='{{"{{ range .spec.ports }}{{ if eq .name \"https\" }}{{ .nodePort }}{{ end }}{{ end }}"}}') -export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") -echo "http://$NODE_IP:$NODE_PORT" -{{- end }} - -{{- else if eq "LoadBalancer" .Values.service.type }} - -Keycloak was installed with a Service of type LoadBalancer - -NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} service -w {{ include "keycloak.fullname" . }}' - -Get its HTTP URL with the following commands: - -export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ include "keycloak.fullname" . }}-http --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") -echo "http://$SERVICE_IP:{{ .Values.service.httpPort }}" - -Get its HTTPS URL with the following commands: - -export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ include "keycloak.fullname" . }}-http --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") -echo "http://$SERVICE_IP:{{ .Values.service.httpsPort }}" - -{{- else if eq "ClusterIP" .Values.service.type }} - -Keycloak was installed with a Service of type ClusterIP - -Create a port-forwarding with the following commands: - -export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "keycloak.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o name) -echo "Visit http://127.0.0.1:8080 to use your application" -kubectl --namespace {{ .Release.Namespace }} port-forward "$POD_NAME" 8080 - -{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/service-headless.yaml b/manifests/helm/keycloak/18.4.0/templates/service-headless.yaml deleted file mode 100644 index 0c22ec9..0000000 --- a/manifests/helm/keycloak/18.4.0/templates/service-headless.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- $highAvailability := gt (int .Values.replicas) 1 -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ include "keycloak.fullname" . }}-headless - labels: - {{- include "keycloak.labels" . | nindent 4 }} - app.kubernetes.io/component: headless -spec: - type: ClusterIP - clusterIP: None - ports: - - name: http - port: {{ .Values.service.httpPort }} - targetPort: http - protocol: TCP - selector: - {{- include "keycloak.selectorLabels" . | nindent 4 }} diff --git a/manifests/helm/keycloak/18.4.0/templates/serviceaccount.yaml b/manifests/helm/keycloak/18.4.0/templates/serviceaccount.yaml deleted file mode 100644 index 1d8f3f0..0000000 --- a/manifests/helm/keycloak/18.4.0/templates/serviceaccount.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "keycloak.serviceAccountName" . }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- range $key, $value := . }} - {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} - {{- end }} - {{- end }} - labels: - {{- include "keycloak.labels" . | nindent 4 }} - {{- range $key, $value := .Values.serviceAccount.labels }} - {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} - {{- end }} -imagePullSecrets: - {{- toYaml .Values.serviceAccount.imagePullSecrets | nindent 4 }} -{{- end }} diff --git a/manifests/helm/keycloakx/7.2.2/.bumpversion.cfg b/manifests/helm/keycloakx/7.2.2/.bumpversion.cfg new file mode 100644 index 0000000..a7b47d8 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/.bumpversion.cfg @@ -0,0 +1,7 @@ +[bumpversion] +current_version = 7.0.0 +commit = true +tag = false +message = Bump keycloakx chart version: {current_version} → {new_version} + +[bumpversion:file:Chart.yaml] diff --git a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/.helmignore b/manifests/helm/keycloakx/7.2.2/.helmignore similarity index 94% rename from manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/.helmignore rename to manifests/helm/keycloakx/7.2.2/.helmignore index 50af031..cf02291 100644 --- a/manifests/helm/keycloak/18.4.0/charts/postgresql/charts/common/.helmignore +++ b/manifests/helm/keycloakx/7.2.2/.helmignore @@ -10,10 +10,13 @@ .hg/ .hgignore .svn/ +ci/ +examples/ # Common backup files *.swp *.bak *.tmp +*.orig *~ # Various IDEs .project diff --git a/manifests/helm/keycloakx/7.2.2/BUILD-README.md b/manifests/helm/keycloakx/7.2.2/BUILD-README.md new file mode 100644 index 0000000..62d8f08 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/BUILD-README.md @@ -0,0 +1,85 @@ +# keycloakx 버전 갱신 가이드 + +## 1. git 작업 환경 구성 + +- DIP 카탈로그 git 다운로드 +``` +$ git clone https://github.com/paasup/dip-catalog.git +``` + +- 작업 브랜치로 체크아웃 +``` +$ git checkout -b update-keycloakx/7.2.2 +``` + +## 2. helm chart 업데이트 + +#### * 배경 — 왜 keycloakx인가 (이슈 #1) + +기존 `manifests/helm/keycloak/` 는 codecentric의 구버전 WildFly 기반 `keycloak` 차트(17.0.1-legacy)였고, bitnami postgresql 서브차트를 조건부 의존성으로 포함하고 있었다(bitnami 무료 배포 정책 변경으로 문제가 된 지점). codecentric은 17.0.1 이후 이 WildFly 차트를 더 이상 업데이트하지 않고, Quarkus 기반 Keycloak(17+)용으로 새 차트 `keycloakx`를 별도로 제공한다. `keycloakx`는 서브차트 의존성이 전혀 없어(`Chart.yaml`에 dependencies 없음) bitnami 의존 문제가 근본적으로 해소된다 — 그래서 `keycloak` 대신 `keycloakx`로 신규 등록한다. 기존 `manifests/helm/keycloak/18.4.0/` 는 같은 PR에서 제거한다(실제 소비자 없음, 문서 예시 표 한 줄 외 참조 없음). + +### 1) 차트 버전 변경 + +- BUILD-README.md, CUSTOM-README.md, custom-values.yaml을 제외한 파일 삭제. + ``` sh + # chart 디렉토리로 이동 + cd manifests/helm/keycloakx/7.2.2 + + # 파일 삭제 전 삭제할 파일 목록 확인 + find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -print + + # 파일 삭제 + find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -exec rm -rf {} + + ``` + +- codecentric/keycloakx 차트 다운로드 + ``` sh + # manifests/helm 디렉토리로 이동 + cd manifests/helm + + # helm repo 추가 + helm repo add codecentric https://codecentric.github.io/helm-charts + helm repo update + + # helm 차트 pull + helm pull codecentric/keycloakx --version="7.2.2" --untar --untardir /tmp/keycloakx-pull + + # 새 버전 디렉토리로 복사 + mkdir -p keycloakx/7.2.2 + cp -R /tmp/keycloakx-pull/keycloakx/. keycloakx/7.2.2/ + rm -rf /tmp/keycloakx-pull + ``` + +## 3. git push 및 tag 추가 + +- 갱신작업 진행 후 commit +``` +$ git add . +$ git commit -m "add keycloakx/7.2.2 (이슈 #1 대응, keycloak/18.4.0 대체)" +``` + +- main 브랜치에 체크아웃 후 merge +``` +$ git checkout main +$ git merge update-keycloakx/7.2.2 +``` + +- git에 push 후 작업 브랜치 삭제 +``` +$ git push -u origin main +$ git branch -d update-keycloakx/7.2.2 +``` + +- git tag 추가 후 push +``` +$ git tag keycloakx/7.2.2 +$ git push origin keycloakx/7.2.2 +``` + +## 4. 차트 버전 정보 + +- keycloakx/7.2.2 (appVersion 26.6.4) + - `manifests/helm/keycloak/18.4.0`(codecentric 구버전 WildFly 기반, bitnami postgresql 서브차트 포함) 대체. 신규 등록. + - 서브차트 의존성 없음(`Chart.yaml`에 dependencies 없음). + - 서비스 배포를 위하여 custom-values.yaml에 정의하였다. + - **주의**: 이 차트의 `http.relativePath` 기본값은 `"/auth"`(구 WildFly Keycloak 호환용)다. `custom-values.yaml`에서 `"/"`로 반드시 오버라이드해야 한다 — 그대로 두면 OIDC issuer/admin API 경로가 소비자 앱들의 가정(경로 접미사 없음)과 어긋난다. diff --git a/manifests/helm/keycloakx/7.2.2/CUSTOM-README.md b/manifests/helm/keycloakx/7.2.2/CUSTOM-README.md new file mode 100644 index 0000000..475d335 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/CUSTOM-README.md @@ -0,0 +1,117 @@ +# keycloakx 배포 + +## 1. 배포 방법 + +### 1) 배포 시 주의 사항 + +- keycloakx를 배포하려면 외부 postgresql이 필요하다(이 차트는 내장 DB를 지원하지 않는다 — 서브차트 의존성 없음). +- `custom-values.yaml`의 `database.*` 를 배포된 DB 정보로 변경한다. +- **`http.relativePath: "/"` 를 지우거나 값을 바꾸지 말 것.** 이 차트의 기본값은 구버전 WildFly Keycloak 호환을 위한 `"/auth"`다. `"/"`로 명시하지 않으면 Quarkus 네이티브 경로 규칙과 달라져, OIDC issuer URL(`/realms/{realm}`)이나 admin REST API(`/admin/realms/...`)를 경로 접미사 없이 호출하는 소비 앱들의 연동이 조용히 깨진다. + +### 2) 배포 방법 + +``` sh +git clone https://github.com/paasup/dip-catalog.git +cd manifests/helm/keycloakx/7.2.2 +helm upgrade keycloak ./ -f custom-values.yaml --install -n platform --create-namespace +``` + +## 2. custom-values.yaml 설명 + +### 1) pod 설정 + +| Name | 설명 | 기본값 | +| --- | --- | --- | +| `image.repository`/`image.tag` | 오프라인 설치 시에는 사설 미러 레지스트리로 변경. | `quay.io/keycloak/keycloak:26.6.4` | +| `resources` | keycloak pod의 자원 설정. | `custom-values.yaml 참조` | + +### 2) Postgresql 연동 설정 + +`database.*` 구조화 필드를 사용한다(구버전 `keycloak` 차트의 `DB_VENDOR`/`DB_ADDR` 같은 extraEnv 방식이 아니다). + +``` yaml +database: + vendor: postgres + hostname: keycloak-postgresql # 배포된 DB 서비스명으로 변경 + port: 5432 + database: keycloak + username: keycloak + existingSecret: keycloak-db # kubernetes.io/basic-auth 시크릿 이름 + existingSecretKey: password # 시크릿 안의 비밀번호 키 (기본값 "password") + +extraEnv: | + - name: KC_DB_SCHEMA # public 이 아닌 전용 스키마를 쓸 때 지정 + value: keycloak + - name: KC_BOOTSTRAP_ADMIN_USERNAME + value: admin + - name: KC_BOOTSTRAP_ADMIN_PASSWORD + value: Paasadm1234! + - name: TZ + value: Asia/Seoul +``` + +- `existingSecret`으로 지정한 시크릿은 미리 생성해야 한다(이 차트는 시크릿을 만들어주지 않고 참조만 한다): + ``` sh + kubectl create secret generic keycloak-db \ + --type=kubernetes.io/basic-auth \ + --from-literal=username=keycloak \ + --from-literal=password=<비밀번호> \ + -n platform + ``` +- `KC_BOOTSTRAP_ADMIN_USERNAME`/`KC_BOOTSTRAP_ADMIN_PASSWORD`(Keycloak 25+ 표준 부트스트랩 메커니즘)는 **master realm이 완전히 비어있는 최초 부팅에만** admin 계정을 생성한다. 재설치·재기동 시 비밀번호를 바꿔주지 않는다 — 정상 동작이다. + +### 3) Ingress 설정 + +#### 3.1) tls 시크릿 직접 생성 + +``` yaml +ingress: + enabled: true + ingressClassName: apisix # 사용하는 ingress controller 클래스로 변경 + rules: + - host: keycloak.example.org # keycloak에서 사용할 도메인으로 변경 + paths: + - path: / + pathType: Prefix + tls: + - hosts: + - keycloak.example.org # keycloak에서 사용할 도메인으로 변경 + secretName: keycloak-tls +``` + +인증서를 secret으로 직접 제공하는 경우: + +``` sh +kubectl create secret tls keycloak-tls --cert= --key= -n +``` + +#### 3.2) cert-manager를 이용한 자동 생성 + +`custom-values.yaml`의 `ingress.annotations.cert-manager.io/cluster-issuer`를 미리 배포된 ClusterIssuer 이름으로 변경한다. + +``` yaml +ingress: + enabled: true + ingressClassName: apisix + annotations: + cert-manager.io/cluster-issuer: "root-ca-issuer" + rules: + - host: keycloak.example.org + paths: + - path: / + pathType: Prefix + tls: + - hosts: + - keycloak.example.org + secretName: keycloak-tls +``` + +### 4) Proxy 설정 + +ingress/리버스 프록시 뒤에 배포하는 표준 구성: + +``` yaml +proxy: + enabled: true + mode: forwarded +``` diff --git a/manifests/helm/keycloakx/7.2.2/Chart.yaml b/manifests/helm/keycloakx/7.2.2/Chart.yaml new file mode 100644 index 0000000..20ace70 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +appVersion: 26.6.4 +description: Keycloak.X - Open Source Identity and Access Management for Modern Applications + and Services +home: https://www.keycloak.org/ +icon: https://www.keycloak.org/resources/images/keycloak_logo_200px.svg +keywords: +- sso +- idm +- openid connect +- saml +- kerberos +- oauth +- ldap +- keycloakx +- quarkus +maintainers: +- email: thomas.darimont+github@gmail.com + name: thomasdarimont +name: keycloakx +sources: +- https://github.com/codecentric/helm-charts +- https://github.com/keycloak/keycloak/tree/main/quarkus/container +version: 7.2.2 diff --git a/manifests/helm/keycloak/18.4.0/OWNERS b/manifests/helm/keycloakx/7.2.2/OWNERS similarity index 66% rename from manifests/helm/keycloak/18.4.0/OWNERS rename to manifests/helm/keycloakx/7.2.2/OWNERS index 8c2ff0d..8855f63 100644 --- a/manifests/helm/keycloak/18.4.0/OWNERS +++ b/manifests/helm/keycloakx/7.2.2/OWNERS @@ -1,6 +1,4 @@ approvers: - - unguiculus - thomasdarimont reviewers: - - unguiculus - thomasdarimont diff --git a/manifests/helm/keycloakx/7.2.2/README.md b/manifests/helm/keycloakx/7.2.2/README.md new file mode 100644 index 0000000..0e574e7 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/README.md @@ -0,0 +1,655 @@ +# Keycloak-X + +[Keycloak-X](http://www.keycloak.org/) is an open source identity and access management for modern applications and services. + +Note that this chart is the logical successor of the Wildfly based [codecentric/keycloak](https://github.com/codecentric/helm-charts/tree/master/charts/keycloak) chart. + +## TL;DR; + +```console +$ cat << EOF > values.yaml +command: + - "/opt/keycloak/bin/kc.sh" + - "start" + - "--http-port=8080" + - "--hostname-strict=false" +extraEnv: | + - name: KEYCLOAK_ADMIN + value: admin + - name: KEYCLOAK_ADMIN_PASSWORD + value: admin + - name: JAVA_OPTS_APPEND + value: >- + -Djgroups.dns.query={{ include "keycloak.fullname" . }}-headless +EOF + +$ helm install keycloak codecentric/keycloakx --values ./values.yaml +``` +Note that the default configuration is not suitable for production since it uses a h2 file database by default. +It is strongly recommended to use a dedicated database with Keycloak. + +For more examples see the [examples](./examples) folder. + +## Introduction + +This chart bootstraps a [Keycloak](http://www.keycloak.org/) StatefulSet on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. +It provisions a fully featured Keycloak installation. +For more information on Keycloak and its capabilities, see its [documentation](http://www.keycloak.org/documentation.html). + +## Installing the Chart + +To install the chart with the release name `keycloakx`: + +```console +$ helm install keycloak codecentric/keycloakx +``` + +or via GitHub Container Registry: + +```console +$ helm install keycloak oci://ghcr.io/codecentric/helm-charts/keycloakx --version +``` + +## Uninstalling the Chart + +To uninstall the `keycloakx` deployment: + +```console +$ helm uninstall keycloakx +``` + +## Configuration + +The following table lists the configurable parameters of the Keycloak-X chart and their default values. + +| Parameter | Description | Default | +|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `fullnameOverride` | Optionally override the fully qualified name | `""` | +| `nameOverride` | Optionally override the name | `""` | +| `namespaceOverride` | Optionally override the namespace for all resources. Useful for umbrella charts that deploy multiple aliased keycloak instances each into their own namespace. | `""` | +| `replicas` | The number of replicas to create | `1` | +| `image.repository` | The Keycloak image repository | `quay.io/keycloak/keycloak` | +| `image.tag` | Overrides the Keycloak image tag whose default is the chart version | `""` | +| `image.digest` | Overrides the Keycloak image tag with a digest | `""` | +| `image.pullPolicy` | The Keycloak image pull policy | `IfNotPresent` | +| `imagePullSecrets` | Image pull secrets for the Pod | `[]` | +| `hostAliases` | Mapping between IPs and hostnames that will be injected as entries in the Pod's hosts files | `[]` | +| `enableServiceLinks` | Indicates whether information about services should be injected into Pod's environment variables, matching the syntax of Docker links | `true` | +| `updateStrategy` | StatefulSet update strategy. One of `RollingUpdate` or `OnDelete` | `RollingUpdate` | +| `podManagementPolicy` | Pod management policy. One of `Parallel` or `OrderedReady` | `OrderedReady` | +| `revisionHistoryLimit` | Number of old ReplicaSets to retain for rollback. Defaults to Kubernetes default (10) if not set | `""` | +| `restartPolicy` | Pod restart policy. One of `Always`, `OnFailure`, or `Never` | `Always` | +| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | +| `serviceAccount.allowReadPods` | Specifies whether the ServiceAccount can get or list pods | `false` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `""` | +| `serviceAccount.annotations` | Additional annotations for the ServiceAccount | `{}` | +| `serviceAccount.labels` | Additional labels for the ServiceAccount | `{}` | +| `serviceAccount.imagePullSecrets` | Image pull secrets that are attached to the ServiceAccount | `[]` | +| `serviceAccount.automountServiceAccountToken` | Automount API credentials for the Service Account | `true` | +| `rbac.create` | Specifies whether RBAC resources are to be created | `false` | +| `rbac.rules` | Custom RBAC rules, e. g. for KUBE_PING | `[]` | +| `podSecurityContext` | SecurityContext for the entire Pod. Every container running in the Pod will inherit this SecurityContext. This might be relevant when other components of the environment inject additional containers into running Pods (service meshes are the most prominent example for this) | `{"fsGroup":1000}` | +| `securityContext` | SecurityContext for the Keycloak container | `{"runAsNonRoot":true,"runAsUser":1000}` | +| `extraInitContainers` | Additional init containers, e. g. for providing custom themes | `[]` | +| `skipInitContainers` | Skip all init containers (to avoid issues with service meshes which require sidecar proxies for connectivity) | `false` | +| `extraContainers` | Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy | `[]` | +| `lifecycleHooks` | Lifecycle hooks for the Keycloak container | `{}` | +| `terminationGracePeriodSeconds` | Termination grace period in seconds for Keycloak shutdown. Clusters with a large cache might need to extend this to give Infinispan more time to rebalance | `60` | +| `clusterDomain` | The internal Kubernetes cluster domain | `cluster.local` | +| `command` | Overrides the default entrypoint of the Keycloak container | `[]` | +| `args` | Overrides the default args for the Keycloak container | `[]` | +| `extraEnv` | Additional environment variables for Keycloak | `""` | +| `extraEnvFrom` | Additional environment variables for Keycloak mapped from a Secret or ConfigMap | `""` | +| `priorityClassName` | Pod priority class name | `""` | +| `affinity` | Pod affinity | Hard node and soft zone anti-affinity | +| `topologySpreadConstraints` | Topology spread constraints | Constraints used to spread pods | +| `nodeSelector` | Node labels for Pod assignment | `{}` | +| `tolerations` | Node taints to tolerate | `[]` | +| `podLabels` | Additional Pod labels | `{}` | +| `podAnnotations` | Additional Pod annotations | `{}` | +| `livenessProbe` | Liveness probe configuration | `{"httpGet":{"path":"{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/health/live","port":"http-internal","scheme":"HTTP"},"initialDelaySeconds":0,"timeoutSeconds":5}` | +| `readinessProbe` | Readiness probe configuration | `{"httpGet":{"path":"{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/health/ready","port":"http-internal","scheme":"HTTP"},"initialDelaySeconds":10,"timeoutSeconds":1}` | +| `startupProbe` | Startup probe configuration | `{"httpGet":{"path":"{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/health","port":"http-internal","scheme":"HTTP"},"initialDelaySeconds":15,"timeoutSeconds":1,"failureThreshold":60,"periodSeconds":5}` | +| `resources` | Pod resource requests and limits | `{}` | +| `extraVolumes` | Add additional volumes, e. g. for custom themes | `""` | +| `volumeClaimTemplates` | Add volume claim templates to the StatefulSet, e. g. for dynamic provisioning | `""` | +| `extraVolumeMounts` | Add additional volumes mounts, e. g. for custom themes | `""` | +| `extraPorts` | Add additional ports, e. g. for admin console or exposing JGroups ports | `[]` | +| `podDisruptionBudget` | Pod disruption budget | `{}` | +| `statefulsetAnnotations` | Annotations for the StatefulSet | `{}` | +| `statefulsetLabels` | Additional labels for the StatefulSet | `{}` | +| `secrets` | Configuration for secrets that should be created | `{}` | +| `service.annotations` | Annotations for HTTP service | `{}` | +| `service.labels` | Additional labels for headless and HTTP Services | `{}` | +| `service.type` | The Service type | `ClusterIP` | +| `service.loadBalancerIP` | Optional IP for the load balancer. Used for services of type LoadBalancer only | `""` | +| `loadBalancerSourceRanges` | Optional List of allowed source ranges (CIDRs). Used for service of type LoadBalancer only | `[]` | +| `service.externalTrafficPolicy` | Optional external traffic policy. Used for services of type LoadBalancer & NodePort only | `"Cluster"` | +| `service.internalTrafficPolicy` | Optional internal traffic policy. Valid values: `Cluster`, `Local`. | `""` | +| `service.httpPort` | The http Service port | `80` | +| `service.httpNodePort` | The HTTP Service node port if type is NodePort | `""` | +| `service.httpsPort` | The HTTPS Service port | `8443` | +| `service.httpsNodePort` | The HTTPS Service node port if type is NodePort | `""` | +| `service.extraPorts` | Additional Service ports, e. g. for custom admin console | `[]` | +| `service.sessionAffinity` | sessionAffinity for Service, e. g. "ClientIP" | `""` | +| `service.sessionAffinityConfig` | sessionAffinityConfig for Service | `{}` | +| `serviceHeadless.annotations` | Annotations for headless service | `{}` | +| `serviceHeadless.extraPorts` | Add additional ports to the headless service, e. g. for admin console or exposing JGroups ports | `[]` | +| `ingress.enabled` | If `true`, an Ingress is created | `false` | +| `ingress.rules` | List of Ingress Ingress rule | see below | +| `ingress.rules[0].host` | Host for the Ingress rule | `{{ .Release.Name }}.keycloak.example.com` | +| `ingress.rules[0].paths` | Paths for the Ingress rule | see below | +| `ingress.rules[0].paths[0].path` | Path for the Ingress rule | `/` | +| `ingress.rules[0].paths[0].pathType` | Path Type for the Ingress rule | `Prefix` | +| `ingress.rules[0].paths[0].serviceName` | Optional override for backend service name (useful for AWS ALB action annotations) | `""` | +| `ingress.rules[0].paths[0].servicePort` | Optional override for backend service port name | `""` | +| `ingress.servicePort` | The Service port targeted by the Ingress | `http` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.ingressClassName` | The name of the Ingress Class associated with the ingress | `""` | +| `ingress.labels` | Additional Ingress labels | `{}` | +| `ingress.tls` | TLS configuration | see below | +| `ingress.tls[0].hosts` | List of TLS hosts | `[keycloak.example.com]` | +| `ingress.tls[0].secretName` | Name of the TLS secret | `""` | +| `ingress.console.enabled` | If `true`, an Ingress for the console is created | `false` | +| `ingress.console.rules` | List of Ingress Ingress rule for the console | see below | +| `ingress.console.rules[0].host` | Host for the Ingress rule for the console | `{{ .Release.Name }}.keycloak.example.com` | +| `ingress.console.rules[0].paths` | Paths for the Ingress rule for the console | see below | +| `ingress.console.rules[0].paths[0].path` | Path for the Ingress rule for the console | `[{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/admin]` | +| `ingress.console.rules[0].paths[0].pathType` | Path Type for the Ingress rule for the console | `Prefix` | +| `ingress.console.rules[0].paths[0].serviceName` | Optional override for backend service name (console ingress) | `""` | +| `ingress.console.rules[0].paths[0].servicePort` | Optional override for backend service port name (console ingress) | `""` | +| `ingress.console.labels` | Additional labels for the console ingress only | `{}` | +| `ingress.console.annotations` | Ingress annotations for the console | `{}` | +| `ingress.console.ingressClassName` | The name of the Ingress Class associated with the console ingress | `""` | +| `ingress.console.tls` | TLS configuration | see below | +| `ingress.console.tls[0].hosts` | List of TLS hosts | `[keycloak.example.com]` | +| `ingress.console.tls[0].secretName` | Name of the TLS secret | `""` | +| `networkPolicy.enabled` | If true, the ingress network policy is deployed | `false` | +| `networkPolicy.extraFrom` | Allows to define allowed external ingress traffic (see Kubernetes doc for network policy `from` format) | `[]` | +| `networkPolicy.egress` | Allows to define allowed egress from Keycloak pods (see Kubernetes doc for network policy `egress` format) | `[]` | +| `route.enabled` | If `true`, an OpenShift Route is created | `false` | +| `route.path` | Path for the Route | `/` | +| `route.annotations` | Route annotations | `{}` | +| `route.labels` | Additional Route labels | `{}` | +| `route.host` | Host name for the Route | `""` | +| `route.tls.enabled` | If `true`, TLS is enabled for the Route | `true` | +| `route.tls.insecureEdgeTerminationPolicy` | Insecure edge termination policy of the Route. Can be `None`, `Redirect`, or `Allow` | `Redirect` | +| `route.tls.termination` | TLS termination of the route. Can be `edge`, `passthrough`, or `reencrypt` | `edge` | +| `dbchecker.enabled` | Enable database readiness check | `false` | +| `dbchecker.image.repository` | Docker image used to check database readiness at startup | `docker.io/busybox` | +| `dbchecker.image.tag` | Image tag for the dbchecker image | `1.32` | +| `dbchecker.image.pullPolicy` | Image pull policy for the dbchecker image | `IfNotPresent` | +| `dbchecker.securityContext` | SecurityContext for the dbchecker container | `{"allowPrivilegeEscalation":false,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}` | +| `dbchecker.resources` | Resource requests and limits for the dbchecker container | `{"limits":{"cpu":"20m","memory":"32Mi"},"requests":{"cpu":"20m","memory":"32Mi"}}` | +| `database.vendor` | Database vendor | unset | +| `database.hostname` | Database Hostname | unset | +| `database.port` | Database Port | unset | +| `database.username` | Database User | unset | +| `database.password` | Database Password | unset | +| `database.database` | Database | unset | +| `database.existingSecret` | Existing Secret containing database password (expects key `password`) | `""` | +| `database.existingSecretKey` | Key in existing Secret containing database password | `""` +| `cache.stack` | Cache / Cluster Discovery, use `custom` to disable automatic configuration. | `default` | +| `proxy.enabled` | If `true`, the `KC_PROXY` env variable will be set to the configured mode | `true` | +| `proxy.mode` | The configured proxy mode | `forwarded` | +| `proxy.http.enabled` | If `true`, HTTP forwarding is enabled | `true` | +| `http.relativePath` | The relative http path (context-path) | `/auth` | +| `http.internalPort` | The port of the internal management interface | `http-internal` | +| `http.internalScheme` | The scheme of the internal management interface | `HTTP` | +| `metrics.enabled` | If `true` then the metrics endpoint is exposed | `true` | +| `health.enabled` | If `true` then the health endpoint is exposed. If the `readinessProbe` is is needed `metrics.enable` must be `true`. | `true` | +| `serviceMonitor.enabled` | If `true`, a ServiceMonitor resource for the prometheus-operator is created | `false` | +| `serviceMonitor.namespace` | Optionally sets a target namespace in which to deploy the ServiceMonitor resource | `""` | +| `serviceMonitor.namespaceSelector` | Optionally sets a namespace selector for the ServiceMonitor | `{}` | +| `serviceMonitor.annotations` | Annotations for the ServiceMonitor | `{}` | +| `serviceMonitor.labels` | Additional labels for the ServiceMonitor | `{}` | +| `serviceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` | +| `serviceMonitor.scrapeTimeout` | Timeout for scraping | `10s` | +| `serviceMonitor.relabelings` | Relabelings for the Servicemonitor | `[]` | +| `serviceMonitor.metricRelabelings` | metricRelabelings for the Servicemonitor | `[]` | +| `serviceMonitor.path` | The path at which metrics are served | `{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/metrics` | +| `serviceMonitor.port` | The Service port at which metrics are served | `http-internal` | +| `serviceMonitor.scheme` | The scheme to use for scraping metrics ("http" or "https"); if not set, the `http.internalScheme` value is used | `""` | +| `serviceMonitor.tlsConfig` | TLS configuration for the ServiceMonitor, set CA certificates or `insecureSkipVerify` if Keycloak uses https | `{}` | +| `extraServiceMonitor.enabled` | If `true`, an additional ServiceMonitor resource for the prometheus-operator is created. Could be used for additional metrics via [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi) | `false` | +| `extraServiceMonitor.namespace` | Optionally sets a target namespace in which to deploy the additional ServiceMonitor resource | `""` | +| `extraServiceMonitor.namespaceSelector` | Optionally sets a namespace selector for the additional ServiceMonitor | `{}` | +| `extraServiceMonitor.annotations` | Annotations for the additional ServiceMonitor | `{}` | +| `extraServiceMonitor.labels` | Additional labels for the additional ServiceMonitor | `{}` | +| `extraServiceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` | +| `extraServiceMonitor.scrapeTimeout` | Timeout for scraping | `10s` | +| `extraServiceMonitor.relabelings` | Relabelings for the additional ServiceMonitor | `[]` | +| `extraServiceMonitor.metricRelabelings` | metricRelabelings for the additional ServiceMonitor | `[]` | +| `extraServiceMonitor.path` | The path at which metrics are served | `{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/metrics` | +| `extraServiceMonitor.port` | The Service port at which metrics are served | `http-internal` | +| `extraServiceMonitor.scheme` | The scheme to use for scraping metrics ("http" or "https"); if not set, the `http.internalScheme` value is used | `""` | +| `prometheusRule.enabled` | If `true`, a PrometheusRule resource for the prometheus-operator is created | `false` | +| `prometheusRule.namespace` | Optionally sets a target namespace in which to deploy the PrometheusRule resource | `""` | +| `prometheusRule.annotations` | Annotations for the PrometheusRule | `{}` | +| `prometheusRule.labels` | Additional labels for the PrometheusRule | `{}` | +| `prometheusRule.rules` | List of rules for Prometheus | `[]` | +| `autoscaling.enabled` | Enable creation of a HorizontalPodAutoscaler resource | `false` | +| `autoscaling.labels` | Additional labels for the HorizontalPodAutoscaler resource | `{}` | +| `autoscaling.minReplicas` | The minimum number of Pods when autoscaling is enabled | `3` | +| `autoscaling.maxReplicas` | The maximum number of Pods when autoscaling is enabled | `10` | +| `autoscaling.metrics` | The metrics configuration for the HorizontalPodAutoscaler | `[{"resource":{"name":"cpu","target":{"averageUtilization":80,"type":"Utilization"}},"type":"Resource"}]` | +| `autoscaling.behavior` | The scaling policy configuration for the HorizontalPodAutoscaler | `{"scaleDown":{"policies":[{"periodSeconds":300,"type":"Pods","value":1}],"stabilizationWindowSeconds":300}` | +| `test.enabled` | If `true`, test resources are created | `false` | +| `test.image.repository` | The image for the test Pod | `docker.io/seleniarm/standalone-chromium` | +| `test.image.tag` | The tag for the test Pod image | `117.0` | +| `test.image.pullPolicy` | The image pull policy for the test Pod image | `IfNotPresent` | +| `test.podSecurityContext` | SecurityContext for the entire test Pod | `{"fsGroup":1000}` | +| `test.securityContext` | SecurityContext for the test container | `{"runAsNonRoot":true,"runAsUser":1000}` | +| `test.deletionPolicy` | `helm.sh/hook-delete-policy` for the test Pod | `before-hook-creation` | | `before-hook-creation` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: + +```console +$ helm install keycloak codecentric/keycloakx -n keycloak --set replicas=1 +``` + +Alternatively, a YAML file that specifies the values for the parameters can be provided while +installing the chart. For example: + +```console +$ helm install keycloak codecentric/keycloakx -n keycloak --values values.yaml +``` + +The chart offers great flexibility. +It can be configured to work with the official Keycloak-X Docker image but any custom image can be used as well. + +For the official Docker image, please check it's configuration at https://github.com/keycloak/keycloak/tree/main/quarkus/container. + +### Usage of the `tpl` Function + +The `tpl` function allows us to pass string values from `values.yaml` through the templating engine. +It is used for the following values: + +* `extraInitContainers` +* `extraContainers` +* `extraEnv` +* `extraEnvFrom` +* `affinity` +* `extraVolumeMounts` +* `extraVolumes` +* `livenessProbe` +* `readinessProbe` +* `startupProbe` +* `topologySpreadConstraints` + +Additionally, custom labels and annotations can be set on various resources the values of which being passed through `tpl` as well. + +It is important that these values be configured as strings. +Otherwise, installation will fail. +See example for Google Cloud Proxy or default affinity configuration in `values.yaml`. + +### JVM Settings + +Keycloak sets the following system properties by default: +`-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m` + +You can override these by setting the `JAVA_OPTS` environment variable. +Make sure you configure container support. +This allows you to only configure memory using Kubernetes resources and the JVM will automatically adapt. + +```yaml +extraEnv: | + - name: JAVA_OPTS + value: >- + -XX:MaxRAMPercentage=50.0 +``` + +Alternatively one can append custom JVM options by setting the `JAVA_OPTS_APPEND` environment variable. + +The parameter `-Djava.net.preferIPv4Stack=true` is [optional](https://github.com/keycloak/keycloak/commit/ee205c8fbc1846f679bd604fa8d25310c117c87e) for [Keycloak >= v22](https://www.keycloak.org/server/configuration-production#_configure_keycloak_server_with_ipv4_or_ipv6). + +The parameter `-XX:+UseContainerSupport` is no longer required for [Keycloak >= v21 based on JDK v17](https://github.com/keycloak/keycloak/blob/release/21.0/quarkus/container/Dockerfile#L20). + +The parameter `-Djava.awt.headless=true` is no longer required for Quarkus based Keycloak as it is set by [default](https://quarkus.io/guides/building-native-image). + +#### Using an External Database + +The Keycloak Docker image supports various database types. +Configuration happens in a generic manner. + +##### Using a Secret Managed by the Chart + +The following examples uses a PostgreSQL database with a secret that is managed by the Helm chart. + +```yaml +dbchecker: + enabled: true + +database: + vendor: postgres + hostname: mypostgres + port: 5432 + username: '{{ .Values.dbUser }}' + password: '{{ .Values.dbPassword }}' + database: mydb +``` + +`dbUser` and `dbPassword` are custom values you'd then specify on the commandline using `--set-string`. + +##### Using an Existing Secret + +The following examples uses a PostgreSQL database with an existing secret. + +```yaml +dbchecker: + enabled: true + +database: + vendor: postgres + hostname: mypostgres + port: 5432 + database: mydb + username: db-user + existingSecret: byo-db-creds # Password is retrieved via .password +``` + +### Creating a Keycloak Admin User + +The Keycloak-X Docker image supports creating an initial admin user. +It must be configured via environment variables: + +* `KEYCLOAK_ADMIN` +* `KEYCLOAK_ADMIN_PASSWORD` + +This can be done like so in the `values.yaml`, where the `KEYCLOAK_ADMIN` is an insecure example with the value in plaintext. +The `KEYCLOAK_ADMIN_PASSWORD` is referenced from already existing secret but for testing it can be set with `value` too. +```yaml +extraEnv: | + - name: KEYCLOAK_ADMIN + value: admin + - name: KEYCLOAK_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: keycloak-admin-password + key: password +``` + +### High Availability and Clustering + +For high availability, Keycloak must be run with multiple replicas (`replicas > 1`). +The chart has a helper template (`keycloak.serviceDnsName`) that creates the DNS name based on the headless service. + +### Default Cache Stack + +The default cache stack is now using `jdbc-ping` which leverages a table called `jgroups_ping` in the keycloak database to store the cache and significantly reduces network complexity. Keycloak has set this [transport stack](https://www.keycloak.org/server/caching#_transport_stacks) as the default starting in 26.1.0 and it is backwards compatible with all 26.X releases. + +It is recommended to use the new default value as it works in kubernetes and across multiple cloud providers alike. Currently all other options have been marked as deprecated. However, if the original value of `kubernetes` is required in a given environment, it can still be set by using a custom stack: + +```yaml +cache: + stack: custom +``` + +Addtionally, the following environment variables would need to be added for it to function properly: + +```yaml +extraEnv: | + - name: KC_CACHE + value: "ispn" + - name: KC_CACHE_STACK + value: "kubernetes" + - name: JAVA_OPTS_APPEND + value: >- + -Djgroups.dns.query={{ include "keycloak.fullname" . }}-headless +``` + +#### Custom Service Discovery + +If a custom JGroups discovery is needed, then you can configure: + +```yaml +cache: + stack: custom +``` + +You can then reference your custom infinispan configuration file, e.g. `cache-custom.xml` via the `KC_CACHE_CONFIG_FILE` environment variable. +Note that the `cache-custom.xml` must be available via `/opt/keycloak/conf/cache-custom.xml`. + +```yaml +extraEnv: | + - name: KC_CACHE + value: "ispn" + - name: KC_CACHE_CONFIG_FILE + value: cache-custom.xml +``` + +#### Autoscaling + +Due to the caches in Keycloak only replicating to a few nodes (two in the example configuration above) and the limited controls around autoscaling built into Kubernetes, it has historically been problematic to autoscale Keycloak. +However, in Kubernetes 1.18 [additional controls were introduced](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior) which make it possible to scale down in a more controlled manner. + +The example autoscaling configuration in the values file scales from three up to a maximum of ten Pods using CPU utilization as the metric. Scaling up is done as quickly as required but scaling down is done at a maximum rate of one Pod per five minutes. + +Autoscaling can be enabled as follows: + +```yaml +autoscaling: + enabled: true +``` + +KUBE_PING service discovery seems to be the most reliable mechanism to use when enabling autoscaling, due to being faster than DNS_PING at detecting changes in the cluster. + +### Running Keycloak Behind a Reverse Proxy + +When running Keycloak behind a reverse proxy, which is the case when using an ingress controller, +proxy address forwarding must be enabled as follows: + +```yaml +extraEnv: | + - name: KC_PROXY + value: "passthrough" +``` + +### Providing a Custom Theme + +One option is certainly to provide a custom Keycloak-X image that includes the theme. +However, if you prefer to stick with the official Keycloak-X image, you can use an init container as theme provider. + +Create your own theme and package it up into a Docker image. + +```docker +FROM busybox +COPY mytheme /mytheme +``` + +In combination with an `emptyDir` that is shared with the Keycloak container, configure an init container that runs your theme image and copies the theme over to the right place where Keycloak will pick it up automatically. + +```yaml +extraInitContainers: | + - name: theme-provider + image: myuser/mytheme:1 + imagePullPolicy: IfNotPresent + command: + - sh + args: + - -c + - | + echo "Copying theme..." + cp -R /mytheme/* /theme + volumeMounts: + - name: theme + mountPath: /theme + +extraVolumeMounts: | + - name: theme + mountPath: /opt/keycloak/themes/mytheme + +extraVolumes: | + - name: theme + emptyDir: {} +``` + +### Using Google Cloud SQL Proxy + +Depending on your environment you may need a local proxy to connect to the database. +This is, e. g., the case for Google Kubernetes Engine when using Google Cloud SQL. +Create the secret for the credentials as documented [here](https://cloud.google.com/sql/docs/postgres/connect-kubernetes-engine) and configure the proxy as a sidecar. + +Because `extraContainers` is a string that is passed through the `tpl` function, it is possible to create custom values and use them in the string. + +```yaml +database: + vendor: postgres + hostname: '127.0.0.1' + port: 5432 + database: postgres + username: myuser + password: mypassword + +# Custom values for Google Cloud SQL +cloudsql: + project: my-project + region: europe-west1 + instance: my-instance + +extraContainers: | + - name: cloudsql-proxy + image: gcr.io/cloudsql-docker/gce-proxy:1.17 + command: + - /cloud_sql_proxy + args: + - -instances={{ .Values.cloudsql.project }}:{{ .Values.cloudsql.region }}:{{ .Values.cloudsql.instance }}=tcp:5432 + - -credential_file=/secrets/cloudsql/credentials.json + volumeMounts: + - name: cloudsql-creds + mountPath: /secrets/cloudsql + readOnly: true + +extraVolumes: | + - name: cloudsql-creds + secret: + secretName: cloudsql-instance-credentials +``` + +### Changing the Context Path + +By default, Keycloak-X is served under context `/auth`. +Trailing slash is removed from path. This can be changed to another context path like `/` as follows: + +```yaml +http: + relativePath: '/' +``` + +Alternatively, you may supply it via CLI flag: + +```console +--set-string http.relativePath=/ +``` + +### Prometheus Metrics Support + +#### Keycloak Metrics + +Keycloak-X can expose metrics via `/auth/metrics`. + +Metrics are enabled by default via: +```yaml +metrics: + enabled: true +``` + +Add a ServiceMonitor if using prometheus-operator: + +```yaml +serviceMonitor: + # If `true`, a ServiceMonitor resource for the prometheus-operator is created + enabled: true +``` + +Checkout `values.yaml` for customizing the ServiceMonitor and for adding custom Prometheus rules. + +Add annotations if you don't use prometheus-operator: + +```yaml +service: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8080" +``` + +#### Keycloak Metrics SPI + +Optionally, it is possible to add [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi) via init container. +Note that the `keycloak-metrics-spi.jar` needs to be added to the `/opt/keycloak/providers` directory. + +A separate `ServiceMonitor` can be enabled to scrape metrics from the SPI: + +```yaml +extraServiceMonitor: + # If `true`, an additional ServiceMonitor resource for the prometheus-operator is created + enabled: true +``` + +Checkout `values.yaml` for customizing this ServiceMonitor. + +Note that the metrics endpoint is exposed on the HTTP port. +You may want to restrict access to it in your ingress controller configuration. +For ingress-nginx, this could be done as follows: + +```yaml +annotations: + nginx.ingress.kubernetes.io/server-snippet: | + location ~* /auth/realms/[^/]+/metrics { + return 403; + } +``` + +### Extra Kubernetes Manifests + +It is possible to deploy extra Kubernetes resources (such as ConfigMaps, Secrets, Jobs, or any other Kubernetes objects) alongside the Keycloak chart by using the `extraManifests` value. +This feature supports Helm templating, allowing you to use chart helpers like `{{ include "keycloak.fullname" . }}` within your manifests. + +```yaml +extraManifests: + - | + apiVersion: v1 + kind: ConfigMap + metadata: + name: {{ include "keycloak.fullname" . }}-extra-config + labels: + {{- include "keycloak.labels" . | nindent 8 }} + data: + custom-key: custom-value + - | + apiVersion: v1 + kind: Secret + metadata: + name: {{ include "keycloak.fullname" . }}-extra-secret + type: Opaque + stringData: + my-secret-key: my-secret-value +``` + +## Why StatefulSet? + +The headless service that governs the StatefulSet is used for DNS discovery via DNS_PING. + +## Bad Gateway and Proxy Buffer Size in Nginx + +A common issue with Keycloak and nginx is that the proxy buffer may be too small for what Keycloak is trying to send. This will result in a Bad Gateway (502) error. There are [many](https://github.com/kubernetes/ingress-nginx/issues/4637) [issues](https://stackoverflow.com/questions/56126864/why-do-i-get-502-when-trying-to-authenticate) around the internet about this. The solution is to increase the buffer size of nginx. This can be done by creating an annotation in the ingress specification: + +```yaml +ingress: + annotations: + nginx.ingress.kubernetes.io/proxy-buffer-size: "128k" +``` + +## Upgrading + +Notes for upgrading from previous Keycloak chart versions. + +### From chart < 18.0.0 + +* Keycloak is updated to 18.0.0 +* Added new `health.enabled` option. + +Keycloak 18.0.0 allows to enable the health endpoint independently of the metrics endpoint via the `health-enabled` setting. +We reflect that via the new config option `health.enabled`. + +Please read the additional notes about [Migrating to 18.0.0](https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-18-0-0) in the Keycloak documentation. diff --git a/manifests/helm/keycloakx/7.2.2/custom-values.yaml b/manifests/helm/keycloakx/7.2.2/custom-values.yaml new file mode 100644 index 0000000..b6c2b95 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/custom-values.yaml @@ -0,0 +1,63 @@ +image: + repository: quay.io/keycloak/keycloak + tag: "26.6.4" + +# keycloakx 기본값은 "/auth"(구 WildFly 기반 codecentric/keycloak 호환용). Keycloak +# 26(Quarkus) 네이티브 기본값은 "/"이며, /auth 를 그대로 두면 OIDC issuer/admin API +# 경로가 다른 앱들의 가정(경로 접미사 없음)과 어긋난다. +http: + relativePath: "/" + +ingress: + enabled: true + ingressClassName: apisix + annotations: + cert-manager.io/cluster-issuer: "root-ca-issuer" + rules: + - host: keycloak.example.org + paths: + - path: / + pathType: Prefix + tls: + - hosts: + - keycloak.example.org + secretName: keycloak-tls + +proxy: + enabled: true + mode: forwarded + +resources: + requests: + cpu: 100m + memory: 500Mi + limits: + cpu: 2000m + memory: 1500Mi + +# 외부 postgresql 사용. vendor/hostname/port/database/username 값을 배포된 DB로 변경. +# 비밀번호는 password 평문 대신 existingSecret(kubernetes.io/basic-auth 시크릿의 +# password 키, 기본 existingSecretKey)을 쓰는 것을 권장. +database: + vendor: postgres + hostname: keycloak-postgresql + port: 5432 + database: keycloak + username: keycloak + existingSecret: keycloak-db + existingSecretKey: password + +# KC_DB_SCHEMA: Keycloak Quarkus 정식 config 옵션(db-schema) — public 이 아닌 전용 +# 스키마를 쓸 때 지정. +# KC_BOOTSTRAP_ADMIN_USERNAME/PASSWORD: Keycloak 25+ 의 admin 계정 부트스트랩 +# 메커니즘(구버전 KEYCLOAK_ADMIN/KEYCLOAK_ADMIN_PASSWORD 대체). master realm이 +# 완전히 비어있는 최초 부팅에만 동작 — 재설치 시 비밀번호가 갱신되지 않는 것이 정상. +extraEnv: | + - name: KC_DB_SCHEMA + value: keycloak + - name: KC_BOOTSTRAP_ADMIN_USERNAME + value: admin + - name: KC_BOOTSTRAP_ADMIN_PASSWORD + value: Paasadm1234! + - name: TZ + value: Asia/Seoul diff --git a/manifests/helm/keycloakx/7.2.2/templates/NOTES.txt b/manifests/helm/keycloakx/7.2.2/templates/NOTES.txt new file mode 100644 index 0000000..2da9f26 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/templates/NOTES.txt @@ -0,0 +1,61 @@ +*********************************************************************** +* * +* Keycloak.X Helm Chart by codecentric AG * +* * +*********************************************************************** + +{{- if .Values.ingress.enabled }} + +Keycloak was installed with an Ingress and an be reached at the following URL(s): +{{ range $unused, $rule := .Values.ingress.rules }} + {{- range $rule.paths }} + - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ tpl $rule.host $ }}{{ .path }} + {{- end }} +{{- end }} + +{{- else if eq "NodePort" .Values.service.type }} + +Keycloak was installed with a Service of type NodePort. +{{ if .Values.service.httpNodePort }} +Get its HTTP URL with the following commands: + +export NODE_PORT=$(kubectl get --namespace {{ include "keycloak.namespace" . }} service {{ include "keycloak.fullname" . }}-http --template='{{"{{ range .spec.ports }}{{ if eq .name \"http\" }}{{ .nodePort }}{{ end }}{{ end }}"}}') +export NODE_IP=$(kubectl get nodes --namespace {{ include "keycloak.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") +echo "http://$NODE_IP:$NODE_PORT" +{{- end }} +{{ if .Values.service.httpsNodePort }} +Get its HTTPS URL with the following commands: + +export NODE_PORT=$(kubectl get --namespace {{ include "keycloak.namespace" . }} service {{ include "keycloak.fullname" . }}-http --template='{{"{{ range .spec.ports }}{{ if eq .name \"https\" }}{{ .nodePort }}{{ end }}{{ end }}"}}') +export NODE_IP=$(kubectl get nodes --namespace {{ include "keycloak.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") +echo "http://$NODE_IP:$NODE_PORT" +{{- end }} + +{{- else if eq "LoadBalancer" .Values.service.type }} + +Keycloak was installed with a Service of type LoadBalancer + +NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ include "keycloak.namespace" . }} service -w {{ include "keycloak.fullname" . }}' + +Get its HTTP URL with the following commands: + +export SERVICE_IP=$(kubectl get service --namespace {{ include "keycloak.namespace" . }} {{ include "keycloak.fullname" . }}-http --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") +echo "http://$SERVICE_IP:{{ .Values.service.httpPort }}" + +Get its HTTPS URL with the following commands: + +export SERVICE_IP=$(kubectl get service --namespace {{ include "keycloak.namespace" . }} {{ include "keycloak.fullname" . }}-http --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") +echo "http://$SERVICE_IP:{{ .Values.service.httpsPort }}" + +{{- else if eq "ClusterIP" .Values.service.type }} + +Keycloak was installed with a Service of type ClusterIP + +Create a port-forwarding with the following commands: + +export POD_NAME=$(kubectl get pods --namespace {{ include "keycloak.namespace" . }} -l "app.kubernetes.io/name={{ include "keycloak.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o name) +echo "Visit http://127.0.0.1:8080 to use your application" +kubectl --namespace {{ include "keycloak.namespace" . }} port-forward "$POD_NAME" 8080 + +{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/_helpers.tpl b/manifests/helm/keycloakx/7.2.2/templates/_helpers.tpl similarity index 57% rename from manifests/helm/keycloak/18.4.0/templates/_helpers.tpl rename to manifests/helm/keycloakx/7.2.2/templates/_helpers.tpl index bcb7a92..f993a6b 100644 --- a/manifests/helm/keycloak/18.4.0/templates/_helpers.tpl +++ b/manifests/helm/keycloakx/7.2.2/templates/_helpers.tpl @@ -8,18 +8,16 @@ Expand the name of the chart. {{/* Create a default fully qualified app name. -We truncate to 20 characters because this is used to set the node identifier in WildFly which is limited to -23 characters. This allows for a replica suffix for up to 99 replicas. */}} {{- define "keycloak.fullname" -}} {{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 20 | trimSuffix "-" }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} {{- $name := default .Chart.Name .Values.nameOverride }} {{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 20 | trimSuffix "-" }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 20 | trimSuffix "-" }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} @@ -37,7 +35,7 @@ Common labels {{- define "keycloak.labels" -}} helm.sh/chart: {{ include "keycloak.chart" . }} {{ include "keycloak.selectorLabels" . }} -app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }} +app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | toString | trunc 63 | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} @@ -60,17 +58,37 @@ Create the name of the service account to use {{- end }} {{- end }} -{{/* -Create a default fully qualified app name for the postgres requirement. -*/}} -{{- define "keycloak.postgresql.fullname" -}} -{{- $postgresContext := dict "Values" .Values.postgresql "Release" .Release "Chart" (dict "Name" "postgresql") -}} -{{ include "keycloak.fullname" .}}-{{ include "postgresql.name" $postgresContext }} -{{- end }} - {{/* Create the service DNS name. */}} {{- define "keycloak.serviceDnsName" -}} -{{ include "keycloak.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} +{{ include "keycloak.fullname" . }}-headless.{{ include "keycloak.namespace" . }}.svc.{{ .Values.clusterDomain }} {{- end }} + +{{/* +Namespace for all resources. Callers can override via .Values.namespaceOverride. +*/}} +{{- define "keycloak.namespace" -}} +{{- default .Release.Namespace .Values.namespaceOverride -}} +{{- end }} + +{{- define "keycloak.databasePasswordEnv" -}} +{{- if or .Values.database.password .Values.database.existingSecret -}} +- name: KC_DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.database.existingSecret | default (printf "%s-database" (include "keycloak.fullname" . ))}} + key: {{ .Values.database.existingSecretKey | default "password" }} + {{- end }} +{{- end -}} + +{{/* +Renders a complete tree, even values that contains template. +*/}} +{{- define "keycloak.render" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{ else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/templates/configmap-startup.yaml b/manifests/helm/keycloakx/7.2.2/templates/configmap-startup.yaml similarity index 85% rename from manifests/helm/keycloak/18.4.0/templates/configmap-startup.yaml rename to manifests/helm/keycloakx/7.2.2/templates/configmap-startup.yaml index 8fbb462..1bf5944 100644 --- a/manifests/helm/keycloak/18.4.0/templates/configmap-startup.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/configmap-startup.yaml @@ -1,9 +1,9 @@ {{- if .Values.startupScripts }} -{{- $highAvailability := gt (int .Values.replicas) 1 -}} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "keycloak.fullname" . }}-startup + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} data: diff --git a/manifests/helm/keycloakx/7.2.2/templates/database-secret.yaml b/manifests/helm/keycloakx/7.2.2/templates/database-secret.yaml new file mode 100644 index 0000000..1e649b5 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/templates/database-secret.yaml @@ -0,0 +1,12 @@ +{{- if and .Values.database.password (not .Values.database.existingSecret) -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "keycloak.fullname" $ }}-database + namespace: {{ include "keycloak.namespace" . }} + labels: + {{- include "keycloak.labels" $ | nindent 4 }} +type: Opaque +stringData: + password: {{ .Values.database.password | quote }} +{{- end }} diff --git a/manifests/helm/keycloakx/7.2.2/templates/extra-manifests.yaml b/manifests/helm/keycloakx/7.2.2/templates/extra-manifests.yaml new file mode 100644 index 0000000..cdea881 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/templates/extra-manifests.yaml @@ -0,0 +1,4 @@ +{{- range .Values.extraManifests }} +--- +{{ include "keycloak.render" (dict "value" . "context" $) }} +{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/hpa.yaml b/manifests/helm/keycloakx/7.2.2/templates/hpa.yaml similarity index 90% rename from manifests/helm/keycloak/18.4.0/templates/hpa.yaml rename to manifests/helm/keycloakx/7.2.2/templates/hpa.yaml index c772b76..2c56ffa 100644 --- a/manifests/helm/keycloak/18.4.0/templates/hpa.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/hpa.yaml @@ -1,8 +1,9 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} {{- range $key, $value := .Values.autoscaling.labels }} diff --git a/manifests/helm/keycloakx/7.2.2/templates/httproute.yaml b/manifests/helm/keycloakx/7.2.2/templates/httproute.yaml new file mode 100644 index 0000000..857c6ad --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/templates/httproute.yaml @@ -0,0 +1,99 @@ +{{- $httpRoute := .Values.httpRoute -}} +{{- if $httpRoute.enabled -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} + labels: + {{- include "keycloak.labels" . | nindent 4 }} + {{- range $key, $value := $httpRoute.labels }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- with $httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- with $httpRoute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with $httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range $httpRoute.rules }} + {{- with .matches }} + - matches: + {{- range . }} + {{- if .path }} + - path: + type: {{ .path.type }} + value: {{ tpl .path.value $ }} + {{- end }} + {{- else }} + {{ . | toYaml | nindent 8 }} + {{- end }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ include "keycloak.fullname" $ }}-http + port: {{ $httpRoute.servicePort }} + {{- end }} +{{- end }} +--- +{{- if $httpRoute.console.enabled }} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ include "keycloak.fullname" . }}-console + namespace: {{ include "keycloak.namespace" . }} + labels: + {{- include "keycloak.labels" . | nindent 4 }} + {{- range $key, $value := $httpRoute.labels }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- range $key, $value := $httpRoute.console.labels }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- with $httpRoute.console.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- with pluck "parentRefs" $httpRoute.console $httpRoute | first }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with pluck "hostnames" $httpRoute.console $httpRoute | first }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range $httpRoute.console.rules }} + {{- with .matches }} + - matches: + {{- range . }} + {{- if .path }} + - path: + type: {{ .path.type }} + value: {{ tpl .path.value $ }} + {{- end }} + {{- else }} + {{ . | toYaml | nindent 8 }} + {{- end }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ include "keycloak.fullname" $ }}-http + port: {{ $httpRoute.servicePort }} + {{- end }} +{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/ingress.yaml b/manifests/helm/keycloakx/7.2.2/templates/ingress.yaml similarity index 62% rename from manifests/helm/keycloak/18.4.0/templates/ingress.yaml rename to manifests/helm/keycloakx/7.2.2/templates/ingress.yaml index 44f8069..476f29f 100644 --- a/manifests/helm/keycloak/18.4.0/templates/ingress.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/ingress.yaml @@ -1,19 +1,12 @@ {{- $ingress := .Values.ingress -}} {{- if $ingress.enabled -}} -{{- $apiV1 := false -}} -{{- $apiVersion := "extensions/v1beta1" -}} -{{- if and (.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= v1.19.0-0" .Capabilities.KubeVersion.Version) -}} - {{- $apiVersion = "networking.k8s.io/v1" -}} - {{- $apiV1 = true -}} -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} - {{- $apiVersion = "networking.k8s.io/v1beta1" -}} -{{- else -}} - {{- $apiVersion = "extensions/v1beta1" -}} -{{- end }} +{{- $apiVersion := "networking.k8s.io/v1" -}} +{{- $fullName := ( include "keycloak.fullname" . ) -}} apiVersion: {{ $apiVersion }} kind: Ingress metadata: - name: {{ include "keycloak.fullname" . }} + name: {{ $fullName }} + namespace: {{ include "keycloak.namespace" . }} {{- with $ingress.annotations }} annotations: {{- range $key, $value := . }} @@ -43,26 +36,17 @@ spec: {{- end }} rules: {{- range .Values.ingress.rules }} - - - {{- if .host }} - host: {{ tpl .host $ | quote }} - {{- end }} + - host: {{ tpl .host $ | quote }} http: paths: {{- range .paths }} - - path: {{ .path }} - {{- if $apiV1 }} + - path: {{ tpl .path $ | quote }} pathType: {{ .pathType }} backend: service: - name: {{ include "keycloak.fullname" $ }}-http + name: {{ default (printf "%s-http" $fullName) (.serviceName) }} port: - name: {{ $ingress.servicePort }} - {{- else }} - backend: - serviceName: {{ include "keycloak.fullname" $ }}-http - servicePort: {{ $ingress.servicePort }} - {{- end }} + name: {{ default ($ingress.servicePort) (.servicePort) }} {{- end }} {{- end }} {{- if $ingress.console.enabled }} @@ -70,7 +54,8 @@ spec: apiVersion: {{ $apiVersion }} kind: Ingress metadata: - name: {{ include "keycloak.fullname" . }}-console + name: {{ $fullName }}-console + namespace: {{ include "keycloak.namespace" . }} {{- with $ingress.console.annotations }} annotations: {{- range $key, $value := . }} @@ -82,6 +67,9 @@ metadata: {{- range $key, $value := $ingress.labels }} {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} {{- end }} + {{- range $key, $value := $ingress.console.labels }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} spec: {{- if $ingress.console.ingressClassName }} ingressClassName: {{ $ingress.console.ingressClassName }} @@ -111,26 +99,17 @@ spec: {{- end }} rules: {{- range .Values.ingress.console.rules }} - - - {{- if .host }} - host: {{ tpl .host $ | quote }} - {{- end }} + - host: {{ tpl .host $ | quote }} http: paths: {{- range .paths }} - - path: {{ .path }} - {{- if $apiV1 }} + - path: {{ tpl .path $ | quote }} pathType: {{ .pathType }} backend: service: - name: {{ include "keycloak.fullname" $ }}-http + name: {{ default (printf "%s-http" $fullName) (.serviceName) }} port: - name: {{ $ingress.servicePort }} - {{- else }} - backend: - serviceName: {{ include "keycloak.fullname" $ }}-http - servicePort: {{ $ingress.servicePort }} - {{- end }} + name: {{ default ($ingress.servicePort) (.servicePort) }} {{- end }} {{- end }} {{- end -}} diff --git a/manifests/helm/keycloak/18.4.0/templates/networkpolicy.yaml b/manifests/helm/keycloakx/7.2.2/templates/networkpolicy.yaml similarity index 83% rename from manifests/helm/keycloak/18.4.0/templates/networkpolicy.yaml rename to manifests/helm/keycloakx/7.2.2/templates/networkpolicy.yaml index 995f413..d8d4702 100644 --- a/manifests/helm/keycloak/18.4.0/templates/networkpolicy.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/networkpolicy.yaml @@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: {{ include "keycloak.fullname" . | quote }} + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} {{- range $key, $value := .Values.networkPolicy.labels }} @@ -11,6 +12,9 @@ metadata: spec: policyTypes: - Ingress + {{- if .Values.networkPolicy.egress }} + - Egress + {{- end}} podSelector: matchLabels: {{- include "keycloak.selectorLabels" . | nindent 6 }} @@ -37,10 +41,12 @@ spec: port: 8080 - protocol: TCP port: 8443 - - protocol: TCP - port: 9990 {{ range .Values.extraPorts }} - protocol: {{ default "TCP" .protocol }} port: {{ .containerPort }} {{- end }} + {{- if .Values.networkPolicy.egress }} + egress: + {{- .Values.networkPolicy.egress | toYaml | nindent 4 }} + {{- end }} {{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/poddisruptionbudget.yaml b/manifests/helm/keycloakx/7.2.2/templates/poddisruptionbudget.yaml similarity index 67% rename from manifests/helm/keycloak/18.4.0/templates/poddisruptionbudget.yaml rename to manifests/helm/keycloakx/7.2.2/templates/poddisruptionbudget.yaml index 7c684cf..def94e1 100644 --- a/manifests/helm/keycloak/18.4.0/templates/poddisruptionbudget.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/poddisruptionbudget.yaml @@ -1,12 +1,9 @@ {{- if .Values.podDisruptionBudget -}} -{{- if .Capabilities.APIVersions.Has "policy/v1" }} -apiVersion: policy/v1 -{{- else }} -apiVersion: policy/v1beta1 -{{- end }} +apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }} kind: PodDisruptionBudget metadata: name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} spec: diff --git a/manifests/helm/keycloak/18.4.0/templates/prometheusrule.yaml b/manifests/helm/keycloakx/7.2.2/templates/prometheusrule.yaml similarity index 84% rename from manifests/helm/keycloak/18.4.0/templates/prometheusrule.yaml rename to manifests/helm/keycloakx/7.2.2/templates/prometheusrule.yaml index 69af5e7..4f4207d 100644 --- a/manifests/helm/keycloak/18.4.0/templates/prometheusrule.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/prometheusrule.yaml @@ -4,6 +4,11 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: {{ include "keycloak.fullname" $ }} + {{- with .namespace }} + namespace: {{ . }} + {{- else }} + namespace: {{ include "keycloak.namespace" $ }} + {{- end }} {{- with .annotations }} annotations: {{- range $key, $value := . }} diff --git a/manifests/helm/keycloak/18.4.0/templates/rbac.yaml b/manifests/helm/keycloakx/7.2.2/templates/rbac.yaml similarity index 80% rename from manifests/helm/keycloak/18.4.0/templates/rbac.yaml rename to manifests/helm/keycloakx/7.2.2/templates/rbac.yaml index 9ca0a2b..7ceaffc 100644 --- a/manifests/helm/keycloak/18.4.0/templates/rbac.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/rbac.yaml @@ -3,6 +3,7 @@ kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} rules: @@ -12,6 +13,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} roleRef: @@ -21,5 +23,5 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "keycloak.serviceAccountName" . }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "keycloak.namespace" . | quote }} {{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/route.yaml b/manifests/helm/keycloakx/7.2.2/templates/route.yaml similarity index 95% rename from manifests/helm/keycloak/18.4.0/templates/route.yaml rename to manifests/helm/keycloakx/7.2.2/templates/route.yaml index 2c40905..f22cdb7 100644 --- a/manifests/helm/keycloak/18.4.0/templates/route.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/route.yaml @@ -4,6 +4,7 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} {{- with $route.annotations }} annotations: {{- range $key, $value := . }} diff --git a/manifests/helm/keycloak/18.4.0/templates/secrets.yaml b/manifests/helm/keycloakx/7.2.2/templates/secrets.yaml similarity index 94% rename from manifests/helm/keycloak/18.4.0/templates/secrets.yaml rename to manifests/helm/keycloakx/7.2.2/templates/secrets.yaml index 6d0d30f..f78d0cd 100644 --- a/manifests/helm/keycloak/18.4.0/templates/secrets.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/secrets.yaml @@ -4,6 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "keycloak.fullname" $ }}-{{ $nameSuffix }} + namespace: {{ include "keycloak.namespace" $ }} {{- with $values.annotations }} annotations: {{- range $key, $value := . }} diff --git a/manifests/helm/keycloakx/7.2.2/templates/service-headless.yaml b/manifests/helm/keycloakx/7.2.2/templates/service-headless.yaml new file mode 100644 index 0000000..cae5636 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/templates/service-headless.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "keycloak.fullname" . }}-headless + namespace: {{ include "keycloak.namespace" . }} + {{- with .Values.serviceHeadless.annotations }} + annotations: + {{- range $key, $value := . }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- end }} + labels: + {{- include "keycloak.labels" . | nindent 4 }} + {{- range $key, $value := .Values.serviceHeadless.labels }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + app.kubernetes.io/component: headless +spec: + type: ClusterIP + clusterIP: None + ports: + - name: http + port: {{ .Values.service.httpPort }} + targetPort: http + protocol: TCP + {{- with .Values.serviceHeadless.extraPorts }} + {{- toYaml . | nindent 4 }} + {{- end }} + selector: + {{- include "keycloak.selectorLabels" . | nindent 4 }} diff --git a/manifests/helm/keycloak/18.4.0/templates/service-http.yaml b/manifests/helm/keycloakx/7.2.2/templates/service-http.yaml similarity index 82% rename from manifests/helm/keycloak/18.4.0/templates/service-http.yaml rename to manifests/helm/keycloakx/7.2.2/templates/service-http.yaml index bc1ea14..6f219d2 100644 --- a/manifests/helm/keycloak/18.4.0/templates/service-http.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/service-http.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "keycloak.fullname" . }}-http + namespace: {{ include "keycloak.namespace" . }} {{- with .Values.service.annotations }} annotations: {{- range $key, $value := . }} @@ -23,9 +24,12 @@ spec: loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} {{- end }} - {{- if eq "LoadBalancer" .Values.service.type }} + {{- if or (eq "LoadBalancer" .Values.service.type) (eq "NodePort" .Values.service.type) }} externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} {{- end }} + {{- if .Values.service.internalTrafficPolicy }} + internalTrafficPolicy: {{ .Values.service.internalTrafficPolicy }} + {{- end }} {{- if .Values.service.sessionAffinity }} sessionAffinity: {{ .Values.service.sessionAffinity }} {{- with .Values.service.sessionAffinityConfig }} @@ -34,6 +38,10 @@ spec: {{- end }} {{- end }} ports: + - name: '{{ .Values.http.internalPort }}' + port: 9000 + protocol: TCP + targetPort: '{{ .Values.http.internalPort }}' - name: http port: {{ .Values.service.httpPort }} targetPort: http @@ -41,6 +49,7 @@ spec: nodePort: {{ .Values.service.httpNodePort }} {{- end }} protocol: TCP + {{- if .Values.service.httpsPort }} - name: https port: {{ .Values.service.httpsPort }} targetPort: https @@ -48,13 +57,7 @@ spec: nodePort: {{ .Values.service.httpsNodePort }} {{- end }} protocol: TCP - - name: http-management - port: {{ .Values.service.httpManagementPort }} - targetPort: http-management - {{- if and (eq "NodePort" .Values.service.type) .Values.service.httpManagementNodePort }} - nodePort: {{ .Values.service.httpManagementNodePort }} {{- end }} - protocol: TCP {{- with .Values.service.extraPorts }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/manifests/helm/keycloakx/7.2.2/templates/serviceaccount.yaml b/manifests/helm/keycloakx/7.2.2/templates/serviceaccount.yaml new file mode 100644 index 0000000..bf54ea2 --- /dev/null +++ b/manifests/helm/keycloakx/7.2.2/templates/serviceaccount.yaml @@ -0,0 +1,47 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "keycloak.serviceAccountName" . }} + namespace: {{ include "keycloak.namespace" . }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- range $key, $value := . }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} + {{- end }} + labels: + {{- include "keycloak.labels" . | nindent 4 }} + {{- range $key, $value := .Values.serviceAccount.labels }} + {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} + {{- end }} +{{- with .Values.serviceAccount.imagePullSecrets }} +imagePullSecrets: {{ toYaml . | nindent 4 }} +{{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} + +{{- if .Values.serviceAccount.allowReadPods }} +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: jgroups-kubeping-pod-reader-{{ include "keycloak.namespace" . }} +rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: jgroups-kubeping-api-access-{{ include "keycloak.namespace" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: jgroups-kubeping-pod-reader-{{ include "keycloak.namespace" . }} +subjects: + - kind: ServiceAccount + name: {{ include "keycloak.serviceAccountName" . }} + namespace: {{ include "keycloak.namespace" . }} +{{- end }} +{{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/servicemonitor.yaml b/manifests/helm/keycloakx/7.2.2/templates/servicemonitor.yaml similarity index 59% rename from manifests/helm/keycloak/18.4.0/templates/servicemonitor.yaml rename to manifests/helm/keycloakx/7.2.2/templates/servicemonitor.yaml index ba97f62..c3e5d6b 100644 --- a/manifests/helm/keycloak/18.4.0/templates/servicemonitor.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/servicemonitor.yaml @@ -1,4 +1,4 @@ -{{- range $key, $serviceMonitor := dict "wildfly" .Values.serviceMonitor "extra" .Values.extraServiceMonitor }} +{{- range $key, $serviceMonitor := dict "keycloakx" .Values.serviceMonitor "extra" .Values.extraServiceMonitor }} {{- with $serviceMonitor }} {{- if .enabled }} --- @@ -8,6 +8,8 @@ metadata: name: {{ include "keycloak.fullname" $ }}-{{ $key }} {{- with .namespace }} namespace: {{ . }} + {{- else }} + namespace: {{ include "keycloak.namespace" $ }} {{- end }} {{- with .annotations }} annotations: @@ -30,10 +32,23 @@ spec: {{- include "keycloak.selectorLabels" $ | nindent 6 }} app.kubernetes.io/component: http endpoints: - - port: {{ .port }} - path: {{ .path }} + - port: {{ tpl .port $ | quote }} + path: {{ tpl .path $ | quote }} + scheme: {{ coalesce .scheme $.Values.http.internalScheme | lower }} interval: {{ .interval }} scrapeTimeout: {{ .scrapeTimeout }} + {{- with .relabelings }} + relabelings: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .metricRelabelings }} + metricRelabelings: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .tlsConfig }} + tlsConfig: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/statefulset.yaml b/manifests/helm/keycloakx/7.2.2/templates/statefulset.yaml similarity index 57% rename from manifests/helm/keycloak/18.4.0/templates/statefulset.yaml rename to manifests/helm/keycloakx/7.2.2/templates/statefulset.yaml index 52396a5..8447db0 100644 --- a/manifests/helm/keycloak/18.4.0/templates/statefulset.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/statefulset.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "keycloak.fullname" . }} + namespace: {{ include "keycloak.namespace" . }} {{- with .Values.statefulsetAnnotations }} annotations: {{- range $key, $value := . }} @@ -24,6 +25,9 @@ spec: podManagementPolicy: {{ .Values.podManagementPolicy }} updateStrategy: type: {{ .Values.updateStrategy }} + {{- if not (eq (.Values.revisionHistoryLimit | toString) "") }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + {{- end }} template: metadata: annotations: @@ -34,35 +38,32 @@ spec: {{- end }} labels: {{- include "keycloak.selectorLabels" . | nindent 8 }} - {{- if and .Values.postgresql.enabled (and .Values.postgresql.networkPolicy .Values.postgresql.networkPolicy.enabled) }} - {{ include "keycloak.postgresql.fullname" . }}-client: "true" - {{- end }} {{- range $key, $value := .Values.podLabels }} {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 8 }} {{- end }} spec: {{- if not .Values.skipInitContainers }} - {{- if or .Values.postgresql.enabled .Values.extraInitContainers }} + {{- if or .Values.dbchecker.enabled .Values.extraInitContainers }} initContainers: - {{- if .Values.postgresql.enabled }} - - name: pgchecker - image: "{{ .Values.pgchecker.image.repository }}:{{ .Values.pgchecker.image.tag }}" - imagePullPolicy: {{ .Values.pgchecker.image.pullPolicy }} + {{- if and .Values.dbchecker.enabled }} + - name: dbchecker + image: "{{ .Values.dbchecker.image.repository }}{{- if (.Values.dbchecker.image.digest) -}}@{{ .Values.dbchecker.image.digest }}{{- else -}}:{{ .Values.dbchecker.image.tag }} {{- end }}" + imagePullPolicy: {{ .Values.dbchecker.image.pullPolicy }} securityContext: - {{- toYaml .Values.pgchecker.securityContext | nindent 12 }} + {{- toYaml .Values.dbchecker.securityContext | nindent 12 }} command: - sh - -c - | - echo 'Waiting for PostgreSQL to become ready...' + echo 'Waiting for Database to become ready...' - until printf "." && nc -z -w 2 {{ include "keycloak.postgresql.fullname" . }} {{ .Values.postgresql.service.port }}; do + until printf "." && nc -z -w 2 {{ required ".Values.database.hostname is required if dbchecker is enabled!" .Values.database.hostname }} {{ required ".Values.database.port is required if dbchecker is enabled!" .Values.database.port }}; do sleep 2; done; - echo 'PostgreSQL OK ✓' + echo 'Database OK ✓' resources: - {{- toYaml .Values.pgchecker.resources | nindent 12 }} + {{- toYaml .Values.dbchecker.resources | nindent 12 }} {{- end }} {{- with .Values.extraInitContainers }} {{- tpl . $ | nindent 8 }} @@ -73,33 +74,72 @@ spec: - name: keycloak securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.image.repository }}{{- if (.Values.image.digest) -}}@{{ .Values.image.digest }}{{- else -}}:{{ .Values.image.tag | default .Chart.AppVersion }} {{- end }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.command }} command: {{- toYaml .Values.command | nindent 12 }} + {{- end }} + {{- if .Values.args }} args: {{- toYaml .Values.args | nindent 12 }} + {{- end }} {{- with .Values.lifecycleHooks }} lifecycle: {{- tpl . $ | nindent 12 }} {{- end }} env: - {{- if .Values.postgresql.enabled }} - - name: DB_VENDOR - value: postgres - - name: DB_ADDR - value: {{ include "keycloak.postgresql.fullname" . }} - - name: DB_PORT - value: {{ .Values.postgresql.service.port | quote }} - - name: DB_DATABASE - value: {{ .Values.postgresql.postgresqlDatabase | quote }} - - name: DB_USER - value: {{ .Values.postgresql.postgresqlUsername | quote }} - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "keycloak.postgresql.fullname" . }} - key: postgresql-password + {{- if and (.Values.http.relativePath) (eq .Values.http.relativePath "/") }} + - name: KC_HTTP_RELATIVE_PATH + value: {{ tpl .Values.http.relativePath $ }} + {{ else }} + - name: KC_HTTP_RELATIVE_PATH + value: {{ tpl .Values.http.relativePath $ | trimSuffix "/" }} + {{- end }} + {{- if eq .Values.cache.stack "default" }} + - name: KC_CACHE + value: "ispn" + - name: KC_CACHE_STACK + value: "jdbc-ping" + {{- end }} + {{- if .Values.proxy.enabled }} + - name: KC_PROXY_HEADERS + value: {{ .Values.proxy.mode }} + {{- end }} + {{- if .Values.proxy.http.enabled }} + - name: KC_HTTP_ENABLED + value: "true" + {{- end }} + {{- if .Values.database.vendor }} + - name: KC_DB + value: {{ .Values.database.vendor }} + {{- end }} + {{- if .Values.database.hostname }} + - name: KC_DB_URL_HOST + value: {{ .Values.database.hostname }} + {{- end }} + {{- if .Values.database.port }} + - name: KC_DB_URL_PORT + value: {{ .Values.database.port | quote }} + {{- end }} + {{- if .Values.database.database }} + - name: KC_DB_URL_DATABASE + value: {{ .Values.database.database }} + {{- end }} + {{- if .Values.database.username }} + - name: KC_DB_USERNAME + value: {{ .Values.database.username }} + {{- end }} + {{- if or .Values.database.password .Values.database.existingSecret -}} + {{- include "keycloak.databasePasswordEnv" . | nindent 12 }} + {{- end }} + {{- if .Values.metrics.enabled }} + - name: KC_METRICS_ENABLED + value: "true" + {{- end }} + {{- if .Values.health.enabled }} + - name: KC_HEALTH_ENABLED + value: "true" {{- end }} {{- with .Values.extraEnv }} {{- tpl . $ | nindent 12 }} @@ -112,36 +152,36 @@ spec: - name: http containerPort: 8080 protocol: TCP + - name: '{{ .Values.http.internalPort }}' + containerPort: 9000 + protocol: TCP + {{- if .Values.service.httpsPort }} - name: https containerPort: 8443 protocol: TCP - - name: http-management - containerPort: 9990 - protocol: TCP + {{- end }} {{- with .Values.extraPorts }} {{- toYaml . | nindent 12 }} {{- end }} + {{- if .Values.health.enabled }} {{- with .Values.livenessProbe }} livenessProbe: {{- tpl . $ | nindent 12 }} {{- end }} + {{- if .Values.metrics.enabled }} {{- with .Values.readinessProbe }} readinessProbe: {{- tpl . $ | nindent 12 }} {{- end }} + {{- end}} {{- with .Values.startupProbe }} startupProbe: {{- tpl . $ | nindent 12 }} {{- end }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - {{- range $key, $value := .Values.startupScripts }} - - name: startup - mountPath: "/opt/jboss/startup-scripts/{{ $key }}" - subPath: "{{ $key }}" - readOnly: true - {{- end }} {{- with .Values.extraVolumeMounts }} {{- tpl . $ | nindent 12 }} {{- end }} @@ -196,3 +236,7 @@ spec: {{- with .Values.extraVolumes }} {{- tpl . $ | nindent 8 }} {{- end }} + {{- with .Values.volumeClaimTemplates }} + volumeClaimTemplates: + {{- tpl . $ | nindent 4 }} + {{- end }} diff --git a/manifests/helm/keycloak/18.4.0/templates/test/configmap-test.yaml b/manifests/helm/keycloakx/7.2.2/templates/test/configmap-test.yaml similarity index 59% rename from manifests/helm/keycloak/18.4.0/templates/test/configmap-test.yaml rename to manifests/helm/keycloakx/7.2.2/templates/test/configmap-test.yaml index 8dda781..5fde3a4 100644 --- a/manifests/helm/keycloak/18.4.0/templates/test/configmap-test.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/test/configmap-test.yaml @@ -3,27 +3,44 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "keycloak.fullname" . }}-test + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} annotations: helm.sh/hook: test helm.sh/hook-delete-policy: hook-succeeded data: + test.sh: | + #!/usr/bin/env bash + set -eu + + if ! python3 -c 'import selenium' &> /dev/null; then + echo 'Installing selenium module...' + python3 -m venv /tmp/test-venv + /tmp/test-venv/bin/pip install -q selenium + exec /tmp/test-venv/bin/python "$(dirname "$0")/test.py" + fi + + python3 "$(dirname "$0")/test.py" test.py: | import os from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait + from selenium.webdriver.chrome.options import Options from selenium.webdriver.support import expected_conditions - from urllib.parse import urlparse - print('Creating PhantomJS driver...') - driver = webdriver.PhantomJS(service_log_path='/tmp/ghostdriver.log') + print('Creating chrome driver in headless mode') + chrome_options = Options() + chrome_options.add_argument("--headless") + chrome_options.add_argument('--no-sandbox') + chrome_options.add_argument('--disable-dev-shm-usage') + driver = webdriver.Chrome(options=chrome_options) base_url = 'http://{{ include "keycloak.fullname" . }}-http{{ if ne 80 (int .Values.service.httpPort) }}:{{ .Values.service.httpPort }}{{ end }}' print('Opening Keycloak...') - driver.get('{0}/auth/admin/'.format(base_url)) + driver.get('{0}{{ tpl .Values.http.relativePath . | trimSuffix "/" }}/admin/'.format(base_url)) username = os.environ['KEYCLOAK_USER'] password = os.environ['KEYCLOAK_PASSWORD'] @@ -41,7 +58,7 @@ data: print('Clicking login button...') login_button.click() - WebDriverWait(driver, 30).until(lambda driver: '/auth/admin/master/console/' in driver.current_url) + WebDriverWait(driver, 30).until(lambda driver: '{{ tpl .Values.http.relativePath . | trimSuffix "/" }}/admin/master/console/' in driver.current_url) print('Admin console visible. Login successful.') diff --git a/manifests/helm/keycloak/18.4.0/templates/test/pod-test.yaml b/manifests/helm/keycloakx/7.2.2/templates/test/pod-test.yaml similarity index 81% rename from manifests/helm/keycloak/18.4.0/templates/test/pod-test.yaml rename to manifests/helm/keycloakx/7.2.2/templates/test/pod-test.yaml index 0f3defd..2ac8980 100644 --- a/manifests/helm/keycloak/18.4.0/templates/test/pod-test.yaml +++ b/manifests/helm/keycloakx/7.2.2/templates/test/pod-test.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Pod metadata: name: {{ include "keycloak.fullname" . }}-test + namespace: {{ include "keycloak.namespace" . }} labels: {{- include "keycloak.labels" . | nindent 4 }} app.kubernetes.io/component: test @@ -14,14 +15,14 @@ spec: {{- toYaml .Values.test.podSecurityContext | nindent 4 }} containers: - name: keycloak-test - image: "{{ .Values.test.image.repository }}:{{ .Values.test.image.tag }}" + image: "{{ .Values.test.image.repository }}{{- if (.Values.test.image.digest) -}}@{{ .Values.test.image.digest }}{{- else -}}:{{ .Values.test.image.tag }} {{- end }}" imagePullPolicy: {{ .Values.test.image.pullPolicy }} securityContext: {{- toYaml .Values.test.securityContext | nindent 8 }} command: - - python3 + - bash args: - - /tests/test.py + - /tests/test.sh env: - name: KEYCLOAK_USER valueFrom: diff --git a/manifests/helm/keycloak/18.4.0/values.schema.json b/manifests/helm/keycloakx/7.2.2/values.schema.json similarity index 70% rename from manifests/helm/keycloak/18.4.0/values.schema.json rename to manifests/helm/keycloakx/7.2.2/values.schema.json index e06e7c6..0278f89 100644 --- a/manifests/helm/keycloak/18.4.0/values.schema.json +++ b/manifests/helm/keycloakx/7.2.2/values.schema.json @@ -5,6 +5,63 @@ "image" ], "definitions": { + "httpRoute": { + "type": "object", + "properties": { + "annotations": { + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "labels": { + "type": "object" + }, + "parentRefs": { + "type": "array", + "items": { + "properties": { + "name": { + "type": "string" + }, + "sectionName": { + "type": "string" + } + } + } + }, + "hostnames": { + "type": "array", + "items": { + "type": "string" + } + }, + "rules": { + "type": "array", + "items": { + "$comment": "don't allow additionalProperties to make sure backendRefs isn't set by the user", + "additionalProperties": false, + "properties": { + "matches": { + "type": "array", + "items": { + "$comment": "don't allow additionalProperties, only path matcher supported", + "additionalProperties": false, + "properties": { + "path": { + "type": "object" + } + } + } + }, + "filters": { + "type": "array" + } + } + } + } + } + }, "image": { "type": "object", "required": [ @@ -21,6 +78,9 @@ }, "tag": { "type": ["string", "integer"] + }, + "digest": { + "type": "string" } } }, @@ -73,12 +133,36 @@ "extraVolumes": { "type": "string" }, + "volumeClaimTemplates": { + "type": "string" + }, "fullnameOverride": { "type": "string" }, "hostAliases": { "type": "array" }, + "http": { + "relativePath": "string", + "internalPort": "string", + "internalScheme": "string" + }, + "httpRoute": { + "allOf": [ + { "$ref": "#/definitions/httpRoute" }, + { + "type": "object", + "properties": { + "servicePort": { + "type": "integer" + }, + "console": { + "$ref": "#/definitions/httpRoute" + } + } + } + ] + }, "image": { "$ref": "#/definitions/image" }, @@ -161,12 +245,18 @@ "nameOverride": { "type": "string" }, + "namespaceOverride": { + "type": "string" + }, "nodeSelector": { "type": "object" }, - "pgchecker": { + "dbchecker": { "type": "object", "properties": { + "enabled": { + "type": "boolean" + }, "image": { "$ref": "#/definitions/image" }, @@ -220,8 +310,66 @@ "podSecurityContext": { "type": "object" }, - "postgresql": { - "type": "object" + "cache": { + "type": "object", + "properties": { + "stack": { + "type": "string" + } + } + }, + "proxy": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string" + } + } + }, + "metrics": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "health": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "database": { + "type": "object", + "properties": { + "vendor": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "database": { + "type": "string" + }, + "existingSecret": { + "type": "string" + } + } }, "priorityClassName": { "type": "string" @@ -314,19 +462,6 @@ "httpsPort": { "type": "integer" }, - "httpManagementNodePort": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "httpManagementPort": { - "type": "integer" - }, "labels": { "type": "object" }, @@ -346,6 +481,9 @@ "loadBalancerIP": { "type": "string" }, + "internalTrafficPolicy": { + "type": "string" + }, "sessionAffinity": { "type": "string" }, @@ -354,6 +492,20 @@ } } }, + "serviceHeadless": { + "type": "object", + "properties": { + "annotations": { + "type": "object" + }, + "extraPorts": { + "type": "array" + }, + "labels": { + "type": "object" + } + } + }, "serviceAccount": { "type": "object", "properties": { @@ -363,6 +515,9 @@ "create": { "type": "boolean" }, + "allowReadPods": { + "type": "boolean" + }, "imagePullSecrets": { "$ref": "#/definitions/imagePullSecrets" }, @@ -371,6 +526,9 @@ }, "name": { "type": "string" + }, + "automountServiceAccountToken": { + "type": "boolean" } } }, @@ -385,9 +543,6 @@ } } }, - "startupScripts": { - "type": "object" - }, "statefulsetAnnotations": { "type": "object" }, diff --git a/manifests/helm/keycloak/18.4.0/values.yaml b/manifests/helm/keycloakx/7.2.2/values.yaml similarity index 62% rename from manifests/helm/keycloak/18.4.0/values.yaml rename to manifests/helm/keycloakx/7.2.2/values.yaml index ec1d2f2..a089713 100644 --- a/manifests/helm/keycloak/18.4.0/values.yaml +++ b/manifests/helm/keycloakx/7.2.2/values.yaml @@ -4,6 +4,10 @@ fullnameOverride: "" # Optionally override the name nameOverride: "" +# Optionally override the namespace for all resources. Useful for umbrella charts that +# deploy multiple aliased keycloak instances each into their own namespace. +namespaceOverride: "" + # The number of replicas to create (has no effect if autoscaling enabled) replicas: 1 @@ -11,7 +15,9 @@ image: # The Keycloak image repository repository: quay.io/keycloak/keycloak # Overrides the Keycloak image tag whose default is the chart appVersion - tag: "" + tag: "26.6.4" + # Overrides the Keycloak image tag with a specific digest + digest: "" # The Keycloak image pull policy pullPolicy: IfNotPresent @@ -29,17 +35,22 @@ hostAliases: [] enableServiceLinks: true # Pod management policy. One of `Parallel` or `OrderedReady` -podManagementPolicy: Parallel +podManagementPolicy: OrderedReady # StatefulSet's update strategy updateStrategy: RollingUpdate +# StatefulSet's revision history limit (number of old ReplicaSets to retain). Defaults to 10 if not set +revisionHistoryLimit: "" + # Pod restart policy. One of `Always`, `OnFailure`, or `Never` restartPolicy: Always serviceAccount: # Specifies whether a ServiceAccount should be created create: true + # Specifies whether the ServiceAccount can get and list pods + allowReadPods: false # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template name: "" @@ -49,6 +60,8 @@ serviceAccount: labels: {} # Image pull secrets that are attached to the ServiceAccount imagePullSecrets: [] + # Automount API credentials for the Service Account + automountServiceAccountToken: true rbac: create: false @@ -77,7 +90,7 @@ extraInitContainers: "" # When using service meshes which rely on a sidecar, it may be necessary to skip init containers altogether, # since the sidecar doesn't start until the init containers are done, and the sidecar may be required # for network access. -# For example, Istio in strict mTLS mode prevents the pgchecker init container from ever completing +# For example, Istio in strict mTLS mode prevents the dbchecker init container from ever completing skipInitContainers: false # Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy @@ -106,14 +119,8 @@ args: [] # Additional environment variables for Keycloak extraEnv: "" - # - name: KEYCLOAK_LOGLEVEL + # - name: KC_LOG_LEVEL # value: DEBUG - # - name: WILDFLY_LOGLEVEL - # value: DEBUG - # - name: CACHE_OWNERS_COUNT - # value: "2" - # - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT - # value: "2" # Additional environment variables for Keycloak mapped from Secret or ConfigMap extraEnvFrom: "" @@ -145,7 +152,7 @@ affinity: | operator: NotIn values: - test - topologyKey: failure-domain.beta.kubernetes.io/zone + topologyKey: topology.kubernetes.io/zone # Topology spread constraints template topologySpreadConstraints: @@ -165,25 +172,28 @@ podAnnotations: {} # Liveness probe configuration livenessProbe: | httpGet: - path: /auth/ - port: http + path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/health/live' + port: '{{ .Values.http.internalPort }}' + scheme: '{{ .Values.http.internalScheme }}' initialDelaySeconds: 0 timeoutSeconds: 5 # Readiness probe configuration readinessProbe: | httpGet: - path: /auth/realms/master - port: http - initialDelaySeconds: 30 + path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/health/ready' + port: '{{ .Values.http.internalPort }}' + scheme: '{{ .Values.http.internalScheme }}' + initialDelaySeconds: 10 timeoutSeconds: 1 # Startup probe configuration startupProbe: | httpGet: - path: /auth/ - port: http - initialDelaySeconds: 30 + path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/health' + port: '{{ .Values.http.internalPort }}' + scheme: '{{ .Values.http.internalScheme }}' + initialDelaySeconds: 15 timeoutSeconds: 1 failureThreshold: 60 periodSeconds: 5 @@ -197,19 +207,20 @@ resources: {} # cpu: "500m" # memory: "1024Mi" -# Startup scripts to run before Keycloak starts up -startupScripts: - # WildFly CLI script for configuring the node-identifier - keycloak.cli: | - {{- .Files.Get "scripts/keycloak.cli" }} - # mystartup.sh: | - # #!/bin/sh - # - # echo 'Hello from my custom startup script!' - # Add additional volumes, e. g. for custom themes extraVolumes: "" +# Add volume claim templates to the StatefulSet, e. g. for dynamic provisioning +volumeClaimTemplates: "" + # - metadata: + # name: themes + # spec: + # accessModes: [ "ReadWriteOncePod" ] + # storageClassName: "my-storage-class" + # resources: + # requests: + # storage: 1Gi + # Add additional volumes mounts, e. g. for custom themes extraVolumeMounts: "" @@ -237,9 +248,9 @@ secrets: {} # data: {} service: - # Annotations for headless and HTTP Services + # Annotations for HTTP service annotations: {} - # Additional labels for headless and HTTP Services + # Additional labels for HTTP Service labels: {} # key: value # The Service type @@ -254,26 +265,83 @@ service: httpsPort: 8443 # The HTTPS Service node port if type is NodePort httpsNodePort: null - # The WildFly management Service port - httpManagementPort: 9990 - # The WildFly management Service node port if type is NodePort - httpManagementNodePort: null # Additional Service ports, e. g. for custom admin console extraPorts: [] # When using Service type LoadBalancer, you can restrict source ranges allowed # to connect to the LoadBalancer, e. g. will result in Security Groups # (or equivalent) with inbound source ranges allowed to connect loadBalancerSourceRanges: [] - # When using Service type LoadBalancer, you can preserve the source IP seen in the container + # When using Service type LoadBalancer or NodePort, you can preserve the source IP seen in the container # by changing the default (Cluster) to be Local. # See https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip externalTrafficPolicy: "Cluster" + # Controls how traffic from internal sources is routed. Valid values: Cluster, Local. + # See https://kubernetes.io/docs/concepts/services-networking/service-traffic-policy/ + internalTrafficPolicy: "" # Session affinity # See https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-userspace sessionAffinity: "" # Session affinity config sessionAffinityConfig: {} +serviceHeadless: + # Annotations for headless service + annotations: {} + # Additional labels for headless service + labels: {} + # Add additional ports to the headless service, e. g. for admin console or exposing JGroups ports + extraPorts: [] + +# -- Expose the service via gateway-api HTTPRoute +# Requires Gateway API resources and suitable controller installed within the cluster +# (see: https://gateway-api.sigs.k8s.io/guides/) +httpRoute: + # HTTPRoute enabled. + enabled: false + # Additional HTTPRoute labels + labels: {} + # HTTPRoute annotations. + annotations: {} + # The Service port targeted by the HTTPRoute, MUST BE AN NUMBER + servicePort: 80 + # Which Gateways this Route is attached to. + parentRefs: + - name: gateway + sectionName: http + # namespace: default + # Hostnames matching HTTP header. + hostnames: + - chart-example.local + # List of rules and filters applied. + rules: + - matches: + - path: + type: PathPrefix + value: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/' + + # HTTPRoute for console only (/auth/admin) + console: + # If `true`, an HTTPRoute is created for console path only + enabled: false + # Additional HTTPRoute labels + labels: {} + # HTTPRoute annotations. + annotations: {} + # Which Gateways this Route is attached to. + parentRefs: + - name: gateway + sectionName: http + # namespace: default + # Hostnames matching HTTP header. + hostnames: + - chart-example.local + # List of rules and filters applied. + rules: + - matches: + - path: + type: PathPrefix + value: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/admin' + ingress: # If `true`, an Ingress is created enabled: false @@ -296,13 +364,15 @@ ingress: host: '{{ .Release.Name }}.keycloak.example.com' # Paths for the host paths: - - path: / + - path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/' pathType: Prefix + # serviceName: "" # Optional: Override backend service name (e.g., for AWS ALB action annotations) + # servicePort: "" # Optional: Override backend service port name # TLS configuration - tls: - - hosts: - - keycloak.example.com - secretName: "" + tls: [] + # - hosts: + # - keycloak.example.com + # secretName: "" # ingress for console only (/auth/admin) console: @@ -313,21 +383,27 @@ ingress: # Ingress annotations for console ingress only # Useful to set nginx.ingress.kubernetes.io/whitelist-source-range particularly annotations: {} + # Additional Ingress labels for console path only + labels: {} rules: - # Ingress host host: '{{ .Release.Name }}.keycloak.example.com' # Paths for the host paths: - - path: /auth/admin/ + - path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/admin' pathType: Prefix + # serviceName: "" # Optional: Override backend service name (e.g., for AWS ALB action annotations) + # servicePort: "" # Optional: Override backend service port name + # Console TLS configuration tls: [] -# - hosts: -# - console.keycloak.example.com -# secretName: "" + # - hosts: + # - console.keycloak.example.com + # secretName: "" ## Network policy configuration +# https://kubernetes.io/docs/concepts/services-networking/network-policies/ networkPolicy: # If true, the Network policies are deployed enabled: false @@ -336,9 +412,20 @@ networkPolicy: labels: {} # Define all other external allowed source - # See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#networkpolicypeer-v1-networking-k8s-io + # See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#networkpolicypeer-v1-networking-k8s-io extraFrom: [] + # Define egress networkpolicies for the Keycloak pods (external database for example) + # See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#networkpolicyegressrule-v1-networking-k8s-io + # egress: + # - to: + # - ipBlock: + # cidr: 192.168.1.30/32 + # ports: + # - protocol: TCP + # port: 3306 + egress: [] + route: # If `true`, an OpenShift Route is created enabled: false @@ -359,21 +446,22 @@ route: # TLS termination of the route. Can be `edge`, `passthrough`, or `reencrypt` termination: edge -pgchecker: +dbchecker: + enabled: false image: - # Docker image used to check Postgresql readiness at startup + # Docker image used to check Database readiness at startup repository: docker.io/busybox - # Image tag for the pgchecker image - tag: 1.32 - # Image pull policy for the pgchecker image + # Image tag for the dbchecker image + tag: 1.37 + # Image pull policy for the dbchecker image pullPolicy: IfNotPresent - # SecurityContext for the pgchecker container + # SecurityContext for the dbchecker container securityContext: allowPrivilegeEscalation: false runAsUser: 1000 runAsGroup: 1000 runAsNonRoot: true - # Resource requests and limits for the pgchecker container + # Resource requests and limits for the dbchecker container resources: requests: cpu: "20m" @@ -382,18 +470,41 @@ pgchecker: cpu: "20m" memory: "32Mi" -postgresql: - # If `true`, the Postgresql dependency is enabled +database: + # don't create secret for db password. Instead use existing k8s secret + # existingSecret: "my-existent-dbpass-secret" + # existingSecretKey: "password" + existingSecret: "" + existingSecretKey: "" + # E.g. dev-file, dev-mem, mariadb, mssql, mysql, oracle or postgres + vendor: + hostname: + port: + database: + username: + password: + +cache: + # Use "custom" to disable automatic cache configuration + stack: default + +proxy: enabled: true - # PostgreSQL User to create - postgresqlUsername: keycloak - # PostgreSQL Password for the new user - postgresqlPassword: keycloak - # PostgreSQL Database to create - postgresqlDatabase: keycloak - # PostgreSQL network policy configuration - networkPolicy: - enabled: false + mode: forwarded + http: + enabled: true + +metrics: + enabled: true + +health: + enabled: true + +http: + # For backwards compatibility reasons we set this to the value used by previous Keycloak versions. + relativePath: "/auth" + internalPort: http-internal + internalScheme: HTTP serviceMonitor: # If `true`, a ServiceMonitor resource for the prometheus-operator is created @@ -410,10 +521,16 @@ serviceMonitor: interval: 10s # Timeout for scraping scrapeTimeout: 10s + # Relabelings for the Servicemonitor + relabelings: [] + # metricRelabelings for the Servicemonitor + metricRelabelings: [] # The path at which metrics are served - path: /metrics + path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/metrics' # The Service port at which metrics are served - port: http-management + port: '{{ .Values.http.internalPort }}' + # The scheme to use for scraping metrics ("http" or "https"); if not set, the `http.internalScheme` value is used + scheme: "" extraServiceMonitor: # If `true`, a ServiceMonitor resource for the prometheus-operator is created @@ -430,14 +547,22 @@ extraServiceMonitor: interval: 10s # Timeout for scraping scrapeTimeout: 10s + # Relabelings for the Servicemonitor + relabelings: [] + # metricRelabelings for the Servicemonitor + metricRelabelings: [] # The path at which metrics are served - path: /auth/realms/master/metrics + path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/metrics' # The Service port at which metrics are served - port: http + port: '{{ .Values.http.internalPort }}' + # The scheme to use for scraping metrics ("http" or "https"); if not set, the `http.internalScheme` value is used + scheme: "" prometheusRule: # If `true`, a PrometheusRule resource for the prometheus-operator is created enabled: false + # Optionally sets a target namespace in which to deploy the ServiceMonitor resource + namespace: "" # Annotations for the PrometheusRule annotations: {} # Additional labels for the PrometheusRule @@ -466,7 +591,7 @@ prometheusRule: # severity: warning autoscaling: - # If `true`, a autoscaling/v2beta2 HorizontalPodAutoscaler resource is created (requires Kubernetes 1.18 or above) + # If `true`, an autoscaling/v2 HorizontalPodAutoscaler resource is created (requires Kubernetes 1.23 or above) # Autoscaling seems to be most reliable when using KUBE_PING service discovery (see README for details) # This disables the `replicas` field in the StatefulSet enabled: false @@ -498,17 +623,33 @@ test: enabled: false image: # The image for the test Pod - repository: docker.io/unguiculus/docker-python3-phantomjs-selenium + repository: docker.io/selenium/standalone-chromium # The tag for the test Pod image - tag: v1 + tag: "147.0" # The image pull policy for the test Pod image pullPolicy: IfNotPresent # SecurityContext for the entire test Pod podSecurityContext: - fsGroup: 1000 + fsGroup: 1200 # UID of seluser in selenium/standalone-chromium # SecurityContext for the test container securityContext: - runAsUser: 1000 + runAsUser: 1200 # UID of seluser in selenium/standalone-chromium runAsNonRoot: true # See https://helm.sh/docs/topics/charts_hooks/#hook-deletion-policies deletionPolicy: before-hook-creation + +## -- Extra Kubernetes objects to deploy with the helm chart +extraManifests: [] + # - | + # apiVersion: v1 + # kind: ConfigMap + # metadata: + # name: {{ include "keycloak.fullname" . }}-tpl + # data: + # foo: bar + # - apiVersion: v1 + # kind: ConfigMap + # metadata: + # name: "{{ include \"keycloak.fullname\" . }}-tpl" + # data: + # foo: bar