Postgresql: Update chart to match current OSH format
This PS updates the Postgresql chart to match the current OSH format. Change-Id: Ifadb473043b51ccc10405886ae7a0954ce119a22
This commit is contained in:
parent
2dcaa1421d
commit
33f03ef828
21
postgresql/templates/bin/_readiness.sh.tpl
Normal file
21
postgresql/templates/bin/_readiness.sh.tpl
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
pg_isready -U ${POSTGRES_USER}
|
21
postgresql/templates/bin/_start.sh.tpl
Normal file
21
postgresql/templates/bin/_start.sh.tpl
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
exec /docker-entrypoint.sh postgres
|
30
postgresql/templates/configmap-bin.yaml
Normal file
30
postgresql/templates/configmap-bin.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.manifests.configmap_bin }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
{{- $configMapBinName := printf "%s-%s" $envAll.Release.Name "etcd-bin" }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: postgresql-bin
|
||||||
|
data:
|
||||||
|
start.sh: |
|
||||||
|
{{ tuple "bin/_start.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
readiness.sh: |
|
||||||
|
{{ tuple "bin/_readiness.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
{{- end }}
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- if .Values.manifests.secret_admin }}
|
{{- if .Values.manifests.secret_admin }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.manifests.service }}
|
||||||
{{- $envAll := . }}
|
{{- $envAll := . }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@ -26,3 +27,4 @@ spec:
|
|||||||
port: {{ tuple "postgresql" "internal" "postgresql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
port: {{ tuple "postgresql" "internal" "postgresql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
selector:
|
selector:
|
||||||
{{ tuple $envAll "postgresql" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
{{ tuple $envAll "postgresql" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{- if .Values.manifests.statefulset }}
|
||||||
{{- $envAll := . }}
|
{{- $envAll := . }}
|
||||||
{{- $dependencies := .Values.dependencies.postgresql }}
|
{{- $dependencies := .Values.dependencies.postgresql }}
|
||||||
|
|
||||||
@ -43,8 +44,9 @@ spec:
|
|||||||
- name: postgresql
|
- name: postgresql
|
||||||
image: {{ .Values.images.tags.postgresql }}
|
image: {{ .Values.images.tags.postgresql }}
|
||||||
imagePullPolicy: {{ .Values.images.pull_policy }}
|
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||||
|
{{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: {{ tuple "postgresql" "internal" "postgresql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
- containerPort: {{ tuple "postgresql" "internal" "postgresql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
env:
|
env:
|
||||||
- name: 'POSTGRES_PASSWORD'
|
- name: 'POSTGRES_PASSWORD'
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@ -58,41 +60,51 @@ spec:
|
|||||||
key: 'POSTGRES_USER'
|
key: 'POSTGRES_USER'
|
||||||
- name: 'PGDATA'
|
- name: 'PGDATA'
|
||||||
value: {{ .Values.storage.mount.path | quote }}
|
value: {{ .Values.storage.mount.path | quote }}
|
||||||
|
command:
|
||||||
|
- /tmp/start.sh
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
- pg_isready
|
- /tmp/readiness.sh
|
||||||
- -U
|
|
||||||
- {{ .Values.endpoints.postgresql.auth.admin.username }}
|
|
||||||
initialDelaySeconds: 20
|
initialDelaySeconds: 20
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
- pg_isready
|
- /tmp/readiness.sh
|
||||||
- -U
|
|
||||||
- {{ .Values.endpoints.postgresql.auth.admin.username }}
|
|
||||||
initialDelaySeconds: 20
|
initialDelaySeconds: 20
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
{{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: postgresql-data
|
- name: postgresql-bin
|
||||||
mountPath: {{ .Values.storage.mount.path }}
|
mountPath: /tmp/start.sh
|
||||||
subPath: {{ .Values.storage.mount.subpath }}
|
subPath: start.sh
|
||||||
{{- if not .Values.storage.pvc.enabled }}
|
readOnly: true
|
||||||
|
- name: postgresql-bin
|
||||||
|
mountPath: /tmp/readiness.sh
|
||||||
|
subPath: readiness.sh
|
||||||
|
readOnly: true
|
||||||
|
- name: postgresql-data
|
||||||
|
mountPath: {{ .Values.storage.mount.path }}
|
||||||
|
subPath: {{ .Values.storage.mount.subpath }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: postgresql-data
|
- name: postgresql-bin
|
||||||
hostPath:
|
configMap:
|
||||||
path: {{ .Values.storage.host.host_path }}
|
name: postgresql-bin
|
||||||
|
defaultMode: 0555
|
||||||
|
{{- if not .Values.storage.pvc.enabled }}
|
||||||
|
- name: postgresql-data
|
||||||
|
hostPath:
|
||||||
|
path: {{ .Values.storage.host.host_path }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
volumeClaimTemplates:
|
volumeClaimTemplates:
|
||||||
- metadata:
|
- metadata:
|
||||||
name: postgresql-data
|
name: postgresql-data
|
||||||
annotations:
|
annotations:
|
||||||
{{ .Values.storage.pvc.class_path }}: {{ .Values.storage.pvc.class_name }}
|
{{ .Values.storage.pvc.class_path }}: {{ .Values.storage.pvc.class_name }}
|
||||||
spec:
|
spec:
|
||||||
accessModes: [ "ReadWriteOnce" ]
|
accessModes: [ "ReadWriteOnce" ]
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: {{ .Values.storage.pvc.size }}
|
storage: {{ .Values.storage.pvc.size }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -80,10 +80,13 @@ endpoints:
|
|||||||
host_fqdn_override:
|
host_fqdn_override:
|
||||||
default: null
|
default: null
|
||||||
path: null
|
path: null
|
||||||
scheme: 'http'
|
scheme: postgresql
|
||||||
port:
|
port:
|
||||||
postgresql:
|
postgresql:
|
||||||
default: 5432
|
default: 5432
|
||||||
|
|
||||||
manifests:
|
manifests:
|
||||||
|
configmap_bin: true
|
||||||
secret_admin: true
|
secret_admin: true
|
||||||
|
service: true
|
||||||
|
statefulset: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user