This commit is contained in:
zeaslity
2024-10-30 16:30:51 +08:00
commit 437acbeb63
3363 changed files with 653948 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
ci/*
/templates/sidecar/

View File

@@ -0,0 +1,17 @@
apiVersion: v2
name: backend-app
description: uavcloud backend applications
type: application
version: 1.1.0
appVersion: 2.2.2
keywords:
- uavcloud
- backend
- template
- function
- chinamobile

View File

@@ -0,0 +1 @@
所有的后端应用已经部署完成!

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -0,0 +1,210 @@
enabled: true
global:
image:
repository: woshinibaba.io/cmii
tag: "2.2.2.1"
pullPolicy: IfNotPresent
domain:
TenantEnvironment: "outside" # which will affect the chosen of frontend AppClientId, and the swagger url of backend Application.
# if just PublicIP:Port is actually deployed, a fake domain and ingress-nginx http port should be assigned
DeployDomainName: "fake-domain.io:31500"
ingress:
# tls should be placed in frontend dedicated nginx, this can be enabled in exactly situation
# please don't modify this unless you know what exactly you are doing
tls_enabled: false
middlewareService:
type: NodePort
appServiceType:
backend: ClusterIP
frontend: ClusterIP
pvc:
storageClass: heketi-glusterfs-distribute
affinity: { } # don't modify this unless you know the whole application of affinity
nodeAffinityPreset: # just modify this for nodeAffinity
type: hard
key: uavcloud.env
values:
- demo
env:
CUST_JAVA_OPTS: "-Xms1000m -Xmx2000m"
NACOS_REGISTRY: "helm-nacos:8848"
application:
type: backend
manifest:
# below just is example, its can NOT deployed cause of switch is off
- name: cmii-admin-data
enabled: true
modules: cmlc.lcadm
tag: 2.2.4
config: {}
- name: cmii-admin-gateway
enabled: true
modules: cmlc.lcadm
tag: 2.2.4
config: {}
- name: cmii-admin-user
enabled: true
modules: cmlc.lcadm
tag: 2.2.4
config: {}
- name: cmii-open-gateway
enabled: true
modules: lcopg
tag: 2.2.4
config: {}
- name: cmii-uav-airspace
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-brain
enabled: true
modules: lcai
tag: 2.2.4
config: {}
- name: cmii-uav-cloud-live
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-clusters
enabled: true
modules: skycenter
tag: 2.2.4
config: {}
- name: cmii-uav-data-post-process
enabled: true
modules: cmlc
tag: 2.2.4
config:
pvc:
cache:
path: /cmii/cache
accessMode: ReadWriteMany
size: 25Gi
- name: cmii-uav-developer
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-device
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-gateway
enabled: false
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-kpi-monitor
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-live
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-logger
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-material-warehouse
enabled: true
modules: cmlc.mws
tag: 2.2.4
config:
pvc:
cache:
path: /cmii/cache
accessMode: ReadWriteMany
size: 25Gi
- name: cmii-uav-mission
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-mqtthandler
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-notice
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-oauth
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-process
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-security-system
enabled: true
modules: cmlc.scrt
tag: 2.2.4
config: {}
- name: cmii-uav-surveillance
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-user
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-waypoint
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-industrial-portfolio
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
- name: cmii-uav-alarm
enabled: true
modules: cmlc
tag: 2.2.4
config: {}
# resources:
# limits:
# memory: 100Gi
# cpu: "2"
# requests:
# memory: 100Gi
# cpu: 200m
replicaCount: 1
autoscaling:
enabled: false
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
securityContext: {}

View File

@@ -0,0 +1,67 @@
application:
manifest:
- {config: null, enabled: true, modules: cmlc.loadm, name: cmii-admin-data, tag: 3.1.0}
- {config: null, enabled: true, modules: loadm, name: cmii-admin-gateway, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-admin-user, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-open-gateway, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-airspace, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-alarm, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-brain, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-cloud-live, tag: 3.1.0}
- config:
pvc:
cache: {accessMode: ReadWriteMany, path: /cmii/cache, size: 15Gi}
resources: {limits: null, requests: null}
enabled: true
modules: cmlc
name: cmii-uav-data-post-process
tag: 3.1.0
- {config: null, enabled: true, modules: null, name: cmii-uav-developer, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-device, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-gateway, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-industrial-portfolio,
tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-kpi-monitor, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-logger, tag: 3.1.0}
- config:
pvc:
cache: {accessMode: ReadWriteMany, path: /cmii/cache, size: 15Gi}
resources: {limits: null, requests: null}
enabled: true
modules: null
name: cmii-uav-material-warehouse
tag: 3.1.0
- {config: null, enabled: true, modules: null, name: cmii-uav-mission, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-mqtthandler, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-notice, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-oauth, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-process, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-surveillance, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-user, tag: 3.1.0}
- {config: null, enabled: true, modules: null, name: cmii-uav-waypoint, tag: 3.1.0}
- config:
pvc:
cache: {accessMode: ReadWriteMany, path: /cmii/cache, size: 15Gi}
resources: {limits: null, requests: null}
enabled: true
modules: null
name: cmii-uav-cms
tag: 3.1.0
type: backend
autoscaling: {enabled: null}
enabled: null
env: {custJavaOpts: null, nacosRegistry: null}
global:
affinity: null
appServiceType: {backend: null, frontend: null}
domain: null
image: {pullPolicy: null, repository: null, tag: null}
ingress: null
middlewareService: null
nodeAffinityPreset: {key: null, type: null, values: null}
pvc: {storageClass: null}
podAnnotations: {}
podSecurityContext: {}
replicaCount: 2
securityContext: {}
serviceAccount: {annotations: null, create: null, name: null}