mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/postgresql] Standardize labels (#5110)
* [stable/postgresql] standardize labels * use "postgresql.name" as app label instead of "postgresql.fullname" * match pods by two labels, release and app * [stable/postgresql] bump version to 0.9.6 * [stable/postgresql] update notes * [stable/postgresql] bump version to 0.11.0
This commit is contained in:
committed by
k8s-ci-robot
parent
2c63a5db53
commit
9e1cce036a
@@ -1,5 +1,5 @@
|
||||
name: postgresql
|
||||
version: 0.10.0
|
||||
version: 0.11.0
|
||||
appVersion: 9.6.2
|
||||
description: Object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
|
||||
keywords:
|
||||
|
||||
@@ -29,7 +29,7 @@ To connect to your database directly from outside the K8s cluster:
|
||||
PGPORT={{ default "5432" .Values.service.port }}
|
||||
|
||||
# Execute the following commands to route the connection:
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "postgresql.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "postgresql.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ default "5432" .Values.service.port }}:{{ default "5432" .Values.service.port }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
@@ -34,3 +34,10 @@ Return the appropriate apiVersion for networkpolicy.
|
||||
"networking.k8s.io/v1"
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "postgresql.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -3,15 +3,21 @@ kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "postgresql.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: {{ template "postgresql.name" . }}
|
||||
chart: {{ template "postgresql.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
template:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "postgresql.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
app: {{ template "postgresql.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{- if .Values.affinity }}
|
||||
affinity:
|
||||
|
||||
@@ -4,14 +4,15 @@ apiVersion: {{ template "postgresql.networkPolicy.apiVersion" . }}
|
||||
metadata:
|
||||
name: "{{ template "postgresql.fullname" . }}"
|
||||
labels:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: {{ template "postgresql.name" . }}
|
||||
chart: {{ template "postgresql.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: "{{ template "postgresql.fullname" . }}"
|
||||
app: {{ template "postgresql.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
ingress:
|
||||
# Allow inbound connections
|
||||
- ports:
|
||||
|
||||
@@ -4,10 +4,10 @@ apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "postgresql.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: {{ template "postgresql.name" . }}
|
||||
chart: {{ template "postgresql.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.persistence.annotations | indent 4 }}
|
||||
|
||||
@@ -3,10 +3,10 @@ kind: Secret
|
||||
metadata:
|
||||
name: {{ template "postgresql.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: {{ template "postgresql.name" . }}
|
||||
chart: {{ template "postgresql.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{ if .Values.postgresPassword }}
|
||||
|
||||
@@ -3,10 +3,10 @@ kind: Service
|
||||
metadata:
|
||||
name: {{ template "postgresql.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
app: {{ template "postgresql.name" . }}
|
||||
chart: {{ template "postgresql.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
@@ -26,4 +26,5 @@ spec:
|
||||
{{ toYaml .Values.service.externalIPs | indent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "postgresql.fullname" . }}
|
||||
app: {{ template "postgresql.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
|
||||
Reference in New Issue
Block a user