diff --git a/.beagle.yml b/.beagle.yml new file mode 100644 index 0000000000000000000000000000000000000000..4a0a6f328aeccf170eb023080554a1bebb384c8a --- /dev/null +++ b/.beagle.yml @@ -0,0 +1,46 @@ +kind: pipeline +name: docker + +trigger: + branch: + - v2.4.0 + +clone: + disable: true + +steps: + - name: fetch + image: registry.cn-qingdao.aliyuncs.com/wod/devops-git:1.0 + + - name: charts + image: registry.cn-qingdao.aliyuncs.com/wod/helm:v3 + commands: + - helm package . + + - name: minio + image: registry.cn-qingdao.aliyuncs.com/wod/devops-minio:1.0 + environment: + S3_ACCESS_KEY: + from_secret: ACCESS_KEY_MINIO + S3_SECRET_KEY: + from_secret: SECRET_KEY_MINIO + commands: + - mc alias set cache --api=S3v4 https://cache.wodcloud.com $S3_ACCESS_KEY $S3_SECRET_KEY + - mc cp ./usma-v2.4.0.tgz cache/kubernetes/market/charts/usma/v2.4.0/usma-v2.4.0.tgz + - mc cp ./values.yaml cache/kubernetes/market/charts/usma/v2.4.0/values.yaml + - mc cp ./README.md cache/kubernetes/market/charts/usma/v2.4.0/README.md + +--- +kind: secret +name: ACCESS_KEY_MINIO +get: + name: ACCESS_KEY_MINIO + path: devops-secrets + +--- +kind: secret +name: SECRET_KEY_MINIO +get: + name: SECRET_KEY_MINIO + path: devops-secrets + diff --git a/Chart.yaml b/Chart.yaml index 157d834921c5bd9905c72206642fdd212757d2ba..98924e8ae1fb0054d4b63c01389f7ba662bdf811 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,23 +1,15 @@ apiVersion: v2 -name: usma +appVersion: v2.0 +dependencies: +- condition: redis.enabled + name: redis + repository: "" + version: 6.2.6 +- condition: postgresql.enabled + name: postgresql + repository: "" + version: "13.5" description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. +name: usma type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 - -# 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 -# follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.16.0 +version: v2.4.0 diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6d678d89324eef4c396666d40f5f6c3f3590eae6 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +### 概要说明 + +``` +统一用户v2.4.0版本 +``` + +### 镜像 + +usma-api [黄智] + +- registry.cn-qingdao.aliyuncs.com/wod/usma-api:v2.4.0-amd64 +- registry.cn-qingdao.aliyuncs.com/wod/usma-api:v2.4.0-arm64 + +usma-login-api [黄智] + +- registry.cn-qingdao.aliyuncs.com/wod/usma-login-api:2.4.0-amd64 +- registry.cn-qingdao.aliyuncs.com/wod/usma-login-api:2.4.0-arm64 + +sms-verify-api [黄智] + +- registry.cn-qingdao.aliyuncs.com/wod/sms-verify-api:v2.4.0-amd64 +- registry.cn-qingdao.aliyuncs.com/wod/sms-verify-api:v2.4.0-arm64 + +fileupload [黄智] + +- hub.wodcloud.com/devops/fileupload:v2.0 + +usma-ui [赵伟庚] + +- hub.wodcloud.com/usma/usma-ui:v2.2.3-alpha + +usma-login [赵伟庚] + +- hub.wodcloud.com/usma/usma-login:v2.2.1-alpha + +## 迁移对应数据库 + +1. postgresql (数据库) 内置数据库,包含自动导入sql job +2. redis (中间件) 内置redis + + diff --git a/charts/file-upload/Chart.yaml b/charts/file-upload/Chart.yaml deleted file mode 100644 index fe66240c15704557ee29d6a3df17ba4c67070528..0000000000000000000000000000000000000000 --- a/charts/file-upload/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: file-upload -version: v2.0.0 -description: file-upload -appVersion: v2.0.0 -apiVersion: v1 -keywords: -- file-upload -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/file-upload/templates/_helpers.tpl b/charts/file-upload/templates/_helpers.tpl deleted file mode 100644 index 91df64c7a6605c448c5f86ecb27e71a2268d94f3..0000000000000000000000000000000000000000 --- a/charts/file-upload/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "file-upload.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "file-upload.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "file-upload.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "file-upload.name" . }}" -{{- end -}} diff --git a/charts/file-upload/templates/file-upload.yaml b/charts/file-upload/templates/file-upload.yaml deleted file mode 100644 index d22ab2af0399dae387e455e9fa271e8e71d7ca18..0000000000000000000000000000000000000000 --- a/charts/file-upload/templates/file-upload.yaml +++ /dev/null @@ -1,71 +0,0 @@ ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: file-upload - namespace: {{ .Release.Namespace }} - labels: -{{ include "file-upload.labels" . | indent 4 }} - app: file-upload - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "file-upload.matchLabels" . | indent 6 }} - app: file-upload - version: {{ .Values.tag }} - template: - metadata: - labels: -{{ include "file-upload.labels" . | indent 8 }} - app: file-upload - version: {{ .Values.tag }} - spec: - nodeSelector: -{{ toYaml $.Values.nodeSelector | indent 8 }} - containers: - - name: file-upload - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - imagePullPolicy: Always - resources: - {{- toYaml .Values.resources | nindent 12 }} - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - tcpSocket: - port: 80 - initialDelaySeconds: 50 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - name: "localtime" - mountPath: "/etc/localtime" - - name: data - mountPath: "/app/static" - volumes: - - name: "localtime" - hostPath: - path: "/etc/localtime" - {{- if .Values.storageSpec.hostPath }} - - name: data - hostPath: - path: /data/{{ .Release.Namespace }}/file-upload - {{- else if .Values.storageSpec.emptyDir }} - - name: data - emptyDir: {} -{{- else if .Values.storageSpec.volumeClaimTemplate }} - volumeClaimTemplates: - - metadata: - name: "data" - labels: -{{ include "app.labels" . | indent 8 }} - app: file-upload - spec: -{{ toYaml $.Values.storageSpec.volumeClaimTemplate.spec | indent 6 }} - {{- end }} \ No newline at end of file diff --git a/charts/postgresql/Chart.yaml b/charts/postgresql/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..890a57c08a84ca0ad869878158232831ee1c2603 --- /dev/null +++ b/charts/postgresql/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +appVersion: "13.5" +description: postgresql +name: postgresql +type: application +version: v1.0 diff --git a/charts/postgresql/templates/configmap.yaml b/charts/postgresql/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4e4117cab86a189968bc2f0a77c299f603e6aadb --- /dev/null +++ b/charts/postgresql/templates/configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: postgresql-config + namespace: {{ .Release.Namespace }} +data: + POSTGRES_DB: postgres + POSTGRES_PASSWORD: {{ .Values.POSTGRES_PASSWORD }} + POSTGRES_USER: postgres diff --git a/charts/postgresql/templates/service.yaml b/charts/postgresql/templates/service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cd9ee6fc9935ea57ea80ff5779007d12af3978f2 --- /dev/null +++ b/charts/postgresql/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: postgresql + namespace: {{ .Release.Namespace }} +spec: + ports: + - port: 5432 + protocol: TCP + targetPort: 5432 + selector: + app: postgresql + sessionAffinity: None diff --git a/charts/postgresql/templates/statefulset.yaml b/charts/postgresql/templates/statefulset.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5c342326eae8c7f7e116ed99ab738738c7b870a7 --- /dev/null +++ b/charts/postgresql/templates/statefulset.yaml @@ -0,0 +1,87 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: postgresql + namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + selector: + matchLabels: + app: postgresql + serviceName: "" + template: + metadata: + labels: + app: postgresql + spec: + initContainers: + - name: lost-found + {{- if contains "/" .Values.image.repository }} + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + command: + - rm + - '-Rf' + - /var/lib/postgresql/data/lost+found + resources: {} + volumeMounts: + - name: data + mountPath: /var/lib/postgresql/data + - name: init-data + {{- if contains "/" .Values.image.repository }} + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + command: + - chown + - '-R' + - '999:999' + - /var/lib/postgresql/data + resources: {} + volumeMounts: + - name: data + mountPath: /var/lib/postgresql/data + containers: + - envFrom: + - configMapRef: + name: postgresql-config + {{- if contains "/" .Values.image.repository }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + name: data + ports: + - containerPort: 5432 + protocol: TCP + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: data + - mountPath: /etc/localtime + name: localtime + restartPolicy: Always + volumes: + - hostPath: + path: /etc/localtime + type: "" + name: localtime + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + labels: + app: postgresql + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: {{ .Values.storageClassName }} + volumeMode: Filesystem + diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b2175fd1d4685eb7e99203bfbd9cf0adf0d753e2 --- /dev/null +++ b/charts/redis/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +appVersion: 6.2.6 +description: redis +name: redis +type: application +version: v1.0 diff --git a/charts/redis/templates/configmap.yaml b/charts/redis/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0d983c2d6a0acf049e3ed94a973c4bda34c61c58 --- /dev/null +++ b/charts/redis/templates/configmap.yaml @@ -0,0 +1,18 @@ +{{- $redisConf := .Values.conf }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: redis + namespace: {{ .Release.Namespace }} +data: + redis.conf: | + daemonize no + pidfile /var/run/redis.pid + timeout 0 + loglevel verbose + logfile stdout + {{ .Values.conf.port }} + {{ .Values.conf.db }} + {{ .Values.conf.maxmem }} + {{ .Values.conf.apl }} + {{ .Values.conf.passwd }} diff --git a/charts/redis/templates/service.yaml b/charts/redis/templates/service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ee6b064b9a2c21b5219f485b0e283e6e4dcc5b27 --- /dev/null +++ b/charts/redis/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis + namespace: {{ .Release.Namespace }} +spec: + ports: + - port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis + sessionAffinity: None diff --git a/charts/redis/templates/statefulset.yaml b/charts/redis/templates/statefulset.yaml new file mode 100644 index 0000000000000000000000000000000000000000..01c214ae7f5073609f3c3c78a0e74dde3e411baa --- /dev/null +++ b/charts/redis/templates/statefulset.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: redis + namespace: {{ .Release.Namespace }} +spec: + podManagementPolicy: OrderedReady + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app: redis + serviceName: "" + template: + metadata: + labels: + app: redis + spec: + containers: + - args: + - /usr/local/etc/redis/redis.conf + {{- if contains "/" .Values.image.repository }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + name: redis + ports: + - containerPort: 6379 + resources: {} + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 300 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 6379 + timeoutSeconds: 1 + volumeMounts: + - mountPath: /etc/localtime + name: localtime + - mountPath: /usr/local/etc/redis + name: conf + - mountPath: /data + name: data + restartPolicy: Always + volumes: + - hostPath: + path: /etc/localtime + type: "" + name: localtime + - configMap: + defaultMode: 420 + name: redis + name: conf + volumeClaimTemplates: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + labels: + app: redis + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: {{ .Values.storageClassName }} + volumeMode: Filesystem + diff --git a/charts/sms-verify-api/Chart.yaml b/charts/sms-verify-api/Chart.yaml deleted file mode 100644 index 92f872ad88376b5cfabd312bff7c3a8513f2e145..0000000000000000000000000000000000000000 --- a/charts/sms-verify-api/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: sms-verify-api -version: v2.0.0 -description: sms-verify-api -appVersion: v2.0.0 -apiVersion: v1 -keywords: -- sms-verify-api -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/sms-verify-api/templates/_helpers.tpl b/charts/sms-verify-api/templates/_helpers.tpl deleted file mode 100644 index b7f0d521c44c6b853d8f7d52e07f69cf400216ed..0000000000000000000000000000000000000000 --- a/charts/sms-verify-api/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "sms-verify-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "sms-verify-api.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "sms-verify-api.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "sms-verify-api.name" . }}" -{{- end -}} diff --git a/charts/sms-verify-api/templates/sms-verify-api.yaml b/charts/sms-verify-api/templates/sms-verify-api.yaml deleted file mode 100644 index 76c163a9fcce61db2b998b8226d22767010ca69c..0000000000000000000000000000000000000000 --- a/charts/sms-verify-api/templates/sms-verify-api.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: sms-verify-api - namespace: {{ .Release.Namespace }} - labels: -{{ include "sms-verify-api.labels" . | indent 4 }} - app: sms-verify-api - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "sms-verify-api.matchLabels" . | indent 6 }} - app: sms-verify-api - template: - metadata: - labels: -{{ include "sms-verify-api.labels" . | indent 8 }} - app: sms-verify-api - version: {{ .Values.tag }} - spec: - volumes: - - name: localtime - hostPath: - path: /etc/localtime - containers: - - name: sms-verify-api - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - ports: - - name: http - containerPort: 8080 - protocol: TCP - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 50 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - resources: - {{- toYaml .Values.resources | nindent 12 }} - envFrom: - - configMapRef: - name: "sms" - volumeMounts: - - name: localtime - mountPath: /etc/localtime - imagePullPolicy: "Always" - restartPolicy: "Always" - diff --git a/charts/usma-api/Chart.yaml b/charts/usma-api/Chart.yaml deleted file mode 100644 index 4789f811bce13764aeb26e74313613321004aefb..0000000000000000000000000000000000000000 --- a/charts/usma-api/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: usma-api -version: v1.0.0 -description: usma-api -appVersion: v1.0.0 -apiVersion: v1 -keywords: -- usma-api -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/usma-api/templates/_helpers.tpl b/charts/usma-api/templates/_helpers.tpl deleted file mode 100644 index e098969c591b9e01be2b07940082c946f2b83c47..0000000000000000000000000000000000000000 --- a/charts/usma-api/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "usma-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "usma-api.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "usma-api.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "usma-api.name" . }}" -{{- end -}} diff --git a/charts/usma-api/templates/usma-api.yaml b/charts/usma-api/templates/usma-api.yaml deleted file mode 100644 index d39ddc225b1a1dc8b8034b9e21771d7c16b359f4..0000000000000000000000000000000000000000 --- a/charts/usma-api/templates/usma-api.yaml +++ /dev/null @@ -1,70 +0,0 @@ ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: usma-api - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-api.labels" . | indent 4 }} - app: usma-api - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "usma-api.matchLabels" . | indent 6 }} - app: usma-api - template: - metadata: - labels: -{{ include "usma-api.labels" . | indent 8 }} - app: usma-api - version: {{ .Values.tag }} - spec: - nodeSelector: -{{ toYaml $.Values.nodeSelector | indent 8 }} - containers: - - name: usma-api - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - ports: - - name: http - containerPort: 8080 - protocol: TCP - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 50 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - envFrom: - - configMapRef: - name: usma - volumeMounts: - - name: localtime - mountPath: /etc/localtime - - name: log - mountPath: "/app/log" - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumes: - - name: localtime - hostPath: - path: /etc/localtime - {{- if .Values.storageSpec.hostPath }} - - name: log - hostPath: - path: /data/{{ .Release.Namespace }}/usma-api/log - {{- else if .Values.storageSpec.emptyDir }} - - name: log - emptyDir: {} -{{- else if .Values.storageSpec.volumeClaimTemplate }} - volumeClaimTemplates: - - metadata: - name: "log" - labels: -{{ include "app.labels" . | indent 8 }} - app: usma-api - spec: -{{ toYaml $.Values.storageSpec.volumeClaimTemplate.spec | indent 6 }} - {{- end }} diff --git a/charts/usma-login-api/Chart.yaml b/charts/usma-login-api/Chart.yaml deleted file mode 100644 index 47556f5d43d0470b5e3c4c370f87bc2a7c3cc7f2..0000000000000000000000000000000000000000 --- a/charts/usma-login-api/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: usma-login-api -version: v1.0.0 -description: usma-login-api -appVersion: v1.0.0 -apiVersion: v1 -keywords: -- usma-login-api -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/usma-login-api/templates/_helpers.tpl b/charts/usma-login-api/templates/_helpers.tpl deleted file mode 100644 index 9bf4672253297a9adbb854edea5a2d998810c687..0000000000000000000000000000000000000000 --- a/charts/usma-login-api/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "usma-login-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "usma-login-api.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "usma-login-api.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "usma-login-api.name" . }}" -{{- end -}} diff --git a/charts/usma-login-api/templates/usma-login-api.yaml b/charts/usma-login-api/templates/usma-login-api.yaml deleted file mode 100644 index f0f6ddcfaaf179555dee2f7036d0c5be7080f305..0000000000000000000000000000000000000000 --- a/charts/usma-login-api/templates/usma-login-api.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: usma-login-api - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-login-api.labels" . | indent 4 }} - app: usma-login-api - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "usma-login-api.matchLabels" . | indent 6 }} - app: usma-login-api - template: - metadata: - labels: -{{ include "usma-login-api.labels" . | indent 8 }} - app: usma-login-api - spec: - volumes: - - name: "localtime" - hostPath: - path: "/etc/localtime" - containers: - - name: "usma-login-api" - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - ports: - - name: "usma-login-api" - containerPort: 80 - protocol: "TCP" - livenessProbe: - tcpSocket: - port: 80 - initialDelaySeconds: 50 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - resources: - {{- toYaml .Values.resources | nindent 12 }} - envFrom: - - configMapRef: - name: "usma" - volumeMounts: - - name: "localtime" - mountPath: "/etc/localtime" diff --git a/charts/usma-login/Chart.yaml b/charts/usma-login/Chart.yaml deleted file mode 100644 index 84c649748cc201581b002b02264a742ef1ebf277..0000000000000000000000000000000000000000 --- a/charts/usma-login/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: usma-login -version: v2.0.0 -description: usma-login -appVersion: v2.0.0 -apiVersion: v1 -keywords: -- usma-login -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/usma-login/templates/_helpers.tpl b/charts/usma-login/templates/_helpers.tpl deleted file mode 100644 index 408174d2dc8365b31bb7510772eab4814aeae630..0000000000000000000000000000000000000000 --- a/charts/usma-login/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "usma-login.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "usma-login.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "usma-login.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "usma-login.name" . }}" -{{- end -}} diff --git a/charts/usma-login/templates/usma-login.yaml b/charts/usma-login/templates/usma-login.yaml deleted file mode 100644 index 79e91a7ea52c80b3348dd4772d9c6d0076bbfeb5..0000000000000000000000000000000000000000 --- a/charts/usma-login/templates/usma-login.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: usma-login - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-login.labels" . | indent 4 }} - app: usma-login - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "usma-login.matchLabels" . | indent 6 }} - app: usma-login - template: - metadata: - labels: -{{ include "usma-login.labels" . | indent 8 }} - app: usma-login - spec: - volumes: - - name: localtime - hostPath: - path: /etc/localtime - containers: - - name: usma-login - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - imagePullPolicy: Always - resources: - {{- toYaml .Values.resources | nindent 12 }} - ports: - - name: http - containerPort: 80 - livenessProbe: - httpGet: - path: /usma/login - port: 80 - scheme: HTTP - volumeMounts: - - name: localtime - mountPath: "/etc/localtime" \ No newline at end of file diff --git a/charts/usma-postgresql/Chart.yaml b/charts/usma-postgresql/Chart.yaml deleted file mode 100644 index 9e3698102fb08f308b08597797a4cbfb2f0b78cc..0000000000000000000000000000000000000000 --- a/charts/usma-postgresql/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: usma-postgresql -version: 1.0.0 -description: usma-postgresql -appVersion: 1.0.0 -apiVersion: v1 -keywords: -- usma-postgresql -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/usma-postgresql/templates/_helpers.tpl b/charts/usma-postgresql/templates/_helpers.tpl deleted file mode 100644 index 0eb4de3e6be4eb4ef068f968a3d31ccffc4dba17..0000000000000000000000000000000000000000 --- a/charts/usma-postgresql/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "usma-postgresql.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "usma-postgresql.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "usma-postgresql.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "usma-postgresql.name" . }}" -{{- end -}} diff --git a/charts/usma-postgresql/templates/configmap.yaml b/charts/usma-postgresql/templates/configmap.yaml deleted file mode 100644 index f9e37f1c6e76574b243642522b9c59049d9a6c95..0000000000000000000000000000000000000000 --- a/charts/usma-postgresql/templates/configmap.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: usma-postgresql-config - labels: -{{ include "usma-postgresql.labels" . | indent 4 }} - app: usma-postgresql -data: - POSTGRES_DB: postgres - POSTGRES_USER: postgres - POSTGRES_PASSWORD: passwd123 \ No newline at end of file diff --git a/charts/usma-postgresql/templates/service.yaml b/charts/usma-postgresql/templates/service.yaml deleted file mode 100644 index 96d43b973b29ffcb13663c7d3303c0514219c3ea..0000000000000000000000000000000000000000 --- a/charts/usma-postgresql/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: usma-postgresql - labels: -{{ include "usma-postgresql.labels" . | indent 4 }} - app: usma-postgresql -spec: - selector: - app: usma-postgresql - ports: - - name: usma-postgresql - port: 5432 - targetPort: 5432 - protocol: TCP \ No newline at end of file diff --git a/charts/usma-postgresql/templates/usma-postgres.yaml b/charts/usma-postgresql/templates/usma-postgres.yaml deleted file mode 100644 index 6269a74802e771dc75a574b7b5cf203b68289570..0000000000000000000000000000000000000000 --- a/charts/usma-postgresql/templates/usma-postgres.yaml +++ /dev/null @@ -1,67 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: usma-postgresql - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-postgresql.labels" . | indent 4 }} - app: usma-postgresql -spec: - replicas: 1 - selector: - matchLabels: -{{ include "usma-postgresql.matchLabels" . | indent 6 }} - app: usma-postgresql - template: - metadata: - labels: -{{ include "usma-postgresql.labels" . | indent 8 }} - app: usma-postgresql - spec: - nodeSelector: -{{ toYaml $.Values.nodeSelector | indent 8 }} - containers: - - name: usma-postgresql - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - imagePullPolicy: Always - ports: - - containerPort: 5432 - livenessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 50 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - envFrom: - - configMapRef: - name: usma-postgresql-config - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: data - - mountPath: /etc/localtime - name: localtime - volumes: - - name: localtime - hostPath: - path: /etc/localtime - {{- if .Values.storageSpec.hostPath }} - - name: data - hostPath: - path: /data/{{ .Release.Namespace }}/usma-postgresql - {{- else if .Values.storageSpec.emptyDir }} - - name: data - emptyDir: {} -{{- else if .Values.storageSpec.volumeClaimTemplate }} - volumeClaimTemplates: - - metadata: - name: data - labels: -{{ include "app.labels" . | indent 8 }} - app: usma-postgresql - spec: -{{ toYaml $.Values.storageSpec.volumeClaimTemplate.spec | indent 6 }} - {{- end }} \ No newline at end of file diff --git a/charts/usma-redis/Chart.yaml b/charts/usma-redis/Chart.yaml deleted file mode 100644 index 060396d800f46fa5cba5f96cfc8eeb0d4948db1f..0000000000000000000000000000000000000000 --- a/charts/usma-redis/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: usma-redis -version: 5.0.3 -description: usma-redis -appVersion: 5.0.3 -apiVersion: v1 -keywords: -- usma-redis -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/usma-redis/templates/_helpers.tpl b/charts/usma-redis/templates/_helpers.tpl deleted file mode 100644 index ea32b5d8c334087a07a5a18953cce6910681c297..0000000000000000000000000000000000000000 --- a/charts/usma-redis/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "usma-redis.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "usma-redis.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "usma-redis.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "usma-redis.name" . }}" -{{- end -}} diff --git a/charts/usma-redis/templates/configmap.yaml b/charts/usma-redis/templates/configmap.yaml deleted file mode 100644 index 93bf186255cc50179e655b880b4d7555bfe26dfc..0000000000000000000000000000000000000000 --- a/charts/usma-redis/templates/configmap.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: usma-redis - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-redis.labels" . | indent 4 }} - app: usma-redis - versoin: {{ .Values.tag }} -data: - redis.conf: "daemonize no\npidfile /var/run/redis.pid\nport 6379\ntimeout 0\nrequirepass passwd123\nloglevel verbose\nlogfile stdout\ndatabases 16\nmaxmemory 64mb\nappendonly no\n" diff --git a/charts/usma-redis/templates/service.yaml b/charts/usma-redis/templates/service.yaml deleted file mode 100644 index 220abff4d69d6bd90d43f4e47122bd98e2ed18b5..0000000000000000000000000000000000000000 --- a/charts/usma-redis/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: usma-redis - labels: -{{ include "usma-redis.labels" . | indent 4 }} - app: usma-redis -spec: - selector: - app: usma-redis - ports: - - name: usma-redis - port: 6379 - targetPort: 6379 - protocol: TCP \ No newline at end of file diff --git a/charts/usma-redis/templates/usma-redis.yaml b/charts/usma-redis/templates/usma-redis.yaml deleted file mode 100644 index 9001ef7db6a58ebcf123795b8fade95fe20018a7..0000000000000000000000000000000000000000 --- a/charts/usma-redis/templates/usma-redis.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: usma-redis - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-redis.labels" . | indent 4 }} - app: usma-redis - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "usma-redis.matchLabels" . | indent 6 }} - app: usma-redis - template: - metadata: - labels: -{{ include "usma-redis.labels" . | indent 8 }} - app: usma-redis - spec: - containers: - - args: - - /usr/local/etc/redis/redis.conf - - --appendonly no - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - imagePullPolicy: IfNotPresent - name: redis - ports: - - containerPort: 6379 - protocol: TCP - livenessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 50 - periodSeconds: 10 - timeoutSeconds: 1 - successThreshold: 1 - volumeMounts: - - mountPath: /usr/local/etc/redis - name: conf - volumes: - - configMap: - defaultMode: 420 - name: usma-redis - name: conf \ No newline at end of file diff --git a/charts/usma-ui/Chart.yaml b/charts/usma-ui/Chart.yaml deleted file mode 100644 index 4cf7d154a7ca05eb7c0e3617f734d552228b8735..0000000000000000000000000000000000000000 --- a/charts/usma-ui/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: usma-ui -version: v2.2.0 -description: usma-ui -appVersion: v2.2.0 -apiVersion: v1 -keywords: -- usma-ui -- usma -maintainers: -- name: xuzeyi - email: xuzeyi@wodcloud.com \ No newline at end of file diff --git a/charts/usma-ui/templates/_helpers.tpl b/charts/usma-ui/templates/_helpers.tpl deleted file mode 100644 index cf50e600fb1f76c5b18620c5533a540eb4148822..0000000000000000000000000000000000000000 --- a/charts/usma-ui/templates/_helpers.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "usma-ui.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* Helm required labels */}} -{{- define "usma-ui.labels" -}} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -{{- end -}} - -{{/* matchLabels */}} -{{- define "usma-ui.matchLabels" -}} -release: {{ .Release.Name }} -app: "{{ template "usma-ui.name" . }}" -{{- end -}} diff --git a/charts/usma-ui/templates/service.yaml b/charts/usma-ui/templates/service.yaml deleted file mode 100644 index eb2c0a44e45ca28b91ad0f15f121eebada5a604f..0000000000000000000000000000000000000000 --- a/charts/usma-ui/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: usma-ui - labels: -{{ include "usma-ui.labels" . | indent 4 }} - app: usma-ui -spec: - selector: - app: usma-ui - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP \ No newline at end of file diff --git a/charts/usma-ui/templates/usma-ui.yaml b/charts/usma-ui/templates/usma-ui.yaml deleted file mode 100644 index ffc4068a4c7a327a8d35d31b69edcf0de5966aae..0000000000000000000000000000000000000000 --- a/charts/usma-ui/templates/usma-ui.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: usma-ui - namespace: {{ .Release.Namespace }} - labels: -{{ include "usma-ui.labels" . | indent 4 }} - app: usma-ui - versoin: {{ .Values.tag }} -spec: - replicas: 1 - selector: - matchLabels: -{{ include "usma-ui.matchLabels" . | indent 6 }} - app: usma-ui - version: {{ .Values.tag }} - template: - metadata: - labels: -{{ include "usma-ui.labels" . | indent 8 }} - app: usma-ui - version: {{ .Values.tag }} - spec: - volumes: - - name: localtime - hostPath: - path: /etc/localtime - containers: - - name: usma-ui - image: {{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.tag }} - envFrom: - - configMapRef: - name: "usma" - resources: - {{- toYaml .Values.resources | nindent 12 }} - imagePullPolicy: Always - ports: - - name: http - containerPort: 80 - livenessProbe: - httpGet: - path: /usma/ui - port: 80 - scheme: HTTP - volumeMounts: - - name: localtime - mountPath: "/etc/localtime" \ No newline at end of file diff --git a/deploy.md b/deploy.md new file mode 100644 index 0000000000000000000000000000000000000000..4198a5f124bdcaa138bd3e9ae0d893c94506413f --- /dev/null +++ b/deploy.md @@ -0,0 +1,14 @@ +### 安装命令 +helm install usma . -f values.yaml -n usma + +### 安装方式 + +``` shell +helm install usma . -f values.yaml -n namespace +``` + +### 卸载方式 + +``` shell +helm uninstall usma -n namespace +``` \ No newline at end of file diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1882561bed5246616f59717d696a74943d595b46 Binary files /dev/null and b/logo.png differ diff --git a/requirements.yaml b/requirements.yaml index c6a972770e178dc47c0f4a63b09ed6eefebae3d6..84eeb186f51c3f3842d0a653423a9e7605e1edb4 100644 --- a/requirements.yaml +++ b/requirements.yaml @@ -1,25 +1,7 @@ dependencies: - - name: file-upload - version: v2.0 - condition: file-upload.enabled - - name: sms-verify-api - version: v2.0.0 - condition: sms-verify-api.enabled - - name: usma-api - version: v2.2.2 - condition: usma-api.enabled - - name: usma-login - version: v2.2.2 - condition: usma-login.enabled - - name: usma-login-api - version: v2.2.2 - condition: usma-login-api.enabled - - name: usma-postgresql - version: 10.6 - condition: usma-postgresql.enabled - - name: usma-redis - version: 5.0.3 - condition: usma-redis.enabled - - name: usma-ui - version: hbyjt-2.2.2 - condition: usma-ui.enabled \ No newline at end of file + - name: postgresql + version: 13.5 + condition: postgresql.enabled + - name: redis + version: 6.2.6 + condition: redis.enabled \ No newline at end of file diff --git a/step.yaml b/step.yaml new file mode 100644 index 0000000000000000000000000000000000000000..92bd673b500a648e98f023f3c79b7889002afb52 --- /dev/null +++ b/step.yaml @@ -0,0 +1,5 @@ +configInfo: + - name: global.host + text: 地址 + type: text + value: "bg-usma.ysdpaas.local" diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 3c5e498a7cb536f11859d248bcaf12e868ad3c34..87ccbfff96f96ca90c230e0c25ff9268f12fdb84 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -1,63 +1,73 @@ -{{/* vim: set filetype=mustache: */}} {{/* -Expand the name of the chart. +Create chart imageArch suffix. */}} -{{- define "usma.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- define "beagle.imageArch" -}} +{{- if not (eq "amd64" .Values.global.imageArch) -}} +{{- print "-" .Values.global.imageArch -}} +{{- else -}} +{{- print "-" "amd64" -}} +{{- end -}} {{- end }} +{{/* vim: set filetype=mustache: */}} {{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. +Expand the name of the chart. */}} -{{- define "usma.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} +{{- define "usma.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "usma.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} +{{/* Helm required labels */}} +{{- define "usma-ui.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} -{{/* -Common labels -*/}} -{{- define "usma.labels" -}} -helm.sh/chart: {{ include "usma.chart" . }} -{{ include "usma.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} +{{/* Helm required labels */}} +{{- define "usma-login.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} -{{/* -Selector labels -*/}} -{{- define "usma.selectorLabels" -}} -app.kubernetes.io/name: {{ include "usma.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} +{{/* Helm required labels */}} +{{- define "usma-api.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} + +{{/* Helm required labels */}} +{{- define "sms-verify-api.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} + +{{/* Helm required labels */}} +{{- define "file-upload.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} + +{{/* Helm required labels */}} +{{- define "portal-ui.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} + +{{/* Helm required labels */}} +{{- define "usma-login-api.labels" -}} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +{{- end -}} + +{{/* matchLabels */}} +{{- define "usma.matchLabels" -}} +release: {{ .Release.Name }} +{{- end -}} -{{/* -Create the name of the service account to use -*/}} -{{- define "usma.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "usma.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/templates/comfigmap-usma.yaml b/templates/comfigmap-usma.yaml deleted file mode 100644 index 48dbd239a9d447b1cd8f8b64ae4e5709fe712daa..0000000000000000000000000000000000000000 --- a/templates/comfigmap-usma.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: usma - labels: -{{ include "usma.labels" . | indent 4 }} - app: usma -data: - GIN_MODE: "debug" - # GIN_MODE: "release" - DB_URL: "host=usma-postgresql.{{ .Release.Namespace }} port=5432 user=postgres password=passwd123 dbname=usma sslmode=disable" - REDIS_URL: "redis://usma-redis.{{ .Release.Namespace }}:6379" - REDIS_PASSWORD: "passwd123" - LOG_DIR_PREFIX: "/app/log" - LOCATION_KEY: "QKFBZ-PGGWJ-VZQFF-FHPA7-QWT5H-YHF4T" - LOCATION_URL: "https://apis.map.qq.com/ws/location/v1/ip" - SMS_SERVICE: "http://sms-verify-api.{{ .Release.Namespace }}:80/sms/api" - USMA_HOST: "https://{{ .Values.global.host }}" \ No newline at end of file diff --git a/templates/configmap-sms.yaml b/templates/configmap-sms.yaml deleted file mode 100644 index fd38851ebd4aa63250f0098b2d6024847fc9e82d..0000000000000000000000000000000000000000 --- a/templates/configmap-sms.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: sms - labels: -{{ include "usma.labels" . | indent 4 }} - release: sms - app: sms -data: - GIN_MODE: "debug" -# GIN_MODE: "release" - REDIS_URL: "redis://usma-redis.{{ .Release.Namespace }}:6379" - REDIS_PASSWORD: "passwd123" - ACCESS_KEY_ID: "LTAI4GBcVubRjzX7ABPcHnhB" - ACCESS_SECRET: "dYE2dtABFOqYtK1ijcrits0yedHkw7" - TPL_CODE_LOGIN: "SMS_212925130" - TPL_CODE_PWD: "SMS_212925127" - TPL_CODE_REGISTRY: "SMS_212925128" - TPL_CODE_LOGIN_ABNORMAL: "SMS_212925129" - TPL_CODE_ID_CARD: "SMS_212925131" - TPL_CODE_MOBILE: "SMS_212925126" - TPL_CODE_SYSTEM: "SMS_229477217" - SIGN_NAME: "比格数据" - SMS_MODE: "aliYun" - #SMS_MODE: "mas" - #EC_NAME: "山西省科学技术厅" - #APP_ID: "kjptdx" - #SECRET_KEY: "kjptzdh0930" - #SIGN: "OIAhvyPXt" - #MAS_URL: "http://112.35.1.155:1992/sms/norsubmit" - diff --git a/templates/configmap.yaml b/templates/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cc68a359168aa0459d56fcf6c31c5fc3a1720ba3 --- /dev/null +++ b/templates/configmap.yaml @@ -0,0 +1,13 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: usma + namespace: {{ .Release.Namespace }} +data: + GIN_MODE: "debug" + DB_SCHEMA: public + TOKEN_KEY: usmaToken + # GIN_MODE: "release" + LOG_DIR_PREFIX: "/app/log" + USMA_HOST: "https://{{ .Values.global.host }}" +{{ toYaml .Values.usma.conf | indent 2 }} diff --git a/templates/file-upload/deployment.yaml b/templates/file-upload/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ca08173ed7e5912395d7d4f520b5c1396d6b88b4 --- /dev/null +++ b/templates/file-upload/deployment.yaml @@ -0,0 +1,42 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: file-upload + namespace: {{ .Release.Namespace }} + labels: +{{ include "file-upload.labels" . | indent 4 }} + app: file-upload + versoin: {{ .Values.fileUpload.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: file-upload + template: + metadata: + labels: +{{ include "file-upload.labels" . | indent 8 }} + app: file-upload + version: {{ .Values.fileUpload.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + - name: data-file-upload + persistentVolumeClaim: + claimName: data-file-upload + containers: + - name: file-upload + {{- if contains "/" .Values.fileUpload.image.repository }} + image: "{{ .Values.fileUpload.image.repository }}:{{ .Values.fileUpload.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.fileUpload.image.repository }}:{{ .Values.fileUpload.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: data-file-upload + mountPath: /app/static diff --git a/templates/file-upload/ingressroute.yaml b/templates/file-upload/ingressroute.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b4e1783a0167d4c53a2c064e2dae482081b125c6 --- /dev/null +++ b/templates/file-upload/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: file-upload + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/bgfile`) + services: + - kind: Service + name: file-upload + port: 80 + tls: + certResolver: default diff --git a/templates/file-upload/pvc.yaml b/templates/file-upload/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5e65963439e748e526dcf38eb97ad84cd318acbe --- /dev/null +++ b/templates/file-upload/pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: data-file-upload + namespace: {{ .Release.Namespace }} +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.fileUpload.storageClassName }} + resources: + requests: + storage: 10Gi diff --git a/charts/file-upload/templates/service.yaml b/templates/file-upload/service.yaml similarity index 61% rename from charts/file-upload/templates/service.yaml rename to templates/file-upload/service.yaml index 32b2411ed49b2f35cf6f41abef33fc5c609c3ea8..f0a947909b9b77e8096788f5e775d55f13095e5d 100644 --- a/charts/file-upload/templates/service.yaml +++ b/templates/file-upload/service.yaml @@ -1,15 +1,19 @@ -apiVersion: v1 kind: Service +apiVersion: v1 metadata: name: file-upload + namespace: {{ .Release.Namespace }} labels: {{ include "file-upload.labels" . | indent 4 }} - app: file-upload -spec: - selector: app: file-upload + versoin: {{ .Values.fileUpload.image.tag }} +spec: ports: - name: http port: 80 - targetPort: 80 protocol: TCP + targetPort: 80 + selector: + app: file-upload + type: ClusterIP + sessionAffinity: None diff --git a/templates/ingresshost.yaml b/templates/ingresshost.yaml new file mode 100644 index 0000000000000000000000000000000000000000..db910cd23aae074154477c89de7a71adb7436699 --- /dev/null +++ b/templates/ingresshost.yaml @@ -0,0 +1,8 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressHost +metadata: + name: usma + namespace: {{ .Release.Namespace }} +spec: + host: {{ .Values.global.host }} + diff --git a/templates/ingressroute.yaml b/templates/ingressroute.yaml deleted file mode 100644 index 8a2c3b0725f95f556ebc0121a0fed4d1ffca12e9..0000000000000000000000000000000000000000 --- a/templates/ingressroute.yaml +++ /dev/null @@ -1,67 +0,0 @@ -apiVersion: bcc.bd-apaas.com/v1alpha1 -kind: IngressRoute -metadata: - name: {{.Release.Name}} - namespace: {{ .Release.Namespace }} -spec: - entryPoints: - - websecure - routes: - - kind: Rule - match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/sms/api`) - middlewares: [] - priority: 0 - services: - - kind: Service - name: sms-verify-api - port: 80 - - kind: Rule - match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/usma/ui`) - middlewares: [] - priority: 0 - services: - - kind: Service - name: usma-ui - port: 80 - - kind: Rule - match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/bgfile`) - middlewares: [] - priority: 0 - services: - - kind: Service - name: file-upload - port: 80 - - kind: Rule - match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/usma/api`) - middlewares: [] - priority: 0 - services: - - kind: Service - name: usma-api - port: 80 - - kind: Rule - match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/iam/api`) - middlewares: [] - priority: 0 - services: - - kind: Service - name: usma-login-api - port: 80 - - kind: Rule - match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/usma/login`) - middlewares: [] - priority: 0 - services: - - kind: Service - name: usma-login - port: 80 - tls: - certResolver: "default" ---- -apiVersion: bcc.bd-apaas.com/v1alpha1 -kind: IngressHost -metadata: - name: {{.Release.Name}} - namespace: {{ .Release.Namespace }} -spec: - host: {{ .Values.global.host }} diff --git a/templates/sms/configmap.yaml b/templates/sms/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2733fe03bf30cf1f540153215b7bab3a7c49c7ed --- /dev/null +++ b/templates/sms/configmap.yaml @@ -0,0 +1,20 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: sms-verify-api + namespace: {{ .Release.Namespace }} +data: + GIN_MODE: "debug" + REDIS_URL: {{ .Values.usma.conf.REDIS_URL }} + REDIS_PASSWORD: {{ .Values.usma.conf.REDIS_PASSWORD }} + ACCESS_KEY_ID: "LTAI4GBcVubRjzX7ABPcHnhB" + ACCESS_SECRET: "dYE2dtABFOqYtK1ijcrits0yedHkw7" + TPL_CODE_LOGIN: "SMS_212925130" + TPL_CODE_PWD: "SMS_212925127" + TPL_CODE_REGISTRY: "SMS_212925128" + TPL_CODE_LOGIN_ABNORMAL: "SMS_212925129" + TPL_CODE_ID_CARD: "SMS_460741011" + TPL_CODE_MOBILE: "SMS_212925126" + TPL_CODE_SYSTEM: "SMS_229477217" + SIGN_NAME: "比格数据" + SMS_MODE: "aliYun" diff --git a/templates/sms/deployment.yaml b/templates/sms/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6ed8f2135d352c5260115d92df08b7aecfd17808 --- /dev/null +++ b/templates/sms/deployment.yaml @@ -0,0 +1,44 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: sms-verify-api + namespace: {{ .Release.Namespace }} + labels: +{{ include "sms-verify-api.labels" . | indent 4 }} + app: sms-verify-api + versoin: {{ .Values.smsVerifyApi.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: sms-verify-api + template: + metadata: + labels: +{{ include "sms-verify-api.labels" . | indent 8 }} + app: sms-verify-api + version: {{ .Values.smsVerifyApi.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + containers: + - name: sms-verify-api + {{- if contains "/" .Values.smsVerifyApi.image.repository }} + image: "{{ .Values.smsVerifyApi.image.repository }}:{{ .Values.smsVerifyApi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.smsVerifyApi.image.repository }}:{{ .Values.smsVerifyApi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + ports: + - containerPort: 8080 + protocol: TCP + envFrom: + - configMapRef: + name: sms-verify-api + volumeMounts: + - name: localtime + mountPath: /etc/localtime + restartPolicy: Always diff --git a/templates/sms/ingressroute.yaml b/templates/sms/ingressroute.yaml new file mode 100644 index 0000000000000000000000000000000000000000..52bc058b27314deced8167defdbb3c62213b9c30 --- /dev/null +++ b/templates/sms/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: sms-verify-api + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/sms/api`) + services: + - kind: Service + name: sms-verify-api + port: 80 + tls: + certResolver: default diff --git a/charts/sms-verify-api/templates/service.yaml b/templates/sms/service.yaml similarity index 56% rename from charts/sms-verify-api/templates/service.yaml rename to templates/sms/service.yaml index f2e7a0ca0cfd772d8c7b2f78ae8383c4c27ea158..bd32e1366b32b73f3cbd330a671c741c923070ef 100644 --- a/charts/sms-verify-api/templates/service.yaml +++ b/templates/sms/service.yaml @@ -1,15 +1,19 @@ -apiVersion: v1 kind: Service +apiVersion: v1 metadata: name: sms-verify-api + namespace: {{ .Release.Namespace }} labels: {{ include "sms-verify-api.labels" . | indent 4 }} - app: sms-verify-api -spec: - selector: app: sms-verify-api + versoin: {{ .Values.smsVerifyApi.image.tag }} +spec: ports: - - name: http + - name: sms-verify-api + protocol: TCP port: 80 targetPort: 8080 - protocol: TCP + selector: + app: sms-verify-api + type: ClusterIP + sessionAffinity: None diff --git a/templates/usma-api/deployment.yaml b/templates/usma-api/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1985f2fd7b7d3d3b1adb10ef01ff6c5d448ca6f8 --- /dev/null +++ b/templates/usma-api/deployment.yaml @@ -0,0 +1,49 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: usma-api + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-api.labels" . | indent 4 }} + app: usma-api + versoin: {{ .Values.usmaApi.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: usma-api + template: + metadata: + labels: +{{ include "usma-api.labels" . | indent 8 }} + app: usma-api + version: {{ .Values.usmaApi.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + - name: data-usma-log + persistentVolumeClaim: + claimName: data-usma-log + containers: + - name: usma-api + {{- if contains "/" .Values.usmaApi.image.repository }} + image: "{{ .Values.usmaApi.image.repository }}:{{ .Values.usmaApi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.usmaApi.image.repository }}:{{ .Values.usmaApi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + ports: + - name: "usma-api" + containerPort: 8080 + protocol: "TCP" + envFrom: + - configMapRef: + name: "usma" + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: data-usma-log + mountPath: "/app/log" diff --git a/templates/usma-api/ingressroute.yaml b/templates/usma-api/ingressroute.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cd1d158cfb8ca3690a92238b1bf814fab1b919eb --- /dev/null +++ b/templates/usma-api/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: usma-api + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/usma/api`) + services: + - kind: Service + name: usma-api + port: 80 + tls: + certResolver: default diff --git a/templates/usma-api/pvc.yaml b/templates/usma-api/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9545fbb14dd8635988b4680d3635729340eec9ca --- /dev/null +++ b/templates/usma-api/pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: data-usma-log + namespace: {{ .Release.Namespace }} +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.usmaApi.storageClassName }} + resources: + requests: + storage: 10Gi diff --git a/charts/usma-api/templates/service.yaml b/templates/usma-api/service.yaml similarity index 54% rename from charts/usma-api/templates/service.yaml rename to templates/usma-api/service.yaml index 3116ba248bd9065a2c87c619e5ea83fb6f8c4d88..7a1ecb3df6b4620da66c3d6303d80a98de972aa5 100644 --- a/charts/usma-api/templates/service.yaml +++ b/templates/usma-api/service.yaml @@ -1,15 +1,16 @@ -apiVersion: v1 kind: Service +apiVersion: v1 metadata: name: usma-api + namespace: {{ .Release.Namespace }} labels: {{ include "usma-api.labels" . | indent 4 }} - app: usma-api -spec: - selector: app: usma-api + versoin: {{ .Values.usmaApi.image.tag }} +spec: ports: - - name: http + - name: usma-api port: 80 - targetPort: 80 - protocol: TCP + targetPort: 8080 + selector: + app: usma-api \ No newline at end of file diff --git a/templates/usma-api/usma-db-init.yaml b/templates/usma-api/usma-db-init.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b9cf4709089a4aff1fffe7459002c87a4a5c39b8 --- /dev/null +++ b/templates/usma-api/usma-db-init.yaml @@ -0,0 +1,22 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: usma-db-init + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + restartPolicy: Never + containers: + - name: usma-db-init + {{- if contains "/" .Values.usmaDbInit.image.repository }} + image: "{{ .Values.usmaDbInit.image.repository }}:{{ .Values.usmaDbInit.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.usmaDbInit.image.repository }}:{{ .Values.usmaDbInit.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: Always + envFrom: + - configMapRef: + name: "usma" + backoffLimit: 2 + diff --git a/templates/usma-login/api/deployment.yaml b/templates/usma-login/api/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..51a830c80a7470205529a2aebb9e7d7ac8cf64ce --- /dev/null +++ b/templates/usma-login/api/deployment.yaml @@ -0,0 +1,47 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: usma-login-api + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-login-api.labels" . | indent 4 }} + app: usma-login-api + versoin: {{ .Values.usmaLoginApi.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: usma-login-api + template: + metadata: + labels: +{{ include "usma-login-api.labels" . | indent 8 }} + app: usma-login-api + version: {{ .Values.usmaLoginApi.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + containers: + - name: usma-login-api + {{- if contains "/" .Values.usmaLoginApi.image.repository }} + image: "{{ .Values.usmaLoginApi.image.repository }}:{{ .Values.usmaLoginApi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.usmaLoginApi.image.repository }}:{{ .Values.usmaLoginApi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + ports: + - containerPort: 80 + protocol: TCP + envFrom: + - configMapRef: + name: usma + volumeMounts: + - name: localtime + mountPath: /etc/localtime + restartPolicy: Always + + + diff --git a/templates/usma-login/api/ingressroute.yaml b/templates/usma-login/api/ingressroute.yaml new file mode 100644 index 0000000000000000000000000000000000000000..40e1b0bf1956a685163f1e4035f3eb932e890ef4 --- /dev/null +++ b/templates/usma-login/api/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: usma-login-api + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/iam/api`) + services: + - kind: Service + name: usma-login-api + port: 80 + tls: + certResolver: default diff --git a/charts/usma-login-api/templates/service.yaml b/templates/usma-login/api/service.yaml similarity index 63% rename from charts/usma-login-api/templates/service.yaml rename to templates/usma-login/api/service.yaml index 64ccb0e851dbb2dbfd81760924bfee65c8b88a25..dddc89ccd7e33f95934e309a77d26e63827e281b 100644 --- a/charts/usma-login-api/templates/service.yaml +++ b/templates/usma-login/api/service.yaml @@ -1,15 +1,19 @@ -apiVersion: v1 kind: Service +apiVersion: v1 metadata: name: usma-login-api + namespace: {{ .Release.Namespace }} labels: {{ include "usma-login-api.labels" . | indent 4 }} app: usma-login-api + versoin: {{ .Values.usmaLoginApi.image.tag }} spec: - selector: - app: usma-login-api ports: - name: usma-login-api + protocol: TCP port: 80 targetPort: 80 - protocol: TCP \ No newline at end of file + selector: + app: usma-login-api + type: ClusterIP + sessionAffinity: None diff --git a/templates/usma-login/ui/deployment.yaml b/templates/usma-login/ui/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..16ecabd6e40719bec29d1cad632f0e6182265a59 --- /dev/null +++ b/templates/usma-login/ui/deployment.yaml @@ -0,0 +1,50 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: usma-login + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-login.labels" . | indent 4 }} + app: usma-login + versoin: {{ .Values.usmaLogin.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: usma-login + template: + metadata: + labels: +{{ include "usma-login.labels" . | indent 8 }} + app: usma-login + version: {{ .Values.usmaLogin.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + containers: + - name: usma-login + {{- if contains "/" .Values.usmaLogin.image.repository }} + image: "{{ .Values.usmaLogin.image.repository }}:{{ .Values.usmaLogin.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.usmaLogin.image.repository }}:{{ .Values.usmaLogin.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + ports: + - containerPort: 80 + protocol: TCP + volumeMounts: + - name: localtime + mountPath: /etc/localtime + resources: + limits: + cpu: 0.5 + memory: 1Gi + requests: + cpu: 0.1 + memory: 256Mi + restartPolicy: Always + + diff --git a/templates/usma-login/ui/ingressroute.yaml b/templates/usma-login/ui/ingressroute.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6052688c0d44ed6af5e53d01d9e3bb962d31544f --- /dev/null +++ b/templates/usma-login/ui/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: usma-login + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/usma/login`) + services: + - kind: Service + name: usma-login + port: 80 + tls: + certResolver: default diff --git a/charts/usma-login/templates/service.yaml b/templates/usma-login/ui/service.yaml similarity index 56% rename from charts/usma-login/templates/service.yaml rename to templates/usma-login/ui/service.yaml index 751849ecd45a954fe6ac577fc8a06b53f7fd4574..0a89e745bdb7dd39d036cb9d7ba42e88a1912a15 100644 --- a/charts/usma-login/templates/service.yaml +++ b/templates/usma-login/ui/service.yaml @@ -1,15 +1,19 @@ -apiVersion: v1 kind: Service +apiVersion: v1 metadata: name: usma-login + namespace: {{ .Release.Namespace }} labels: {{ include "usma-login.labels" . | indent 4 }} app: usma-login + versoin: {{ .Values.usmaLogin.image.tag }} spec: - selector: - app: usma-login ports: - - name: http + - name: usma-login + protocol: TCP port: 80 targetPort: 80 - protocol: TCP \ No newline at end of file + selector: + app: usma-login + type: ClusterIP + sessionAffinity: None diff --git a/templates/usma-ui.yaml b/templates/usma-ui.yaml new file mode 100644 index 0000000000000000000000000000000000000000..059084e782cce241076867c5fea0362f5ee25dcb --- /dev/null +++ b/templates/usma-ui.yaml @@ -0,0 +1,12 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: usma-ui + namespace: {{ .Release.Namespace }} +data: + configmap: |- + window.defaultConfig = { + tokenName: "usmaToken", + gitLogoutUrl: "https://gitlab.ysdpaas.local/usma/rest/v5/git/sign_out", + usmaLoginUrl: "https://{{ .Values.global.host }}/usma/login/#/login" + }; diff --git a/templates/usma-ui/deployment.yaml b/templates/usma-ui/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2790306410fd98f28abfc97a010fbbf89e101096 --- /dev/null +++ b/templates/usma-ui/deployment.yaml @@ -0,0 +1,62 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: usma-ui + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-ui.labels" . | indent 4 }} + app: usma-ui + versoin: {{ .Values.usmaUi.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: usma-ui + template: + metadata: + labels: +{{ include "usma-ui.labels" . | indent 8 }} + app: usma-ui + version: {{ .Values.usmaUi.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + - name: configmap + configMap: + name: usma-ui + items: + - key: configmap + path: configmap.js + containers: + - name: usma-ui + {{- if contains "/" .Values.usmaUi.image.repository }} + image: "{{ .Values.usmaUi.image.repository }}:{{ .Values.usmaUi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.usmaUi.image.repository }}:{{ .Values.usmaUi.image.tag }}{{ template "beagle.imageArch" . }}" + {{- end }} + imagePullPolicy: "{{ .Values.global.imagePullPolicy }}" + envFrom: + - configMapRef: + name: "usma" + ports: + - containerPort: 8080 + protocol: TCP + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: configmap + mountPath: /www/usma/ui/static/config/configmap.js + subPath: configmap.js + resources: + limits: + cpu: 0.5 + memory: 1Gi + requests: + cpu: 0.1 + memory: 256Mi + restartPolicy: Always + + diff --git a/templates/usma-ui/ingressroute.yaml b/templates/usma-ui/ingressroute.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9c29aa59a70c3be5f9db592cf58a7ae3fd55d8a7 --- /dev/null +++ b/templates/usma-ui/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: usma-ui + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/usma/ui`) + services: + - kind: Service + name: usma-ui + port: 8080 + tls: + certResolver: default diff --git a/templates/usma-ui/service.yaml b/templates/usma-ui/service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9874b397d4f730b0a031d251c393f00e9d9488d7 --- /dev/null +++ b/templates/usma-ui/service.yaml @@ -0,0 +1,17 @@ +kind: Service +apiVersion: v1 +metadata: + name: usma-ui + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-ui.labels" . | indent 4 }} + app: usma-ui + versoin: {{ .Values.usmaUi.image.tag }} +spec: + ports: + - name: usma-ui + protocol: TCP + port: 8080 + targetPort: 8080 + selector: + app: usma-ui diff --git a/values-overrides.yaml b/values-overrides.yaml deleted file mode 100644 index 5374a2aecc6fde641fc8c3e1fba07b62c5fe213c..0000000000000000000000000000000000000000 --- a/values-overrides.yaml +++ /dev/null @@ -1,95 +0,0 @@ -# Default values for usma. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -global: - hub: hub.wodcloud.com/usma - host: usma.test.wodcloud.com - - -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 200m - memory: 500Mi - requests: - cpu: 200m - memory: 500Mi - -file-upload: - enabled: true - image: fileupload - tag: v2.0 - storageSpec: - hostPath: "/data/usma/file-upload" - # volumeClaimTemplate: - # spec: - # storageClassName: "nfs-client" - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # selector: {} - nodeSelector: - kubernetes.io/hostname: 10.128.33.48 - -sms-verify-api: - enabled: true - image: sms-verify-api - tag: v1.0.0-alpha - -usma-api: - enabled: true - image: bg-usma-api - tag: v2.3.0-alpha - storageSpec: - hostPath: "/data/usma/usma-api/log" - # volumeClaimTemplate: - # spec: - # storageClassName: "nfs-client" - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # selector: {} - nodeSelector: - kubernetes.io/hostname: 10.128.33.48 - -usma-login: - enabled: true - image: usma-login - tag: v2.2.1-alpha - -usma-login-api: - enabled: true - image: bg-login-base - tag: v2.2.2 - -usma-postgresql: - enabled: true - image: postgres - tag: 10.6 - storageSpec: - hostPath: "/data/usma/usma-postgresql" - # volumeClaimTemplate: - # spec: - # storageClassName: "nfs-client" - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # selector: {} - nodeSelector: - kubernetes.io/hostname: 10.128.33.48 - -usma-redis: - enabled: true - image: redis - tag: 5.0.3 - -usma-ui: - enabled: true - image: usma-ui - tag: v2.2.2-alpha diff --git a/values.yaml b/values.yaml index a4545bada144380e9630d0bad57e506e216add83..acf643fc416682f542b028547f96f0ca7657e3a9 100644 --- a/values.yaml +++ b/values.yaml @@ -1,95 +1,89 @@ -# Default values for usma. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. global: - hub: hub.hbyjkffn.hb.cegn.cn:30443/wod - host: usma.hbyjkffn.hb.cegn.cn + # 镜像仓库地址 + hub: registry.cn-qingdao.aliyuncs.com/wod + # IngressHost + host: bg-usma.ysdpaas.local + # 镜像拉取策略 + imagePullPolicy: "IfNotPresent" + # 镜像架构(amd64,arm64,ppc64le,mips64le),只控制servicechoreography业务系统的镜像架构,依赖组件不受此参数控制 + imageArch: arm64 +usma: + conf: + DB_SCHEMA: "public" + DB_URL: "host=postgresql port=5432 user=postgres password=passwd123 dbname=postgres sslmode=disable search_path=public" + REDIS_URL: "redis://redis:6379" + REDIS_PASSWORD: "passwd123" + LOCATION_KEY: "QKFBZ-PGGWJ-VZQFF-FHPA7-QWT5H-YHF4T" + LOCATION_URL: "https://apis.map.qq.com/ws/location/v1/ip" + SMS_SERVICE: "http://sms-verify-api:80/sms/api" -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 200m - memory: 500Mi - requests: - cpu: 200m - memory: 500Mi +fileUpload: + image: + repository: hub.wodcloud.com/devops/fileupload + tag: v2.0 + storageClassName: "hostpath" -file-upload: - enabled: true - image: fileupload - tag: v2.0 - storageSpec: - hostPath: "/data/usma/file-upload" - # volumeClaimTemplate: - # spec: - # storageClassName: "nfs-client" - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # selector: {} - nodeSelector: - kubernetes.io/hostname: 10.11.92.36 +smsVerifyApi: + image: + repository: registry.cn-qingdao.aliyuncs.com/wod/sms-verify-api + tag: v2.4.0 -sms-verify-api: - enabled: true - image: sms-verify-api - tag: v2.0.0-hbyjt +usmaApi: + image: + repository: hub.wodcloud.com/apaas-sxxcy/usma-api + tag: v1.0.2 + storageClassName: "hostpath" -usma-api: - enabled: true - image: bg-usma-api - tag: v2.2.2 - storageSpec: - hostPath: "/data/usma/usma-api/log" - # volumeClaimTemplate: - # spec: - # storageClassName: "nfs-client" - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # selector: {} - nodeSelector: - kubernetes.io/hostname: 10.11.92.36 +usmaLoginApi: + image: + repository: hub.wodcloud.com/apaas-sxxcy/usma-login-api + tag: v1.0.0 + storageClassName: "hostpath" -usma-login: - enabled: true - image: usma-login - tag: hbyjt-2.2.2 +usmaLogin: + image: + repository: hub.wodcloud.com/apaas-sxxcy/usma-login-ui + tag: v1.0.0 -usma-login-api: - enabled: true - image: bg-login-base - tag: v2.2.2 +usmaUi: + image: + repository: hub.wodcloud.com/apaas-sxxcy/usma-ui + tag: v1.0.1 -usma-postgresql: - enabled: true - image: postgres - tag: 10.6 - storageSpec: - hostPath: "/data/usma/usma-postgresql" - # volumeClaimTemplate: - # spec: - # storageClassName: "nfs-client" - # accessModes: ["ReadWriteOnce"] - # resources: - # requests: - # storage: 1Gi - # selector: {} - nodeSelector: - kubernetes.io/hostname: 10.11.92.36 +# 初始化数据库job +usmaDbInit: + image: + repository: hub.wodcloud.com/wod/usma-db-init + tag: v1.0.0 -usma-redis: - enabled: true - image: redis - tag: 5.0.3 +# redis中间件默认svc是 redis +redis: + enabled: true + image: + repository: redis + tag: 6.2.6 + #redis的config + conf: + port: 'port 6379' + db: 'databases 16' + maxmem: 'maxmemory 256mb' + apl: 'appendonly yes' + passwd: 'requirepass passwd123' + #持久化存储类 + storageClassName: "hostpath" -usma-ui: +# postgresql中间件默认svc是 postgresql +postgresql: enabled: true - image: usma-ui - tag: hbyjt-2.2.2 \ No newline at end of file + image: + repository: postgres + tag: 13.5 + initImage: + repository: busybox + tag: 1.33 + + #数据库密码 + POSTGRES_PASSWORD: "passwd123" + #持久化存储类 + storageClassName: "hostpath"