Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/pgadmin] upgrade to 4.17 and more #20211

Merged
merged 3 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stable/pgadmin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
description: pgAdmin is a web based administration tool for PostgreSQL database
name: pgadmin
version: 1.0.5
appVersion: 4.15.0
version: 1.1.0
appVersion: 4.17.0
home: https://www.pgadmin.org/
source: https://github.com/rowanruseler/pgadmin
maintainers:
Expand Down
12 changes: 8 additions & 4 deletions stable/pgadmin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The command removes nearly all the Kubernetes components associated with the cha
| --------- | ----------- | ------- |
| `replicaCount` | Number of pgadmin replicas | `1` |
| `image.repository` | Docker image | `dpage/pgadmin4` |
| `image.tag` | Docker image tag | `4.15` |
| `image.tag` | Docker image tag | `4.17` |
| `image.pullPolicy` | Docker image pull policy | `IfNotPresent` |
| `service.type` | Service type (ClusterIP, NodePort or LoadBalancer) | `ClusterIP` |
| `service.port` | Service port | `80` |
Expand All @@ -53,10 +53,14 @@ The command removes nearly all the Kubernetes components associated with the cha
| `ingress.path` | Ingress path mapping | `` |
| `env.username` | pgAdmin default email | `chart@example.local` |
| `env.password` | pgAdmin default password | `SuperSecret` |
| `persistence` | Persistent enabled/disabled | `true` |
| `persistence.accessMode` | Persistent Access Mode | `ReadWriteOnce` |
| `persistence.size` | Persistent volume size | `10Gi` |
| `persistentVolume.enabled` | If true, pgAdmin will create a Persistent Volume Claim | `true` |
| `persistentVolume.accessMode` | Persistent Volume access Mode | `ReadWriteOnce` |
| `persistentVolume.size` | Persistent Volume size | `10Gi` |
| `persistentVolume.storageClass` | Persistent Volume Storage Class | `unset` |
| `securityContext` | Custom [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for pgAdmin containers | `` |
| `resources` | CPU/memory resource requests/limits | `{}` |
| `livenessProbe` | [liveness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) initial delay and timeout | `` |
| `readinessProbe` | [readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) initial delay and timeout | `` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Node tolerations for pod assignment | `[]` |
| `affinity` | Node affinity for pod assignment | `{}` |
Expand Down
60 changes: 39 additions & 21 deletions stable/pgadmin/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Deployment
metadata:
name: {{ $fullName }}
labels:
{{ include "pgadmin.labels" . | indent 4 }}
{{- include "pgadmin.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -17,10 +17,16 @@ spec:
app.kubernetes.io/name: {{ include "pgadmin.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: init-pgadmin
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/chown", "-R", "5050:5050", "/var/lib/pgadmin"]
volumeMounts:
- name: pgadmin-data
mountPath: /var/lib/pgadmin
securityContext:
runAsUser: 0
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand All @@ -29,17 +35,21 @@ spec:
- name: http
containerPort: 80
protocol: TCP
{{- if .Values.livenessProbe }}
livenessProbe:
httpGet:
path: /
port: http
path: /misc/ping
port: 80
{{- .Values.livenessProbe | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe:
httpGet:
path: /
port: http
path: /misc/ping
port: 80
{{- .Values.readinessProbe | toYaml | nindent 12 }}
{{- end }}
env:
- name: PGADMIN_PORT
value: "80"
- name: PGADMIN_DEFAULT_EMAIL
value: {{ .Values.env.email }}
- name: PGADMIN_DEFAULT_PASSWORD
Expand All @@ -51,24 +61,32 @@ spec:
- name: pgadmin-data
mountPath: /var/lib/pgadmin
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- .Values.resources | toYaml | nindent 12 }}
volumes:
- name: pgadmin-data
{{- if .Values.persistence.enabled }}
{{- if .Values.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ $fullName }}
claimName: {{ if .Values.persistentVolume.existingClaim }}{{ .Values.persistentVolume.existingClaim }}{{- else }}{{ $fullName }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- .Values.iamgePullSecrets | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- .Values.nodeSelector | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.securityContext }}
securityContext:
{{- .Values.securityContext | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- .Values.affinity | toYaml | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more of a personal taste - but I favour using with as it is easier to read and keep consistent due to no duplication.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like me to adjust this? Personally I found this statement more clear. But I don't mind adjusting it back.

{{- if .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- .Values.tolerations | toYaml | nindent 8 }}}
{{- end }}
6 changes: 3 additions & 3 deletions stable/pgadmin/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{ include "pgadmin.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
{{- include "pgadmin.labels" . | nindent 4 }}
{{- if .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- .Values.ingress.annotations | toYaml | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
Expand Down
19 changes: 13 additions & 6 deletions stable/pgadmin/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{- if and .Values.persistentVolume.enabled (not .Values.persistentVolume.existingClaim) }}
{{- $fullName := include "pgadmin.fullname" . -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ $fullName }}
labels:
{{ include "pgadmin.labels" . | indent 4 }}
{{- with .Values.persistence.annotations }}
{{- include "pgadmin.labels" . | nindent 4 }}
{{- if .Values.persistentVolume.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- .Values.persistentVolume.annotaions | toYaml | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
{{- .Values.persistentVolume.accessModes | toYaml | nindent 4 }}
{{- if .Values.persistentVolume.storageClass }}
{{- if (eq "-" .Values.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
storage: {{ .Values.persistentVolume.size }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/pgadmin/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Secret
metadata:
name: {{ $fullName }}
labels:
{{ include "pgadmin.labels" . | indent 4 }}
{{- include "pgadmin.labels" . | nindent 4 }}
type: Opaque
data:
password: {{ default "SuperSecret" .Values.env.password | b64enc | quote }}
2 changes: 1 addition & 1 deletion stable/pgadmin/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
name: {{ include "pgadmin.fullname" . }}
labels:
{{ include "pgadmin.labels" . | indent 4 }}
{{- include "pgadmin.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
74 changes: 66 additions & 8 deletions stable/pgadmin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@

replicaCount: 1

## pgAdmin container image
##
image:
repository: dpage/pgadmin4
tag: 4.15
tag: 4.17
pullPolicy: IfNotPresent

service:
type: ClusterIP
port: 80

ingress:
## If true, pgAdmin Ingress will be created
##
enabled: false

## pgAdmin Ingress annotations
##
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"

## pgAdmin Ingress hostnames with optional path
## Must be provided if Ingress is enabled
hosts:
- host: chart-example.local
paths: []

## pgAdmin Ingress TLS configuration
## Secrets must be manually created in the namespace
tls: []
# - secretName: chart-example-tls
# hosts:
Expand All @@ -33,22 +45,43 @@ env:
email: chart@example.local
password: SuperSecret

persistence:
persistentVolume:
## If true, pgAdmin will create/use a Persistent Volume Claim
## If false, use emptyDir
##
enabled: true
annotations: {
volume.alpha.kubernetes.io/storage-class: default
}

## pgAdmin Persistent Volume Claim annotations
##
annotations: {}

## pgAdmin Persistent Volume access modes
## Must match those of existing PV or dynamic provisioner
## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
accessModes:
- ReadWriteOnce

## pgAdmin Persistent Volume Size
##
size: 10Gi

## pgAdmin Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## 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: ""
accessMode: ReadWriteOnce
size: 10Gi
# storageClass: "-"
# existingClaim: ""

## Security context to be added to pgAdmin pods
##
securityContext:
runAsUser: 5050
runAsGroup: 5050
fsGroup: 5050

resources: {}
# limits:
# cpu: 100m
Expand All @@ -57,8 +90,33 @@ resources: {}
# cpu: 100m
# memory: 128Mi

## pgAdmin readiness and liveness probe initial delay and timeout
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
##
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 15
successThreshold: 1
failureThreshold: 3

readinessProbe:
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 15
successThreshold: 1
failureThreshold: 3

## Node labels for pgAdmin pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}

## Node tolerations for server scheduling to nodes with taints
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
tolerations: []

## Pod affinity
##
affinity: {}