Init
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: pcp-request-service
|
||||
description: Helm chart for deploying pcp-request-service from GitLab CI/CD.
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0.0"
|
||||
@@ -0,0 +1,43 @@
|
||||
{{- define "pcp-request-service.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "pcp-request-service.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- include "pcp-request-service.name" . | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "pcp-request-service.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "pcp-request-service.name" . }}
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "pcp-request-service.serviceBaseUrl" -}}
|
||||
{{- if .Values.app.serviceBaseUrl -}}
|
||||
{{- .Values.app.serviceBaseUrl -}}
|
||||
{{- else if and .Values.ingress.enabled .Values.ingress.host -}}
|
||||
{{- $scheme := .Values.app.serviceBaseUrlScheme | default (ternary "https" "http" (gt (len .Values.ingress.tls) 0)) -}}
|
||||
{{- printf "%s://%s" $scheme .Values.ingress.host -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "pcp-request-service.managementBaseUrl" -}}
|
||||
{{- if .Values.app.managementBaseUrl -}}
|
||||
{{- .Values.app.managementBaseUrl -}}
|
||||
{{- else -}}
|
||||
{{- printf "http://%s:%v" (include "pcp-request-service.fullname" .) .Values.service.port -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "pcp-request-service.healthUrl" -}}
|
||||
{{- if .Values.app.healthUrl -}}
|
||||
{{- .Values.app.healthUrl -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/actuator/health" (include "pcp-request-service.managementBaseUrl" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,97 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "pcp-request-service.fullname" . }}
|
||||
labels:
|
||||
{{- include "pcp-request-service.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "pcp-request-service.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "pcp-request-service.labels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range . }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ include "pcp-request-service.name" . }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: {{ .Values.app.profile | quote }}
|
||||
- name: CONFIG_SERVER_URI
|
||||
value: {{ .Values.app.configServerUri | quote }}
|
||||
- name: SPRING_CLOUD_CONFIG_LABEL
|
||||
value: {{ .Values.app.configLabel | quote }}
|
||||
- name: CONFIG_SERVER_FAIL_FAST
|
||||
value: {{ .Values.app.configServerFailFast | quote }}
|
||||
{{- if .Values.app.adminClientUrl }}
|
||||
- name: SPRING_BOOT_ADMIN_CLIENT_URL
|
||||
value: {{ .Values.app.adminClientUrl | quote }}
|
||||
{{- end }}
|
||||
{{- $serviceBaseUrl := include "pcp-request-service.serviceBaseUrl" . }}
|
||||
{{- if $serviceBaseUrl }}
|
||||
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE_BASE_URL
|
||||
value: {{ $serviceBaseUrl | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.app.servicePath }}
|
||||
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE_PATH
|
||||
value: {{ .Values.app.servicePath | quote }}
|
||||
{{- end }}
|
||||
{{- $managementBaseUrl := include "pcp-request-service.managementBaseUrl" . }}
|
||||
{{- if $managementBaseUrl }}
|
||||
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_MANAGEMENT_BASE_URL
|
||||
value: {{ $managementBaseUrl | quote }}
|
||||
{{- end }}
|
||||
{{- $healthUrl := include "pcp-request-service.healthUrl" . }}
|
||||
{{- if $healthUrl }}
|
||||
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_HEALTH_URL
|
||||
value: {{ $healthUrl | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: http
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 15
|
||||
timeoutSeconds: 5
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 60
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: http
|
||||
initialDelaySeconds: 40
|
||||
periodSeconds: 20
|
||||
timeoutSeconds: 5
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
@@ -0,0 +1,31 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "pcp-request-service.fullname" . }}
|
||||
labels:
|
||||
{{- include "pcp-request-service.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.className }}
|
||||
ingressClassName: {{ .Values.ingress.className | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: {{ .Values.ingress.host | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ .Values.ingress.path | quote }}
|
||||
pathType: {{ .Values.ingress.pathType }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "pcp-request-service.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.service.port }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "pcp-request-service.fullname" . }}
|
||||
labels:
|
||||
{{- include "pcp-request-service.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "pcp-request-service.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
@@ -0,0 +1,15 @@
|
||||
app:
|
||||
profile: dev
|
||||
configLabel: dev
|
||||
adminClientUrl: "http://pcp-spring-boot-admin-server:38889"
|
||||
|
||||
service:
|
||||
port: 8080
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
host: pcp-request-service.dev.k8s.264.nstart.cloud
|
||||
|
||||
extraEnv:
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
@@ -0,0 +1,14 @@
|
||||
app:
|
||||
profile: master
|
||||
configLabel: master
|
||||
|
||||
service:
|
||||
port: 8080
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
host: pcp-request-service.master.k8s.264.nstart.cloud
|
||||
|
||||
extraEnv:
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
@@ -0,0 +1,48 @@
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: registry.example.com/pcp/pcp-request-service
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
pullSecrets: []
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 8080
|
||||
|
||||
app:
|
||||
profile: master
|
||||
configServerUri: "http://spring-cloud-config-server:38888"
|
||||
configServerFailFast: "true"
|
||||
configLabel: master
|
||||
adminClientUrl: ""
|
||||
serviceBaseUrl: ""
|
||||
serviceBaseUrlScheme: ""
|
||||
servicePath: "/swagger/ui"
|
||||
managementBaseUrl: ""
|
||||
healthUrl: ""
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
host: ""
|
||||
path: /
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
|
||||
extraEnv: []
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: "500m"
|
||||
memory: "1Gi"
|
||||
limits:
|
||||
cpu: "2"
|
||||
memory: "2Gi"
|
||||
|
||||
podAnnotations: {}
|
||||
podLabels: {}
|
||||
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
Reference in New Issue
Block a user