디렉토리 구조 및 각 서비스 추가
This commit is contained in:
42
helm/sonarqube/charts/postgresql/templates/svc-read-set.yaml
Normal file
42
helm/sonarqube/charts/postgresql/templates/svc-read-set.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
{{- if and .Values.replication.enabled .Values.replication.uniqueServices }}
|
||||
{{- $serviceAnnotations := coalesce .Values.readReplicas.service.annotations .Values.service.annotations -}}
|
||||
|
||||
{{- $fullName := include "common.names.fullname" . }}
|
||||
{{- $replicaCount := .Values.replication.readReplicas | int }}
|
||||
{{- $root := . }}
|
||||
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
{{- $targetPod := printf "%s-read-%d" (printf "%s" $fullName) $i }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $fullName }}-read-{{ $i }}
|
||||
labels:
|
||||
pod: {{ $targetPod }}
|
||||
{{- include "common.labels.standard" $root | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
|
||||
{{- if $root.Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $root.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $serviceAnnotations }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $serviceAnnotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
namespace: {{ $root.Release.Namespace }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: tcp-postgresql
|
||||
port: {{ template "postgresql.servicePort" $root }}
|
||||
targetPort: tcp-postgresql
|
||||
selector:
|
||||
{{- include "common.labels.matchLabels" $root | nindent 4 }}
|
||||
role: read
|
||||
statefulset.kubernetes.io/pod-name: {{ $targetPod }}
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user