summaryrefslogtreecommitdiffstats
path: root/kubernetes
diff options
context:
space:
mode:
authorjasmineWen <jasmine.wen@amdocs.com>2018-09-19 23:37:35 +0000
committerMandeep Khinda <Mandeep.Khinda@amdocs.com>2018-10-10 02:19:30 +0000
commitf7997b4daa4ea468d1ecd1cb5f54477812d6bb40 (patch)
treeef813507eaf45c009052f780d75c805c2681647e /kubernetes
parent05bc4cb68ad0d92c7e83af9092301677fd51eca7 (diff)
mv pgpool to a subchart of postgres
Issue-ID: OOM-1355 Change-Id: I37a8906b2039eeaf46da5c3884a87b69a79db3ef Signed-off-by: jasmineWen <jasmine.wen@amdocs.com>
Diffstat (limited to 'kubernetes')
-rwxr-xr-xkubernetes/common/pgpool/templates/configmap.yaml12
-rw-r--r--kubernetes/common/pgpool/templates/service.yaml14
-rw-r--r--kubernetes/common/postgres/charts/pgpool/Chart.yaml (renamed from kubernetes/common/pgpool/Chart.yaml)0
-rw-r--r--kubernetes/common/postgres/charts/pgpool/configs/pgpool.conf (renamed from kubernetes/common/pgpool/configs/pgpool.conf)10
-rw-r--r--kubernetes/common/postgres/charts/pgpool/configs/pool_hba.conf (renamed from kubernetes/common/pgpool/configs/pool_hba.conf)0
-rw-r--r--kubernetes/common/postgres/charts/pgpool/configs/pool_passwd (renamed from kubernetes/common/pgpool/configs/pool_passwd)1
-rw-r--r--kubernetes/common/postgres/charts/pgpool/requirements.yaml (renamed from kubernetes/common/pgpool/requirements.yaml)0
-rwxr-xr-x[-rw-r--r--]kubernetes/common/postgres/charts/pgpool/templates/configmap.yaml (renamed from kubernetes/common/pgpool/values.yaml)28
-rw-r--r--kubernetes/common/postgres/charts/pgpool/templates/deployment.yaml (renamed from kubernetes/common/pgpool/templates/deployment.yaml)5
-rw-r--r--kubernetes/common/postgres/charts/pgpool/templates/service.yaml26
-rw-r--r--kubernetes/common/postgres/charts/pgpool/values.yaml44
11 files changed, 92 insertions, 48 deletions
diff --git a/kubernetes/common/pgpool/templates/configmap.yaml b/kubernetes/common/pgpool/templates/configmap.yaml
deleted file mode 100755
index cc20b42581..0000000000
--- a/kubernetes/common/pgpool/templates/configmap.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ .Release.Name }}-pgpool-configmap
- namespace: {{ include "common.namespace" . }}
- labels:
- app: {{ include "common.name" . }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
- heritage: {{ .Release.Service }}
-data:
-{{ tpl (.Files.Glob "configs/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/common/pgpool/templates/service.yaml b/kubernetes/common/pgpool/templates/service.yaml
deleted file mode 100644
index 0811fda593..0000000000
--- a/kubernetes/common/pgpool/templates/service.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-kind: "Service"
-apiVersion: "v1"
-metadata:
- name: "pgpool"
- labels:
- name: "pgpool"
-spec:
- ports:
- - protocol: "TCP"
- port: 5432
- targetPort: 5432
- selector:
- name: "pgpool"
- type: ClusterIP
diff --git a/kubernetes/common/pgpool/Chart.yaml b/kubernetes/common/postgres/charts/pgpool/Chart.yaml
index b57e72a6ee..b57e72a6ee 100644
--- a/kubernetes/common/pgpool/Chart.yaml
+++ b/kubernetes/common/postgres/charts/pgpool/Chart.yaml
diff --git a/kubernetes/common/pgpool/configs/pgpool.conf b/kubernetes/common/postgres/charts/pgpool/configs/pgpool.conf
index 9dd979ac6b..f335174f40 100644
--- a/kubernetes/common/pgpool/configs/pgpool.conf
+++ b/kubernetes/common/postgres/charts/pgpool/configs/pgpool.conf
@@ -52,12 +52,12 @@ pcp_socket_dir = '/tmp'
# - Backend Connection Settings -
-backend_hostname0 = '{{.Values.container.primary}}'
+backend_hostname0 = '{{.Values.container.name.primary}}'
backend_port0 = 5432
backend_weight0= 1
backend_flag0= 'DISALLOW_TO_FAILOVER'
-backend_hostname1 = '{{.Values.container.replica}}'
+backend_hostname1 = '{{.Values.container.name.replica}}'
backend_port1 = 5432
backend_weight1= 1
backend_flag1= 'DISALLOW_TO_FAILOVER'
@@ -259,7 +259,7 @@ failover_if_affected_tuples_mismatch = off
# LOAD BALANCING MODE
#------------------------------------------------------------------------------
-load_balance_mode = off
+load_balance_mode = on
# Activate load balancing mode
# (change requires restart)
ignore_leading_white_space = on
@@ -358,7 +358,7 @@ health_check_period = 20
health_check_timeout = 10
# Health check timeout
# 0 means no timeout
-health_check_user = '{{.Values.credentials.pguser}}'
+health_check_user = '{{.Values.credentials.pgusername}}'
# Health check user
health_check_password = '{{.Values.credentials.pgpassword}}'
# Password for health check user
@@ -419,7 +419,7 @@ search_primary_node_timeout = 10
# ONLINE RECOVERY
#------------------------------------------------------------------------------
-recovery_user = '{{.Values.credentials.pguser}}'
+recovery_user = '{{.Values.credentials.pgusername}}'
# Online recovery user
recovery_password = '{{.Values.credentials.pgpassword}}'
# Online recovery password
diff --git a/kubernetes/common/pgpool/configs/pool_hba.conf b/kubernetes/common/postgres/charts/pgpool/configs/pool_hba.conf
index d8918409e8..d8918409e8 100644
--- a/kubernetes/common/pgpool/configs/pool_hba.conf
+++ b/kubernetes/common/postgres/charts/pgpool/configs/pool_hba.conf
diff --git a/kubernetes/common/pgpool/configs/pool_passwd b/kubernetes/common/postgres/charts/pgpool/configs/pool_passwd
index d8e09a2afa..3636d1de74 100644
--- a/kubernetes/common/pgpool/configs/pool_passwd
+++ b/kubernetes/common/postgres/charts/pgpool/configs/pool_passwd
@@ -1 +1,2 @@
testuser:md599e8713364988502fa6189781bcf648f
+postgres:md53175bce1d3201d16594cebf9d7eb3f9d
diff --git a/kubernetes/common/pgpool/requirements.yaml b/kubernetes/common/postgres/charts/pgpool/requirements.yaml
index 9f44c6df28..9f44c6df28 100644
--- a/kubernetes/common/pgpool/requirements.yaml
+++ b/kubernetes/common/postgres/charts/pgpool/requirements.yaml
diff --git a/kubernetes/common/pgpool/values.yaml b/kubernetes/common/postgres/charts/pgpool/templates/configmap.yaml
index 8e7474203d..10ebd7fd7f 100644..100755
--- a/kubernetes/common/pgpool/values.yaml
+++ b/kubernetes/common/postgres/charts/pgpool/templates/configmap.yaml
@@ -1,4 +1,4 @@
-# Copyright © 2018 Amdocs, AT&T, Bell Canada
+# Copyright © 2017 Amdocs, Bell Canada
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,17 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-name: pgpool
-container:
- port: 5432
- name:
- primary: pgset-primary
- replica: pgset-replica
-credentials:
- pgusername: testuser
- pgpassword: password
-serviceType: ClusterIP
-image:
- repository: crunchydata
- container: crunchy-pgpool
- tag: centos7-10.4-2.0.0
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Release.Name }}-pgpool-configmap
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+data:
+{{ tpl (.Files.Glob "configs/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/common/pgpool/templates/deployment.yaml b/kubernetes/common/postgres/charts/pgpool/templates/deployment.yaml
index f598409848..a05bed4b5f 100644
--- a/kubernetes/common/pgpool/templates/deployment.yaml
+++ b/kubernetes/common/postgres/charts/pgpool/templates/deployment.yaml
@@ -32,8 +32,9 @@ spec:
release: {{ .Release.Name }}
spec:
containers:
- - name: pgpool
- image: "{{.Values.image.repository}}/{{.Values.image.container}}:{{.Values.image.tag}}"
+ - image: "{{.Values.repository}}/{{.Values.image}}"
+ imagePullPolicy: {{ .Values.pullPolicy | default .Values.global.pullPolicy }}
+ name: {{ include "common.name" . }}
env:
- name: PG_PRIMARY_SERVICE_NAME
value: {{.Values.container.name.primary}}
diff --git a/kubernetes/common/postgres/charts/pgpool/templates/service.yaml b/kubernetes/common/postgres/charts/pgpool/templates/service.yaml
new file mode 100644
index 0000000000..86442a2740
--- /dev/null
+++ b/kubernetes/common/postgres/charts/pgpool/templates/service.yaml
@@ -0,0 +1,26 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Values.service.name }}
+ namespace: {{ include "common.namespace" . }}
+ labels:
+ app: {{ include "common.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+ annotations:
+spec:
+ type: {{ .Values.service.type }}
+ ports:
+ {{if eq .Values.service.type "NodePort" -}}
+ - port: {{ .Values.service.externalPort }}
+ nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
+ name: {{ .Values.service.name }}
+ {{- else -}}
+ - port: {{ .Values.service.externalPort }}
+ targetPort: {{ .Values.service.internalPort }}
+ name: {{ .Values.service.name }}
+ {{- end}}
+ selector:
+ app: {{ include "common.name" . }}
+ release: {{ .Release.Name }}
diff --git a/kubernetes/common/postgres/charts/pgpool/values.yaml b/kubernetes/common/postgres/charts/pgpool/values.yaml
new file mode 100644
index 0000000000..cb732b7cd7
--- /dev/null
+++ b/kubernetes/common/postgres/charts/pgpool/values.yaml
@@ -0,0 +1,44 @@
+# Copyright © 2018 Amdocs, AT&T, Bell Canada
+#
+# 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.
+
+#################################################################
+# Global configuration defaults.
+#################################################################
+global:
+ nodePortPrefix: 302
+ persistence: {}
+ readinessRepository: oomk8s
+ readinessImage: readiness-check:2.0.0
+
+#################################################################
+# Application configuration defaults.
+#################################################################
+# application image
+repository: crunchydata
+image: crunchy-pgpool:centos7-10.4-2.0.0
+pullPolicy: Always
+
+container:
+ port: 5432
+ name:
+ primary: pgset-primary
+ replica: pgset-replica
+credentials:
+ pgusername: testuser
+ pgpassword: password
+service:
+ name: pgpool
+ type: ClusterIP
+ externalPort: 5432
+ internalPort: 5432