add
This commit is contained in:
@@ -0,0 +1 @@
|
||||
所有的后端应用已经部署完成!
|
||||
@@ -0,0 +1,74 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "uavcloud-be-core.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the node affinity to determine the deployment of environment no use
|
||||
*/}}
|
||||
{{- define "uavcloud-be-core.affinity" -}}
|
||||
{{- with .Values.global.nodeAffinityPreset }}
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: {{ .uavcloud.env }}
|
||||
operator: In # no use this
|
||||
values:
|
||||
- {{ .demo }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
default resources for backend deploymentss
|
||||
*/}}
|
||||
{{- define "uavcloud-be-core.resources" -}}
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
cpu: "2"
|
||||
requests:
|
||||
memory: 1Gi
|
||||
cpu: 200m
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the livenessProbe, readinessProbe and startupProbe to use
|
||||
*/}}
|
||||
{{- define "uavcloud-be-core.healthProbe" -}}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
port: pod-port
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 20
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
port: pod-port
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 20
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
port: pod-port
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 3
|
||||
periodSeconds: 20
|
||||
successThreshold: 1
|
||||
failureThreshold: 5
|
||||
{{- end }}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
{{- $namespace := .Release.Namespace -}}
|
||||
{{- $scope := $ -}}
|
||||
{{- range .Values.application.manifest }}
|
||||
{{- if .enabled -}}
|
||||
{{- $applicationName := .name | trunc 63 }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ $applicationName }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
cmii.type: {{ $.Values.application.type }}
|
||||
{{- if .modules }}
|
||||
cmii.modules: {{ .modules }}
|
||||
{{- end }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
helm.sh/chart: {{ include "uavcloud-be-core.chart" $scope }}
|
||||
app.kubernetes.io/managed-by: {{ $.Release.Service }}
|
||||
app.kubernetes.io/chart-version: {{ $.Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/app-version: {{ $.Values.global.image.tag | quote }}
|
||||
spec:
|
||||
{{- if not $.Values.autoscaling.enabled }}
|
||||
replicas: {{ $.Values.replicaCount }}
|
||||
{{- end }}
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
cmii.type: {{ $.Values.application.type }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with $.Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
cmii.type: {{ $.Values.application.type }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
spec:
|
||||
{{- if $.Values.global.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.global.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
{{- /* podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAffinityPreset "context" $) | nindent 10 -}}*/}}
|
||||
{{- /* podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.global.podAntiAffinityPreset "context" $) | nindent 10 }}*/}}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $.Values.global.nodeAffinityPreset.type "key" $.Values.global.nodeAffinityPreset.key "values" $.Values.global.nodeAffinityPreset.values) | nindent 10 -}}
|
||||
{{- end }}
|
||||
imagePullSecrets:
|
||||
- name: harborsecret
|
||||
securityContext:
|
||||
{{- toYaml $.Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ $applicationName }}
|
||||
image: "{{ $.Values.global.image.repository }}/{{ $applicationName }}:{{ .tag }}"
|
||||
imagePullPolicy: {{ $.Values.global.image.pullPolicy }}
|
||||
env:
|
||||
- name: K8S_NAMESPACE
|
||||
value: "{{ $namespace }}"
|
||||
- name: APPLICATION_NAME
|
||||
value: "{{ $applicationName }}"
|
||||
- name: CUST_JAVA_OPTS
|
||||
value: "{{ $.Values.env.CUST_JAVA_OPTS }}"
|
||||
- name: NACOS_REGISTRY
|
||||
value: "{{ $.Values.env.NACOS_REGISTRY }}"
|
||||
- name: NACOS_DISCOVERY_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: NACOS_DISCOVERY_PORT
|
||||
value: "8080"
|
||||
- name: BIZ_CONFIG_GROUP
|
||||
- name: SYS_CONFIG_GROUP
|
||||
- name: IMAGE_VERSION
|
||||
value: {{ .tag }}
|
||||
- name: NACOS_USERNAME
|
||||
value: {{ $.Values.env.NACOS_USERNAME | quote }}
|
||||
- name: NACOS_PASSWORD
|
||||
value: {{ $.Values.env.NACOS_PASSWORD | quote }}
|
||||
ports:
|
||||
- name: pod-port
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
{{- if .config }}
|
||||
{{- if .config.resources }}
|
||||
resources:
|
||||
{{- toYaml .config.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- include "uavcloud-be-core.resources" $scope | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- include "uavcloud-be-core.healthProbe" $scope | nindent 10 }}
|
||||
volumeMounts:
|
||||
- name: glusterfs-backend-log-volume
|
||||
mountPath: /cmii/logs
|
||||
readOnly: false
|
||||
subPath: {{ $namespace }}/{{ $applicationName }}
|
||||
{{- if .config }}
|
||||
{{- if .config.pvc }}
|
||||
- name: data-cache-volume
|
||||
mountPath: {{ .config.pvc.cache.path }}
|
||||
readOnly: false
|
||||
subPath: {{ $namespace }}/{{ $applicationName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /*{{- if $.Values.sidecar.proxysql.enabled }}
|
||||
- name: proxysql
|
||||
image: "{{ $.Values.global.image.repository | default $.Values.sidecar.proxysql.image.repository }}:{{ $.Values.sidecar.proxysql.image.tag }}"
|
||||
imagePullPolicy: {{ $.Values.sidecar.proxysql.image.pullPolicy }}
|
||||
ports:
|
||||
- name: proxysql
|
||||
containerPort: {{ $.Values.sidecar.proxysql.containerPort.proxysql }}
|
||||
protocol: TCP
|
||||
- name: admin
|
||||
containerPort: {{ $.Values.sidecar.proxysql.containerPort.admin }}
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: proxysql-config
|
||||
mountPath: /usr/local/bin/probe-proxysql.bash
|
||||
subPath: probe-proxysql.bash
|
||||
- name: proxysql-config
|
||||
mountPath: /etc/proxysql.cnf
|
||||
subPath: proxysql.cnf
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ["/bin/bash","/usr/local/bin/probe-proxysql.bash"]
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["/bin/bash","/usr/local/bin/probe-proxysql.bash"]
|
||||
resources:
|
||||
{{- toYaml $.Values.sidecar.proxysql.resources | nindent 12 }}
|
||||
{{- end }}*/}}
|
||||
volumes:
|
||||
- name: glusterfs-backend-log-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: glusterfs-backend-log-pvc
|
||||
{{- if .config }}
|
||||
{{- if .config.pvc }}
|
||||
- name: data-cache-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $applicationName }}-cache
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /*{{- if $.Values.sidecar.proxysql.enabled }}
|
||||
- name: proxysql-config
|
||||
configMap:
|
||||
name: {{ $.Values.sidecar.proxysql.configmap }}
|
||||
{{- end }}*/}}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{- $namespace := .Release.Namespace -}}
|
||||
{{- $scope := $ -}}
|
||||
{{- range .Values.application.manifest }}
|
||||
{{- if $.Values.isGenerateCachePVC }}
|
||||
{{- if .config -}}
|
||||
{{- if .config.pvc }}
|
||||
{{- $applicationName := .name | trunc 63 }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ $applicationName }}-cache
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
cmii.type: {{ $.Values.application.type }}
|
||||
{{- if .modules }}
|
||||
cmii.modules: {{ .modules }}
|
||||
{{- end }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
helm.sh/chart: {{ include "uavcloud-be-core.chart" $scope }}
|
||||
app.kubernetes.io/managed-by: {{ $.Release.Service }}
|
||||
{{- if $.Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/app-version: {{ $.Values.global.image.tag | quote }}
|
||||
|
||||
spec:
|
||||
storageClassName: {{ $.Values.global.pvc.storageClass }}
|
||||
accessModes:
|
||||
- {{ .config.pvc.cache.accessMode }}
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .config.pvc.cache.size }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{{- $namespace := .Release.Namespace -}}
|
||||
{{- $scope := $ -}}
|
||||
{{- range .Values.application.manifest }}
|
||||
{{- if .enabled -}}
|
||||
{{- $applicationName := .name | trunc 63 }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $applicationName }}
|
||||
namespace: {{ $namespace }}
|
||||
labels:
|
||||
cmii.type: {{ $.Values.application.type }}
|
||||
{{- if .modules }}
|
||||
cmii.modules: {{ .modules }}
|
||||
{{- end }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
helm.sh/chart: {{ include "uavcloud-be-core.chart" $scope }}
|
||||
app.kubernetes.io/managed-by: {{ $.Release.Service }}
|
||||
{{- if $.Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/app-version: {{ $.Values.global.image.tag | quote }}
|
||||
spec:
|
||||
type: {{ $.Values.global.appServiceType.backend }}
|
||||
selector:
|
||||
cmii.type: {{ $.Values.application.type }}
|
||||
cmii.app: {{ $applicationName }}
|
||||
ports:
|
||||
- name: backend-tcp
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user