update chart template for ec-config-server

This commit is contained in:
2024-08-31 01:12:09 +10:00
parent 68ead251a8
commit d5f78da216
9 changed files with 41 additions and 30 deletions

View File

@@ -20,4 +20,4 @@ version: 1.0.0
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "1.0.3" appVersion: "1.0.4"

View File

@@ -1,26 +1,30 @@
{{- define "mr-config-server.chart" -}} {{- define "ec-config-server.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{- define "mr-config-server.name" -}} {{- define "ec-config-server.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{- define "mr-config-server.selectorLabels" -}} {{- define "ec-config-server.namespace" -}}
app.kubernetes.io/name: {{ include "mr-config-server.name" . }} {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "ec-config-server.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ec-config-server.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }} {{- end }}
{{- define "mr-config-server.labels" -}} {{- define "ec-config-server.labels" -}}
helm.sh/chart: {{ include "mr-config-server.chart" . }} helm.sh/chart: {{ include "ec-config-server.chart" . }}
{{ include "mr-config-server.selectorLabels" . }} {{ include "ec-config-server.selectorLabels" . }}
{{- if .Chart.AppVersion }} {{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }} {{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }} {{- end }}
{{- define "mr-config-server.fullname" -}} {{- define "ec-config-server.fullname" -}}
{{- if .Values.fullnameOverride }} {{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }} {{- else }}
@@ -33,9 +37,9 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "mr-config-server.serviceAccountName" -}} {{- define "ec-config-server.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }} {{- if .Values.serviceAccount.create }}
{{- default (include "mr-config-server.fullname" .) .Values.serviceAccount.name }} {{- default (include "ec-config-server.fullname" .) .Values.serviceAccount.name }}
{{- else }} {{- else }}
{{- default "default" .Values.serviceAccount.name }} {{- default "default" .Values.serviceAccount.name }}
{{- end }} {{- end }}

View File

@@ -1,9 +1,10 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "mr-config-server.fullname" . }} name: {{ include "ec-config-server.fullname" . }}
namespace: {{ include "ec-config-server.namespace" . }}
labels: labels:
{{- include "mr-config-server.labels" . | nindent 4 }} {{- include "ec-config-server.labels" . | nindent 4 }}
data: data:
SPRING_PROFILES_ACTIVE: {{ .Values.spring.activeprofile }} SPRING_PROFILES_ACTIVE: {{ .Values.spring.activeprofile }}
{{- if .Values.environment }} {{- if .Values.environment }}

View File

@@ -1,9 +1,10 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "mr-config-server.fullname" . }} name: {{ include "ec-config-server.fullname" . }}
namespace: {{ include "ec-config-server.namespace" . }}
labels: labels:
{{- include "mr-config-server.labels" . | nindent 4 }} {{- include "ec-config-server.labels" . | nindent 4 }}
spec: spec:
strategy: strategy:
type: RollingUpdate type: RollingUpdate
@@ -15,7 +16,7 @@ spec:
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
{{- include "mr-config-server.selectorLabels" . | nindent 6 }} {{- include "ec-config-server.selectorLabels" . | nindent 6 }}
template: template:
metadata: metadata:
{{- with .Values.podAnnotations }} {{- with .Values.podAnnotations }}
@@ -23,20 +24,20 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
labels: labels:
{{- include "mr-config-server.selectorLabels" . | nindent 8 }} {{- include "ec-config-server.selectorLabels" . | nindent 8 }}
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "mr-config-server.serviceAccountName" . }} serviceAccountName: {{ include "ec-config-server.serviceAccountName" . }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
envFrom: envFrom:
- configMapRef: - configMapRef:
name: {{ include "mr-config-server.fullname" . }} name: {{ include "ec-config-server.fullname" . }}
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

View File

@@ -2,14 +2,15 @@
apiVersion: autoscaling/v2 apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: {{ include "mr-config-server.fullname" . }} name: {{ include "ec-config-server.fullname" . }}
namespace: {{ include "ec-config-server.namespace" . }}
labels: labels:
{{- include "mr-config-server.labels" . | nindent 4 }} {{- include "ec-config-server.labels" . | nindent 4 }}
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
name: {{ include "mr-config-server.fullname" . }} name: {{ include "ec-config-server.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }} minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics: metrics:

View File

@@ -3,9 +3,10 @@ apiVersion: policy/v1
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ .Chart.Name }} name: {{ .Chart.Name }}
namespace: {{ include "ec-config-server.namespace" . }}
spec: spec:
minAvailable: {{ .Values.pdb.minAvailable }} minAvailable: {{ .Values.pdb.minAvailable }}
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: {{ include "mr-config-server.name" . }} app.kubernetes.io/name: {{ include "ec-config-server.name" . }}
{{- end }} {{- end }}

View File

@@ -2,9 +2,10 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ include "mr-config-server.serviceAccountName" . }} name: {{ include "ec-config-server.serviceAccountName" . }}
namespace: {{ include "ec-config-server.namespace" . }}
labels: labels:
{{- include "mr-config-server.labels" . | nindent 4 }} {{- include "ec-config-server.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }} {{- with .Values.serviceAccount.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
@@ -14,9 +15,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: {{ .Release.Namespace }}-config-reader-binding name: {{ .Release.Namespace }}-config-reader-binding
namespace: {{ include "ec-config-server.namespace" . }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ include "mr-config-server.serviceAccountName" . }} name: {{ include "ec-config-server.serviceAccountName" . }}
apiGroup: "" apiGroup: ""
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
roleRef: roleRef:

View File

@@ -1,12 +1,13 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "mr-config-server.fullname" . }} name: {{ include "ec-config-server.fullname" . }}
namespace: {{ include "ec-config-server.namespace" . }}
annotations: annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
service.beta.kubernetes.io/aws-load-balancer-type: "elb" service.beta.kubernetes.io/aws-load-balancer-type: "elb"
labels: labels:
{{- include "mr-config-server.labels" . | nindent 4 }} {{- include "ec-config-server.labels" . | nindent 4 }}
spring-boot: "{{ .Values.labels.springboot }}" spring-boot: "{{ .Values.labels.springboot }}"
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
@@ -16,4 +17,4 @@ spec:
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
{{- include "mr-config-server.selectorLabels" . | nindent 4 }} {{- include "ec-config-server.selectorLabels" . | nindent 4 }}

View File

@@ -12,7 +12,7 @@ affinity:
- key: app.kubernetes.io/name - key: app.kubernetes.io/name
operator: In operator: In
values: values:
- mr-config-servver - ec-config-server
topologyKey: kubernetes.io/hostname topologyKey: kubernetes.io/hostname
autoscaling: autoscaling: