This commit is contained in:
7
chart/templates/NOTES.txt
Normal file
7
chart/templates/NOTES.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
Please visit this URL after startup:
|
||||
|
||||
{{ if .Values.ingress.host }}
|
||||
https://{{ .Values.ingress.host }}
|
||||
{{ end }}
|
17
chart/templates/_helpers.tpl
Normal file
17
chart/templates/_helpers.tpl
Normal file
@@ -0,0 +1,17 @@
|
||||
{{/*
|
||||
Startup parameter
|
||||
*/}}
|
||||
{{- define "argument" -}}
|
||||
progressDeadlineSeconds: 200
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 1
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 25%
|
||||
maxUnavailable: 25%
|
||||
type: RollingUpdate
|
||||
{{- end }}
|
||||
|
||||
{{- define "imagePullPolicy" -}}
|
||||
imagePullPolicy: IfNotPresent
|
||||
{{- end }}
|
87
chart/templates/deployment.yaml
Normal file
87
chart/templates/deployment.yaml
Normal file
@@ -0,0 +1,87 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.deployment.blog.name }}
|
||||
labels:
|
||||
app: {{ .Values.deployment.blog.labels.app }}
|
||||
spec:
|
||||
{{- include "argument" . | nindent 2 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.deployment.blog.labels.app }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.deployment.blog.labels.app }}
|
||||
spec:
|
||||
{{- if .Values.global.enabled }}
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: blog-pvc
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Values.deployment.blog.name }}
|
||||
image: {{ .Values.deployment.blog.image }}:{{ .Values.deployment.blog.tag }}
|
||||
{{- include "imagePullPolicy" . | nindent 8 }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.blog.targetPort }}
|
||||
protocol: TCP
|
||||
{{- if .Values.global.enabled }}
|
||||
volumeMounts:
|
||||
{{- range .Values.deployment.blog.volumeMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: {{ .Values.blog.targetPort }}
|
||||
timeoutSeconds: 10
|
||||
resources:
|
||||
limits:
|
||||
memory: {{ .Values.deployment.blog.limits.memory }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.deployment.blog_gateway.name }}
|
||||
labels:
|
||||
app: {{ .Values.deployment.blog_gateway.labels.app }}
|
||||
spec:
|
||||
{{- include "argument" . | nindent 2 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.deployment.blog_gateway.labels.app }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.deployment.blog_gateway.labels.app }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Values.deployment.blog_gateway.name }}
|
||||
image: {{ .Values.deployment.blog_gateway.image }}:{{ .Values.deployment.blog_gateway.tag }}
|
||||
{{- include "imagePullPolicy" . | nindent 8 }}
|
||||
env:
|
||||
{{- range .Values.deployment.blog_gateway.env }}
|
||||
- name: {{ .name }}
|
||||
value: {{ .value }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.blog_gateway.targetPort }}
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: {{ .Values.blog_gateway.targetPort }}
|
||||
timeoutSeconds: 10
|
||||
resources:
|
||||
limits:
|
||||
memory: {{ .Values.deployment.blog_gateway.limits.memory }}
|
36
chart/templates/ingress.yaml
Normal file
36
chart/templates/ingress.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- if .Values.ingress.redirection.enabled}}
|
||||
annotations:
|
||||
kubernetes.io/tls-acme: "true"
|
||||
nginx.ingress.kubernetes.io/permanent-redirect-code: "301"
|
||||
#kubernetes.io/ingress.class: "nginx"
|
||||
ingress.kubernetes.io/ssl-redirect: "true"
|
||||
ingress.kubernetes.io/secure-backends: "true"
|
||||
ingress.kubernetes.io/force-ssl-redirect: "true"
|
||||
{{- end }}
|
||||
name: {{ .Values.ingress.name }}
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: {{ .Values.ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ .Values.ingress.service.name }}
|
||||
port:
|
||||
number: {{ .Values.ingress.service.port.number }}
|
||||
path: /
|
||||
{{- if .Values.ingress.tls.enabled}}
|
||||
tls:
|
||||
- hosts:
|
||||
{{- range $.Values.ingress.tls.hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .Values.ingress.tls.secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
18
chart/templates/pvc.yaml
Normal file
18
chart/templates/pvc.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- if .Values.global.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
items:
|
||||
{{- range .Values.global.pvcConfigs }}
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .accessModes }}
|
||||
storageClassName: {{ .storageClass }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .storage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
41
chart/templates/service.yaml
Normal file
41
chart/templates/service.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.deployment.blog.name }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.deployment.blog.labels.app }}
|
||||
ports:
|
||||
- name: {{ .Values.deployment.blog.name }}
|
||||
protocol: TCP
|
||||
port: {{ .Values.blog.port }}
|
||||
targetPort: {{ .Values.blog.targetPort }}
|
||||
type: {{ .Values.blog.type }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.deployment.blog_gateway.name }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.deployment.blog_gateway.labels.app }}
|
||||
ports:
|
||||
- name: {{ .Values.deployment.blog_gateway.name }}
|
||||
protocol: TCP
|
||||
port: {{ .Values.blog_gateway.port }}
|
||||
targetPort: {{ .Values.blog_gateway.targetPort }}
|
||||
type: {{ .Values.blog_gateway.type }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.statefulset.blog_twikoo.name }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.statefulset.blog_twikoo.labels.app }}
|
||||
ports:
|
||||
- name: {{ .Values.statefulset.blog_twikoo.name }}
|
||||
protocol: TCP
|
||||
port: {{ .Values.blog_twikoo.port }}
|
||||
targetPort: {{ .Values.blog_twikoo.targetPort }}
|
||||
type: {{ .Values.blog_twikoo.type }}
|
54
chart/templates/statefulset.yaml
Normal file
54
chart/templates/statefulset.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ .Values.statefulset.blog_twikoo.name }}
|
||||
spec:
|
||||
podManagementPolicy: OrderedReady
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.statefulset.blog_twikoo.labels.app }}
|
||||
serviceName: {{ .Values.statefulset.blog_twikoo.name }}
|
||||
minReadySeconds: 5
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.statefulset.blog_twikoo.labels.app }}
|
||||
spec:
|
||||
terminationGracePeriodSeconds: 5
|
||||
containers:
|
||||
- name: {{ .Values.statefulset.blog_twikoo.name }}
|
||||
image: {{ .Values.statefulset.blog_twikoo.image }}:{{ .Values.statefulset.blog_twikoo.tag }}
|
||||
env:
|
||||
{{- range .Values.statefulset.blog_twikoo.env }}
|
||||
- name: {{ .name }}
|
||||
value: "{{ .value }}"
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.blog_twikoo.targetPort }}
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
memory: {{ .Values.statefulset.blog_twikoo.limits.memory }}
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 3
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: {{ .Values.blog_twikoo.targetPort }}
|
||||
timeoutSeconds: 20
|
||||
{{- if .Values.global.enabled }}
|
||||
volumeMounts:
|
||||
{{- range .Values.statefulset.blog_twikoo.volumeMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.global.enabled }}
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: twikoo-pvc
|
||||
{{- end }}
|
Reference in New Issue
Block a user