Skip to content

Commit dbec22b

Browse files
authored
Merge pull request #62 from bcgov/feat/helmchart
feat: publish helm charts
2 parents 597cd5f + 1257da5 commit dbec22b

20 files changed

+153
-110
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
nodejs 14.14.0
22
python 3.8.6
33
kubectl 1.18.0
4+
oc 4.7.5
45
helm 3.2.4
56
yarn 1.22.4
67
k6 0.34.1

helm/keycloak/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
22
name: sso-keycloak
3-
version: 0.1.6
3+
version: 0.1.7
44
appVersion: 0.1.0
55
description: Open Source Identity and Access Management For Modern Applications and Services

helm/keycloak/README.md

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,74 @@
1-
# Keycloak Helm Chart
1+
# SSO Keycloak Helm Chart
22

3-
The helm chart installs `Secret` k8s objects with the release name `sso-keycloak`.
3+
The `SSO Keycloak Helm Chart` provides a easy way to deploy (RedHat SSO)[https://access.redhat.com/products/red-hat-single-sign-on], which is specifically designed for BCGov SSO services, on Openshift.
44

5-
## Installing the Chart
5+
## Usages
66

7-
To install the chart on a specific namespace.
7+
### Add this chart repository
88

9-
```bash
10-
$ make install NAMESPACE=<namespace>
9+
```console
10+
$ helm repo add sso-keycloak https://bcgov.github.io/sso-keycloak
1111
```
1212

13-
To upgrade the chart on a specific namespace.
13+
### Install this chart repository
1414

15-
```bash
16-
$ make upgrade NAMESPACE=<namespace>
15+
```console
16+
$ helm install <release-name> sso-keycloak/sso-keycloak [--namespace <my-namespace>] [--version <x.y.z>] [--values ./custom-values.yaml]
1717
```
1818

19-
To uninstall the chart on a specific namespace.
19+
### Upgrade this chart repository
2020

21-
```bash
22-
$ make uninstall NAMESPACE=<namespace>
21+
```console
22+
$ helm upgrade <release-name> sso-keycloak/sso-keycloak [--namespace <my-namespace>] [--version <x.y.z>] [--values ./custom-values.yaml]
2323
```
2424

25-
To lint the chart on a specific namespace.
25+
### Uninstall this chart repository
2626

27-
```bash
28-
$ make lint NAMESPACE=<namespace>
27+
```console
28+
$ helm uninstall <release-name> [--namespace <my-namespace>]
2929
```
3030

3131
## Configuration
3232

3333
The following table lists the configurable parameters of the Keycloak chart and their default values.
3434

35-
Parameter | Description | Default
36-
--- | --- | ---
37-
`replicaCount` | Number of pods to create | `1`
38-
`image.repository` | container image repository | `ghcr.io/bcgov/sso`
39-
`image.tag` | container image tag | `dev`
40-
`image.pullPolicy` | container image pull policy | `Always`
41-
`nameOverride` | override for the chart name | `sso-keycloak`
42-
`fullNameOverride` | override for the full chart name | `sso-keycloak`
43-
`service.type` | type of service to create | `ClusterIP`
44-
`service.port` | port of service | `8080`
45-
`pingService.enabled` | enable DNS ping | `true`
46-
`pingService.port` | exposed port of ping service | `8888`
47-
`postgres.host` | host of postgres service | `sso-pgsql-master`
48-
`postgres.dbName` | name of database | `rhsso`
49-
`postgres.port` | exposed port of database | `5432`
50-
`postgres.credentials.secret` | name of secret containing database credentials | `sso-pgsql`
51-
`postgres.credentials.adminUsername` | name of admin database user | `postgres`
52-
`postgres.credentials.passwordKey` | Secret key of admin password | `password-superuser`
53-
`postgres.poolSize.min` | Minimum pool size | `5`
54-
`postgres.poolSize.max` | Maximum pool size | `20`
55-
`jgroupsCluster.secret` | Name of secret | `2`
56-
`jgroupsCluster.passwordKey` | Secret key for password | `password`
57-
`additionalServerOptions` | Additional command line options for server | `-Dkeycloak.profile.feature.authorization=enabled -Djboss.persistent.log.dir=/var/log/eap`
58-
`tls.enabled` | Enable tls | `false`
59-
`tls.httpsSecret` | Name of secret for tls cert | `sso-x509-https-secret`
60-
`tls.jgroupsSecret` | Name of secret for jgroups | `sso-x509-jgroups-secret`
61-
`persistentLog.enabled` | Enable persistent logs | `true`
62-
`persistentLog.storageClassName` | Storage class name of volume | `netapp-file-standard`
63-
`persistentLog.path` | Path to save logs | `/var/log/eap`
64-
`resources.limits.memory` | memory limit for pods | `2Gi`
65-
`resources.limits.cpu` | CPU limit for pods | `2`
66-
`resources.requests.cpu` | cpu request for pods | `1250m`
67-
`resources.requests.memory` | memory request for pods | `1Gi`
68-
`nodeSelector` | node labels for pod assignment | `{}`
69-
`tolerations` | toleration settings | `[]`
70-
`affinity` | affinity settings | `{}`
35+
| Parameter | Description | Default |
36+
| ------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
37+
| `replicaCount` | Number of pods to create | `1` |
38+
| `image.repository` | container image repository | `ghcr.io/bcgov/sso` |
39+
| `image.tag` | container image tag | `dev` |
40+
| `image.pullPolicy` | container image pull policy | `Always` |
41+
| `nameOverride` | override for the chart name | `sso-keycloak` |
42+
| `fullNameOverride` | override for the full chart name | `sso-keycloak` |
43+
| `service.type` | type of service to create | `ClusterIP` |
44+
| `service.port` | port of service | `8080` |
45+
| `pingService.enabled` | enable DNS ping | `true` |
46+
| `pingService.port` | exposed port of ping service | `8888` |
47+
| `postgres.host` | host of postgres service | `sso-pgsql-master` |
48+
| `postgres.dbName` | name of database | `rhsso` |
49+
| `postgres.port` | exposed port of database | `5432` |
50+
| `postgres.credentials.secret` | name of secret containing database credentials | `sso-pgsql` |
51+
| `postgres.credentials.adminUsername` | name of admin database user | `postgres` |
52+
| `postgres.credentials.passwordKey` | Secret key of admin password | `password-superuser` |
53+
| `postgres.poolSize.min` | Minimum pool size | `5` |
54+
| `postgres.poolSize.max` | Maximum pool size | `20` |
55+
| `additionalServerOptions` | Additional command line options for server | `-Dkeycloak.profile.feature.authorization=enabled -Djboss.persistent.log.dir=/var/log/eap` |
56+
| `tls.enabled` | Enable tls | `false` |
57+
| `tls.httpsSecret` | Name of secret for tls cert | `sso-x509-https-secret` |
58+
| `tls.jgroupsSecret` | Name of secret for jgroups | `sso-x509-jgroups-secret` |
59+
| `persistentLog.enabled` | Enable persistent logs | `true` |
60+
| `persistentLog.storageClassName` | Storage class name of volume | `netapp-file-standard` |
61+
| `persistentLog.path` | Path to save logs | `/var/log/eap` |
62+
| `resources.limits.memory` | memory limit for pods | `2Gi` |
63+
| `resources.limits.cpu` | CPU limit for pods | `2` |
64+
| `resources.requests.cpu` | cpu request for pods | `1250m` |
65+
| `resources.requests.memory` | memory request for pods | `1Gi` |
66+
| `nodeSelector` | node labels for pod assignment | `{}` |
67+
| `tolerations` | toleration settings | `[]` |
68+
| `affinity` | affinity settings | `{}` |
69+
70+
### Notes
71+
72+
- The helm chart installs two `Secret` k8s objects:
73+
1. `<release-name>-admin-secret`: it stores the Keycloak admin password.
74+
1. `<release-name>-jgroups`: it stores the Keycloak cluster jgroups password.

helm/keycloak/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ spec:
112112
- name: JGROUPS_CLUSTER_PASSWORD
113113
valueFrom:
114114
secretKeyRef:
115-
name: {{ .Values.jgroupCluster.secret }}
116-
key: {{ .Values.jgroupCluster.passwordKey }}
115+
name: {{ include "..fullname" . }}-jgroups
116+
key: cluster-password
117117
# Additional server startup options (extension of JAVA_OPTS)
118118
- name: JAVA_OPTS_APPEND
119119
value: {{ .Values.additionalServerOptions }}

helm/keycloak/templates/pvc-logs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.pingService.enabled }}
1+
{{- if .Values.persistentLog.enabled }}
22
apiVersion: v1
33
kind: PersistentVolumeClaim
44
metadata:

helm/keycloak/templates/secret.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@ metadata:
1313
type: Opaque
1414
data:
1515
password-admin: {{ randAlphaNum 32 | b64enc | quote }}
16+
---
17+
apiVersion: v1
18+
kind: Secret
19+
metadata:
20+
name: {{ include "..fullname" . }}-jgroups
21+
labels:
22+
app: {{ include "..fullname" . }}
23+
chart: {{ include "..chart" . }}
24+
release: {{ .Release.Name }}
25+
heritage: {{ .Release.Service }}
26+
annotations:
27+
"helm.sh/hook": "pre-install"
28+
"helm.sh/hook-delete-policy": "before-hook-creation"
29+
type: Opaque
30+
data:
31+
cluster-password: {{ randAlphaNum 32 | b64enc | quote }}

helm/keycloak/values-3d5c3f-dev.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ postgres:
1414
admin:
1515
secret: sso-admin-dev
1616

17-
jgroupCluster:
18-
secret: sso-jgroups-dev
19-
2017
tls:
2118
enabled: true
2219

helm/keycloak/values-3d5c3f-prod.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ postgres:
1414
admin:
1515
secret: sso-admin-prod
1616

17-
jgroupCluster:
18-
secret: sso-jgroups-prod
19-
2017
tls:
2118
enabled: true
2219

helm/keycloak/values-3d5c3f-test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ postgres:
1818
adminUsername: postgres
1919
passwordKey: password-superuser
2020

21-
jgroupCluster:
22-
secret: sso-jgroups-test
23-
2421
tls:
2522
enabled: true
2623

helm/keycloak/values-6d70e7-dev.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ postgres:
1414
admin:
1515
secret: sso-admin-dev
1616

17-
jgroupCluster:
18-
secret: sso-jgroups-dev
19-
2017
tls:
2118
enabled: true
2219

helm/keycloak/values-6d70e7-prod.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ postgres:
1414
admin:
1515
secret: sso-admin-prod
1616

17-
jgroupCluster:
18-
secret: sso-jgroups-prod
19-
2017
tls:
2118
enabled: true
2219

helm/keycloak/values-6d70e7-test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ postgres:
1414
admin:
1515
secret: sso-admin-test
1616

17-
jgroupCluster:
18-
secret: sso-jgroups-test
19-
2017
tls:
2118
enabled: true
2219

helm/keycloak/values-b861c7-test.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
replicaCount: 2
2+
3+
image:
4+
tag: 7.4-37-rc.2
5+
6+
service:
7+
type: ClusterIP
8+
port: 8443
9+
10+
postgres:
11+
host: sso-patroni
12+
credentials:
13+
secret: sso-patroni
14+
15+
tls:
16+
enabled: true
17+
18+
resources:
19+
limits:
20+
cpu: 2
21+
memory: 2Gi
22+
requests:
23+
cpu: 1250m
24+
memory: 2Gi

helm/keycloak/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ postgres:
3232
min: 5
3333
max: 20
3434

35-
jgroupCluster:
36-
secret: sso-jgroups
37-
passwordKey: password
38-
3935
# see https://github.com/keycloak/keycloak-containers/blob/master/server/README.md#start-a-keycloak-instance-with-custom-command-line-options
4036
additionalServerOptions: "-Dkeycloak.profile.feature.authorization=enabled -Djboss.persistent.log.dir=/var/log/eap"
4137

helm/patroni/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: patroni
33
description: "Highly available elephant herd: HA PostgreSQL cluster."
4-
version: 0.16.7
4+
version: 0.16.8
55
appVersion: 1.5-p5
66
home: https://github.com/zalando/patroni
77
sources:

helm/patroni/README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,35 @@ This chart will do the following:
1313

1414
- Implement a HA scalable PostgreSQL 10 cluster using a Kubernetes StatefulSet.
1515

16-
## Installing the Chart
16+
## Usages
1717

18-
To add dependencies:
18+
### Add this chart repository
1919

2020
```console
21-
helm dependency build
21+
$ helm repo add sso-keycloak https://bcgov.github.io/sso-keycloak
22+
$ helm dependency update
2223
```
2324

24-
To install the chart with the release name `patroni`:
25+
### Install this chart repository
2526

2627
```console
27-
$ helm install patroni . -n <namespace>
28+
$ helm install <release-name> sso-keycloak/patroni [--namespace <my-namespace>] [--version <x.y.z>] [--values ./custom-values.yaml]
29+
30+
# To install the chart with randomly generated passwords:
31+
$ helm install patroni . \
32+
--set credentials.superuser="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)",credentials.admin="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)",credentials.standby="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)"
2833
```
2934

30-
To install the chart with randomly generated passwords:
35+
### Upgrade this chart repository
3136

3237
```console
33-
$ helm install patroni . \
34-
--set credentials.superuser="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)",credentials.admin="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)",credentials.standby="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)"
38+
$ helm upgrade <release-name> sso-keycloak/patroni [--namespace <my-namespace>] [--version <x.y.z>] [--values ./custom-values.yaml]
39+
```
40+
41+
### Uninstall this chart repository
42+
43+
```console
44+
$ helm uninstall <release-name> [--namespace <my-namespace>]
3545
```
3646

3747
## Configuration
@@ -46,6 +56,7 @@ The following table lists the configurable parameters of the patroni chart and t
4656
| `image.repository` | The image to pull | `registry.opensource.zalan.do/acid/spilo-10` |
4757
| `image.tag` | The version of the image to pull | `1.5-p5` |
4858
| `image.pullPolicy` | The pull policy | `IfNotPresent` |
59+
| `credentials.random` | Using passwords created randomly | `true` |
4960
| `credentials.superuser` | Password of the superuser | `tea` |
5061
| `credentials.admin` | Password of the admin | `cola` |
5162
| `credentials.standby` | Password of the replication user | `pinacolada` |
@@ -88,17 +99,9 @@ The following table lists the configurable parameters of the patroni chart and t
8899

89100
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
90101

91-
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
92-
93-
```console
94-
$ helm install --name my-release -f values.yaml incubator/patroni
95-
```
96-
97-
> **Tip**: You can use the default [values.yaml](values.yaml)
98-
99102
## Cleanup
100103

101-
To remove the spawned pods you can run a simple `helm delete <release-name>`.
104+
To remove the spawned pods you can run a simple `helm uninstall <release-name> [--namespace <my-namespace>]`.
102105

103106
Helm will however preserve created persistent volume claims and configmaps,
104107
to also remove them execute the commands below.
@@ -110,8 +113,6 @@ $ kubectl delete pvc -l release=$release
110113
$ kubectl delete configmaps -l release=$release
111114
```
112115

113-
114-
115116
## Internals
116117

117118
Patroni is responsible for electing a PostgreSQL master pod by leveraging the

helm/patroni/requirements.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ dependencies:
88
- name: consul
99
repository: https://charts.helm.sh/stable
1010
version: 3.6.1
11-
digest: sha256:1d1ed086586703e7cdc528c6d44e5c03f68f3f4fddfc713e50898eff18dc5acf
12-
generated: "2020-10-30T00:42:58.035153-04:00"
11+
digest: sha256:f9ef1101460c219c9cef3c44b360d1c9d4b206f56eaa95fae98f95ca76a92781
12+
generated: "2021-12-15T11:37:39.9090521-08:00"

helm/patroni/templates/ep-patroni.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)