Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into make-required-values-…
Browse files Browse the repository at this point in the history
…mandatory-in-postgrest
  • Loading branch information
colearendt committed Jul 29, 2023
2 parents 033e5cb + bbd89b6 commit 203098b
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/chart-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: r-lib/actions/pr-fetch@main
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -40,6 +40,6 @@ jobs:
git config --local user.name "GitHub Actions"
git commit charts/*/README.md -m 'Update helm-docs and README.md' || echo "No changes to commit"
- uses: r-lib/actions/pr-push@main
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# charts to ignore
charts/nfs-subdir-external-provisioner
bin/
2 changes: 1 addition & 1 deletion charts/generic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: generic
description: A generic Helm chart for Kubernetes

type: application
version: 0.2.6
version: 0.2.7
appVersion: latest
maintainers:
- name: colearendt
Expand Down
8 changes: 8 additions & 0 deletions charts/generic/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 0.2.7

- Add support for `pod.otherPorts` and `service.otherPorts` with verbatim spec exposed
- Add support for `service.portName` (which gets used by `pod.container.port` too)
- Beware that the `readinessProbe` does target port `http` by default. This does not change automatically
- Allow `image@sha256:12345` type image references dynamically by allowing `tag` to be a `sha256:` value
- Add support for `pod.initContainers` and `pod.otherContainers`

# 0.2.6

- Fix issue with `NOTES.txt` displaying ingress wrong
Expand Down
11 changes: 8 additions & 3 deletions charts/generic/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# generic

![Version: 0.2.6](https://img.shields.io/badge/Version-0.2.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 0.2.7](https://img.shields.io/badge/Version-0.2.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

## Installing the Chart

To install the chart with the release name `my-release` at version 0.2.6:
To install the chart with the release name `my-release` at version 0.2.7:

```bash
helm repo add colearendt https://colearendt.github.io/helm
helm install my-release colearendt/generic --version=0.2.6
helm install my-release colearendt/generic --version=0.2.7
```

#### _A generic Helm chart for Kubernetes_
Expand Down Expand Up @@ -47,7 +47,10 @@ helm install my-release colearendt/generic --version=0.2.6
| nodeSelector | object | `{}` | |
| pod.annotations | object | `{}` | Additional annotations to add to the pods |
| pod.env | list | `[]` | |
| pod.initContainers | list | `[]` | |
| pod.labels | object | `{}` | Additional labels to add to the pods |
| pod.otherContainers | list | `[]` | |
| pod.otherPorts | list | `[]` | |
| pod.port | int | `80` | |
| pod.securityContext | object | `{}` | |
| pod.volumeMounts | list | `[]` | |
Expand All @@ -62,7 +65,9 @@ helm install my-release colearendt/generic --version=0.2.6
| resources | object | `{}` | |
| secretEnv | list | `[]` | an array of name, value keys that will be used to create secret entries and attach as environment variables. Values evaluated as a template |
| securityContext | object | `{}` | |
| service.otherPorts | list | `[]` | |
| service.port | int | `80` | |
| service.portName | string | `"http"` | The port.name for the default port. Also used as the container port.name as well. |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
Expand Down
20 changes: 18 additions & 2 deletions charts/generic/ci/all-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ image:
repository: nginx
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion.
tag: ""
tag: "sha256:12345"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

pod:
port: 80
otherPorts:
- name: rpc
containerPort: 8090
protocol: TCP
env:
- name: "TEST_ENV"
value: "SOME_VALUE"
Expand All @@ -22,6 +26,12 @@ pod:
one: two
securityContext: {}
# fsGroup: 2000
initContainers:
- name: test-init
image: colearendt/netcat:bionic
otherContainers:
- name: sidecar
image: "nginx:latest"

command: []
args: []
Expand All @@ -46,6 +56,12 @@ securityContext: {}
service:
type: ClusterIP
port: 80
portName: testing
otherPorts:
- name: rpc
targetPort: rpc
protocol: TCP
port: 8090

ingress:
enabled: false
Expand Down Expand Up @@ -105,7 +121,7 @@ livenessProbe: null
startupProbe:
httpGet:
path: /
port: http
port: testing

mountConfig:
- name: test.sh
Expand Down
14 changes: 14 additions & 0 deletions charts/generic/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{- /*
Define the image. This is helpful in case the tag has a sha in it
Should be passed values directly
*/ -}}
{{- define "generic.image" -}}
{{- $tag := .Values.image.tag | default .Chart.AppVersion }}
{{- if hasPrefix "sha256:" $tag -}}
"{{ .Values.image.repository }}@{{ $tag }}"
{{- else -}}
"{{ .Values.image.repository }}:{{ $tag }}"
{{- end }}
{{- end }}

{{/* thanks to https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_tplvalues.tpl */}}
{{/*
Renders a value that contains template.
Expand Down
16 changes: 14 additions & 2 deletions charts/generic/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ spec:
serviceAccountName: {{ include "generic.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.pod.securityContext | nindent 8 }}
{{- with .Values.pod.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: {{- include "generic.image" . | nindent 12 }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- with .Values.pod.env }}
Expand All @@ -66,9 +70,12 @@ spec:
[]
{{- end }}
ports:
- name: http
- name: {{ .Values.service.portName }}
containerPort: {{ .Values.pod.port }}
protocol: TCP
{{- if .Values.pod.otherPorts }}
{{- toYaml .Values.pod.otherPorts | nindent 12 }}
{{- end }}
{{- with .Values.command }}
command:
{{- toYaml . | nindent 12 }}
Expand Down Expand Up @@ -108,6 +115,11 @@ spec:
{{- if not (or .Values.pod.volumeMounts .Values.storage.create .Values.mountConfig .Values.mountSecret) }}
[]
{{- end }}
{{- if .Values.pod.otherContainers }}
{{- with .Values.pod.otherContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
7 changes: 5 additions & 2 deletions charts/generic/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
targetPort: {{ .Values.service.portName }}
protocol: TCP
name: http
name: {{ .Values.service.portName }}
{{- if .Values.service.otherPorts }}
{{- toYaml .Values.service.otherPorts | nindent 4 }}
{{- end }}
selector:
{{- include "generic.selectorLabels" . | nindent 4 }}
6 changes: 6 additions & 0 deletions charts/generic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ secretEnv: []

pod:
port: 80
otherPorts: []
env: []
volumes: []
volumeMounts: []
Expand All @@ -55,6 +56,8 @@ pod:
labels: {}
securityContext: {}
# fsGroup: 2000
initContainers: []
otherContainers: []

# -- command for the pod's primary container. Default is the container's default entrypoint
command: []
Expand Down Expand Up @@ -105,6 +108,9 @@ securityContext: {}
service:
type: ClusterIP
port: 80
# -- The port.name for the default port. Also used as the container port.name as well.
portName: http
otherPorts: []

ingress:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion charts/matomo
Submodule matomo updated 3 files
+3 −3 Chart.lock
+2 −2 Chart.yaml
+3 −3 README.md
4 changes: 2 additions & 2 deletions charts/postgrest/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: postgrest
description: A Helm chart for deploying Postgrest to Kubernetes
type: application
version: 0.3.2
appVersion: v8.0.0
version: 0.3.4
appVersion: v11.1.0
icon: https://avatars.githubusercontent.com/u/15115011?s=200&v=4
maintainers:
- name: colearendt
Expand Down
11 changes: 11 additions & 0 deletions charts/postgrest/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 0.3.4

- Add configuration for the `pod.adminPort` and `service.adminPort`
- `pod.adminPort` controls the PostgREST config and deployment
- `serivce.adminPort` controls the exposure of the health check to the service definition
- Update the `readinessProbe` to use the admin health-check

# 0.3.3

- Bump PostgREST version to v11.1.0

# 0.3.2

- Update ingress to use newer template, api version, etc.
Expand Down
13 changes: 6 additions & 7 deletions charts/postgrest/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# postgrest

![Version: 0.3.2](https://img.shields.io/badge/Version-0.3.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v8.0.0](https://img.shields.io/badge/AppVersion-v8.0.0-informational?style=flat-square)
![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v11.1.0](https://img.shields.io/badge/AppVersion-v11.1.0-informational?style=flat-square)

## Installing the Chart

To install the chart with the release name `my-release` at version 0.3.2:
To install the chart with the release name `my-release` at version 0.3.4:

```bash
helm repo add colearendt https://colearendt.github.io/helm
helm install my-release colearendt/postgrest --version=0.3.2
helm install my-release colearendt/postgrest --version=0.3.4
```

#### _A Helm chart for deploying Postgrest to Kubernetes_
Expand Down Expand Up @@ -40,14 +40,12 @@ helm install my-release colearendt/postgrest --version=0.3.2
| initContainers | object | `{}` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| pod.adminPort | int | `9001` | The admin server port for PostgREST. Automatically sets the adminServerPort configuration value. |
| pod.annotations | object | `{}` | |
| pod.containerPort | int | `9000` | |
| pod.env | list | `[]` | |
| pod.livenessProbe | object | `{}` | |
| pod.readinessProbe.httpGet.path | string | `"/"` | |
| pod.readinessProbe.httpGet.port | string | `"http"` | |
| pod.readinessProbe.initialDelaySeconds | int | `5` | |
| pod.readinessProbe.periodSeconds | int | `5` | |
| pod.readinessProbe | object | `{"httpGet":{"path":"/ready","port":"http-admin"},"initialDelaySeconds":5,"periodSeconds":5}` | The readiness probe for PostgREST. Can also use requests to /live per https://postgrest.org/en/stable/references/admin.html#health-check |
| pod.securityContext | object | `{}` | |
| pod.startupProbe | object | `{}` | |
| pod.volumeMounts | list | `[]` | |
Expand Down Expand Up @@ -75,6 +73,7 @@ helm install my-release colearendt/postgrest --version=0.3.2
| resources | object | `{}` | |
| secret | object | `{}` | |
| securityContext | object | `{}` | |
| service.adminPort | int | `9001` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
Expand Down
9 changes: 9 additions & 0 deletions charts/postgrest/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,22 @@ spec:
- name: PGRST_RAW_MEDIA_TYPES
value: {{ .Values.postgrest.rawMediaTypes }}
{{- end }}
{{- if .Values.pod.adminPort }}
- name: PGRST_ADMIN_SERVER_PORT
value: {{ .Values.pod.adminPort | quote }}
{{- end }}
{{- if .Values.pod.env }}
{{- toYaml .Values.pod.env | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.pod.containerPort }}
protocol: TCP
{{- if .Values.pod.adminPort }}
- name: http-admin
containerPort: {{ .Values.pod.adminPort }}
protocol: TCP
{{- end }}
{{- with .Values.pod.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/postgrest/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if .Values.service.adminPort }}
- port: {{ .Values.service.adminPort }}
targetPort: http-admin
protocol: TCP
name: http-admin
{{- end }}
selector:
{{- include "postgrest.selectorLabels" . | nindent 4 }}
9 changes: 7 additions & 2 deletions charts/postgrest/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ postgrest:
preRequest: ""
rootSpec: ""
rawMediaTypes: ""
# NOTE: adminServerPort is set via pod.adminPort and service.adminPort

secret: {}

Expand All @@ -74,11 +75,14 @@ securityContext: {}
pod:
annotations: {}
containerPort: 9000
# -- The admin server port for PostgREST. Automatically sets the adminServerPort configuration value.
adminPort: 9001
env: []
# -- The readiness probe for PostgREST. Can also use requests to /live per https://postgrest.org/en/stable/references/admin.html#health-check
readinessProbe:
httpGet:
path: /
port: http
path: /ready
port: http-admin
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe: {}
Expand All @@ -90,6 +94,7 @@ pod:
service:
type: ClusterIP
port: 80
adminPort: 9001

ingress:
enabled: false
Expand Down

0 comments on commit 203098b

Please sign in to comment.