Skip to content

Commit

Permalink
Support for native Kubernetes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Block <andy.block@gmail.com>
  • Loading branch information
sabre1041 committed Dec 27, 2023
1 parent 2810932 commit b279105
Show file tree
Hide file tree
Showing 37 changed files with 1,436 additions and 741 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Set up Helm
uses: azure/setup-helm@b5b231a831f96336bbfeccc1329990f0005c5bb1 # pin@v3.3
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # pin@v3.5
with:
version: v3.9.3
version: v3.13.2

- name: Run chart-releaser
uses: helm/chart-releaser-action@a3454e46a6f5ac4811069a381e646961dda2e1bf # pin@v1.4.0
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # pin@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
with:
fetch-depth: 0

- uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 # pin@v2.5.0
- uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # pin@v3.3.0

- name: Set up Helm
uses: azure/setup-helm@b5b231a831f96336bbfeccc1329990f0005c5bb1 # pin@v3.3
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # pin@v3.5
with:
version: v3.9.3
version: v3.13.2

- uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # pin@v4
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@09ed88797198755e5031f25be13da255e7e33aad # pin@v2.3.0
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # pin@v2.6.1

- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
Expand Down
5 changes: 4 additions & 1 deletion charts/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apiVersion: v2
name: postgresql
description: Postgresql Helm Chart
version: 0.3.2
version: 0.4.0
home: https://project-telescope.com
sources:
- https://github.com/RH-Telescope/helm-charts
39 changes: 39 additions & 0 deletions charts/postgresql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# postgresql

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square)

Postgresql Helm Chart

**Homepage:** <https://project-telescope.com>

## Source Code

* <https://github.com/RH-Telescope/helm-charts>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| postgresql.autogenImage | string | `"docker.io/bitnami/kubectl:latest"` | |
| postgresql.autogenPassword | bool | `true` | |
| postgresql.database | string | `"telescope"` | |
| postgresql.envVarKeys.database | string | `"POSTGRES_DB"` | |
| postgresql.envVarKeys.password | string | `"POSTGRES_PASSWORD"` | |
| postgresql.envVarKeys.user | string | `"POSTGRES_USER"` | |
| postgresql.external | bool | `false` | |
| postgresql.image | string | `"docker.io/postgres:13"` | |
| postgresql.port | int | `5432` | |
| postgresql.resources.limits.cpu | string | `"400m"` | |
| postgresql.resources.limits.memory | string | `"596Mi"` | |
| postgresql.resources.requests.cpu | string | `"100m"` | |
| postgresql.resources.requests.memory | string | `"128Mi"` | |
| postgresql.storage.enabled | bool | `true` | |
| postgresql.storage.mountPath | string | `"/var/lib/postgresql"` | |
| postgresql.storage.size | string | `"2Gi"` | |
| postgresql.storage.storageClass | string | `""` | |
| postgresql.user | string | `"telescope"` | |
| resources | object | `{}` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |

----------------------------------------------
12 changes: 6 additions & 6 deletions charts/postgresql/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ spec:
containers:
- name: postgresql
env:
- name: POSTGRESQL_PASSWORD
- name: {{ .Values.postgresql.envVarKeys.password }}
valueFrom:
secretKeyRef:
name: {{ include "postgresql.fullname" . }}
key: databasePassword
- name: POSTGRESQL_USER
- name: {{ .Values.postgresql.envVarKeys.user }}
valueFrom:
secretKeyRef:
name: {{ include "postgresql.fullname" . }}
key: databaseUser
- name: POSTGRESQL_DATABASE
- name: {{ .Values.postgresql.envVarKeys.database }}
valueFrom:
secretKeyRef:
name: {{ include "postgresql.fullname" . }}
Expand All @@ -41,7 +41,7 @@ spec:
protocol: TCP
{{- if .Values.postgresql.storage.enabled }}
volumeMounts:
- mountPath: /var/lib/pgsql/data
- mountPath: {{ .Values.postgresql.storage.mountPath }}
name: postgresdb
{{- end }}
terminationMessagePolicy: File
Expand All @@ -56,7 +56,7 @@ spec:
command:
- /bin/sh
- -c
- exec pg_isready -U "$POSTGRESQL_USER" -d "dbname=$POSTGRESQL_DATABASE" -h 127.0.0.1 -p {{ .Values.postgresql.port }}
- exec pg_isready -U "${{ .Values.postgresql.envVarKeys.user }}" -d "dbname=${{ .Values.postgresql.envVarKeys.database }}" -h 127.0.0.1 -p {{ .Values.postgresql.port }}
readinessProbe:
failureThreshold: 6
initialDelaySeconds: 5
Expand All @@ -68,7 +68,7 @@ spec:
- /bin/sh
- -c
- -e
- exec pg_isready -U "$POSTGRESQL_USER" -d "dbname=$POSTGRESQL_DATABASE" -h 127.0.0.1 -p {{ .Values.postgresql.port }}
- exec pg_isready -U "${{ .Values.postgresql.envVarKeys.user }}" -d "dbname=${{ .Values.postgresql.envVarKeys.database }}" -h 127.0.0.1 -p {{ .Values.postgresql.port }}
serviceAccount: {{ include "postgresql.serviceAccountName" . }}
volumes:
- name: postgresdb
Expand Down
11 changes: 11 additions & 0 deletions charts/postgresql/values-openshift.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

postgresql:
storage:
mountPath: /var/lib/pgsql/data
envVarKeys:
database: POSTGRESQL_DATABASE
user: POSTGRESQL_USER
password: POSTGRESQL_PASSWORD
image: registry.redhat.io/rhel9/postgresql-13:latest
autogenImage: registry.redhat.io/openshift4/ose-cli:latest
65 changes: 56 additions & 9 deletions charts/postgresql/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,19 @@
"examples": [
""
]
},
"mountPath": {
"type": "string",
"examples": [
"/var/lib/postgresql"
]
}
},
"examples": [{
"enabled": true,
"size": "2Gi",
"storageClass": ""
"storageClass": "",
"mountPath": "/var/lib/postgresql"
}]
},
"user": {
Expand All @@ -51,6 +58,34 @@
"telescope"
]
},
"envVarKeys": {
"type": "object",
"properties": {
"database": {
"type": "string",
"examples": [
"POSTGRES_DB"
]
},
"user": {
"type": "string",
"examples": [
"POSTGRES_USER"
]
},
"password": {
"type": "string",
"examples": [
"POSTGRES_PASSWORD"
]
}
},
"examples": [{
"database": "POSTGRES_DB",
"user": "POSTGRES_USER",
"password": "POSTGRES_PASSWORD"
}]
},
"autogenPassword": {
"type": "boolean",
"examples": [
Expand All @@ -66,13 +101,13 @@
"image": {
"type": "string",
"examples": [
"registry.redhat.io/rhel9/postgresql-13:latest"
"docker.io/postgres:13"
]
},
"autogenImage": {
"type": "string",
"examples": [
"registry.redhat.io/openshift4/ose-cli:latest"
"docker.io/bitnami/kubectl:latest"
]
},
"resources": {
Expand Down Expand Up @@ -138,14 +173,20 @@
"storage": {
"enabled": true,
"size": "2Gi",
"storageClass": ""
"storageClass": "",
"mountPath": "/var/lib/postgresql"
},
"user": "telescope",
"database": "telescope",
"envVarKeys": {
"database": "POSTGRES_DB",
"user": "POSTGRES_USER",
"password": "POSTGRES_PASSWORD"
},
"autogenPassword": true,
"port": 5432,
"image": "registry.redhat.io/rhel9/postgresql-13:latest",
"autogenImage": "registry.redhat.io/openshift4/ose-cli:latest",
"image": "docker.io/postgres:13",
"autogenImage": "docker.io/bitnami/kubectl:latest",
"resources": {
"limits": {
"cpu": "400m",
Expand Down Expand Up @@ -190,14 +231,20 @@
"storage": {
"enabled": true,
"size": "2Gi",
"storageClass": ""
"storageClass": "",
"mountPath": "/var/lib/postgresql"
},
"user": "telescope",
"database": "telescope",
"envVarKeys": {
"database": "POSTGRES_DB",
"user": "POSTGRES_USER",
"password": "POSTGRES_PASSWORD"
},
"autogenPassword": true,
"port": 5432,
"image": "registry.redhat.io/rhel9/postgresql-13:latest",
"autogenImage": "registry.redhat.io/openshift4/ose-cli:latest",
"image": "docker.io/postgres:13",
"autogenImage": "docker.io/bitnami/kubectl:latest",
"resources": {
"limits": {
"cpu": "400m",
Expand Down
10 changes: 8 additions & 2 deletions charts/postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ postgresql:
enabled: true
size: 2Gi
storageClass: ""
mountPath: /var/lib/postgresql
## Paas Required config
# storageClass: "aws-efs-tier-c3"
# labels:
# paas.redhat.com/appcode: "ASBL-001"
user: telescope
database: telescope
envVarKeys:
database: POSTGRES_DB
user: POSTGRES_USER
password: POSTGRES_PASSWORD

## If using external db set the host
# host: "example.com"

Expand All @@ -21,8 +27,8 @@ postgresql:
## If using external instance supply the password
# password: "somepassword"
port: 5432
image: registry.redhat.io/rhel9/postgresql-13:latest
autogenImage: registry.redhat.io/openshift4/ose-cli:latest
image: docker.io/postgres:13
autogenImage: docker.io/bitnami/kubectl:latest
resources:
limits:
cpu: 400m
Expand Down
5 changes: 4 additions & 1 deletion charts/telescope-argocd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apiVersion: v2
name: telescope-argocd
description: Chart to deploy Argo CD Applications Supporting Telescope
version: 0.3.0
version: 0.4.0
home: https://project-telescope.com
sources:
- https://github.com/RH-Telescope/helm-charts
31 changes: 31 additions & 0 deletions charts/telescope-argocd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# telescope-argocd

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square)

Chart to deploy Argo CD Applications Supporting Telescope

**Homepage:** <https://project-telescope.com>

## Source Code

* <https://github.com/RH-Telescope/helm-charts>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| chartVersion | string | `"x"` | |
| charts.postgresql.enabled | bool | `true` | |
| charts.telescope-backend.enabled | bool | `true` | |
| charts.telescope-frontend.enabled | bool | `true` | |
| defaultSyncPolicy.automated.prune | bool | `false` | |
| defaultSyncPolicy.automated.selfHeal | bool | `true` | |
| defaultSyncPolicy.retry.backoff.duration | string | `"15s"` | |
| defaultSyncPolicy.retry.backoff.factor | int | `2` | |
| defaultSyncPolicy.retry.backoff.maxDuration | string | `"5m"` | |
| defaultSyncPolicy.retry.limit | int | `5` | |
| destinationServer | string | `"https://kubernetes.default.svc"` | |
| gitOpsNamespace | string | `"openshift-gitops"` | |
| repoURL | string | `"https://rh-telescope.github.io/helm-charts"` | |

----------------------------------------------
4 changes: 4 additions & 0 deletions charts/telescope-argocd/templates/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ spec:
values: |
{{- toYaml $chart.values | nindent 8 }}
{{- end }}
{{- if $chart.valueFiles }}
valueFiles: |
{{- toYaml $chart.valueFiles | nindent 8 }}
{{- end }}
syncPolicy:
{{- toYaml (default $.Values.defaultSyncPolicy $chart.syncPolicy) | nindent 4 }}
{{- end }}
Expand Down
Loading

0 comments on commit b279105

Please sign in to comment.