From 97f34781935bb0a5c12f88bd0a606231ed0e7110 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Aug 2023 14:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chart.yaml | 32 ++-- README.md | 27 +++ charts/file-upload/Chart.yaml | 11 -- charts/file-upload/templates/_helpers.tpl | 20 --- charts/file-upload/templates/file-upload.yaml | 71 -------- charts/portal/Chart.yaml | 6 + charts/portal/templates/configmap.yaml | 7 + charts/portal/templates/deployment.yaml | 58 +++++++ charts/portal/templates/ingressroute.yaml | 17 ++ charts/portal/templates/service.yaml | 19 +++ charts/postgresql/Chart.yaml | 6 + charts/postgresql/templates/configmap.yaml | 9 + charts/postgresql/templates/service.yaml | 13 ++ charts/postgresql/templates/statefulset.yaml | 87 ++++++++++ charts/redis/Chart.yaml | 6 + charts/redis/templates/configmap.yaml | 18 ++ charts/redis/templates/service.yaml | 13 ++ charts/redis/templates/statefulset.yaml | 72 ++++++++ charts/sms-verify-api/Chart.yaml | 11 -- charts/sms-verify-api/templates/_helpers.tpl | 20 --- .../templates/sms-verify-api.yaml | 52 ------ charts/usma-api/Chart.yaml | 11 -- charts/usma-api/templates/_helpers.tpl | 20 --- charts/usma-api/templates/service.yaml | 15 -- charts/usma-api/templates/usma-api.yaml | 70 -------- charts/usma-login-api/Chart.yaml | 11 -- charts/usma-login-api/templates/_helpers.tpl | 20 --- .../templates/usma-login-api.yaml | 48 ------ charts/usma-login/Chart.yaml | 11 -- charts/usma-login/templates/_helpers.tpl | 20 --- charts/usma-login/templates/service.yaml | 15 -- charts/usma-login/templates/usma-login.yaml | 43 ----- charts/usma-postgresql/Chart.yaml | 11 -- charts/usma-postgresql/templates/_helpers.tpl | 20 --- .../usma-postgresql/templates/configmap.yaml | 12 -- charts/usma-postgresql/templates/service.yaml | 15 -- .../templates/usma-postgres.yaml | 67 -------- charts/usma-redis/Chart.yaml | 11 -- charts/usma-redis/templates/_helpers.tpl | 20 --- charts/usma-redis/templates/configmap.yaml | 12 -- charts/usma-redis/templates/service.yaml | 15 -- charts/usma-redis/templates/usma-redis.yaml | 47 ------ charts/usma-ui/Chart.yaml | 11 -- charts/usma-ui/templates/_helpers.tpl | 20 --- charts/usma-ui/templates/usma-ui.yaml | 48 ------ deploy.md | 0 requirements.yaml | 25 --- templates/_helpers.tpl | 116 +++++++------ templates/comfigmap-usma.yaml | 19 --- templates/configmap.yaml | 11 ++ templates/cros-ingresstoute.yaml | 25 +++ templates/file-upload/deployment.yaml | 42 +++++ templates/file-upload/ingressroute.yaml | 17 ++ templates/file-upload/pvc.yaml | 11 ++ .../file-upload}/service.yaml | 14 +- templates/ingresshost.yaml | 8 + templates/ingressroute.yaml | 67 -------- .../configmap.yaml} | 20 +-- templates/sms/deployment.yaml | 44 +++++ templates/sms/ingressroute.yaml | 17 ++ .../templates => templates/sms}/service.yaml | 16 +- templates/usma-api/deployment.yaml | 49 ++++++ templates/usma-api/ingressroute.yaml | 23 +++ templates/usma-api/pvc.yaml | 11 ++ templates/usma-api/service.yaml | 19 +++ templates/usma-login/api/deployment.yaml | 47 ++++++ templates/usma-login/api/ingressroute.yaml | 17 ++ .../usma-login/api}/service.yaml | 12 +- templates/usma-login/ui/deployment.yaml | 50 ++++++ templates/usma-login/ui/ingressroute.yaml | 17 ++ templates/usma-login/ui/service.yaml | 19 +++ templates/usma-ui/deployment.yaml | 53 ++++++ templates/usma-ui/ingressroute.yaml | 17 ++ .../usma-ui}/service.yaml | 16 +- values-overrides.yaml | 95 ----------- values.yaml | 159 +++++++++--------- 76 files changed, 1049 insertions(+), 1175 deletions(-) create mode 100644 README.md delete mode 100644 charts/file-upload/Chart.yaml delete mode 100644 charts/file-upload/templates/_helpers.tpl delete mode 100644 charts/file-upload/templates/file-upload.yaml create mode 100644 charts/portal/Chart.yaml create mode 100644 charts/portal/templates/configmap.yaml create mode 100644 charts/portal/templates/deployment.yaml create mode 100644 charts/portal/templates/ingressroute.yaml create mode 100644 charts/portal/templates/service.yaml create mode 100644 charts/postgresql/Chart.yaml create mode 100644 charts/postgresql/templates/configmap.yaml create mode 100644 charts/postgresql/templates/service.yaml create mode 100644 charts/postgresql/templates/statefulset.yaml create mode 100644 charts/redis/Chart.yaml create mode 100644 charts/redis/templates/configmap.yaml create mode 100644 charts/redis/templates/service.yaml create mode 100644 charts/redis/templates/statefulset.yaml delete mode 100644 charts/sms-verify-api/Chart.yaml delete mode 100644 charts/sms-verify-api/templates/_helpers.tpl delete mode 100644 charts/sms-verify-api/templates/sms-verify-api.yaml delete mode 100644 charts/usma-api/Chart.yaml delete mode 100644 charts/usma-api/templates/_helpers.tpl delete mode 100644 charts/usma-api/templates/service.yaml delete mode 100644 charts/usma-api/templates/usma-api.yaml delete mode 100644 charts/usma-login-api/Chart.yaml delete mode 100644 charts/usma-login-api/templates/_helpers.tpl delete mode 100644 charts/usma-login-api/templates/usma-login-api.yaml delete mode 100644 charts/usma-login/Chart.yaml delete mode 100644 charts/usma-login/templates/_helpers.tpl delete mode 100644 charts/usma-login/templates/service.yaml delete mode 100644 charts/usma-login/templates/usma-login.yaml delete mode 100644 charts/usma-postgresql/Chart.yaml delete mode 100644 charts/usma-postgresql/templates/_helpers.tpl delete mode 100644 charts/usma-postgresql/templates/configmap.yaml delete mode 100644 charts/usma-postgresql/templates/service.yaml delete mode 100644 charts/usma-postgresql/templates/usma-postgres.yaml delete mode 100644 charts/usma-redis/Chart.yaml delete mode 100644 charts/usma-redis/templates/_helpers.tpl delete mode 100644 charts/usma-redis/templates/configmap.yaml delete mode 100644 charts/usma-redis/templates/service.yaml delete mode 100644 charts/usma-redis/templates/usma-redis.yaml delete mode 100644 charts/usma-ui/Chart.yaml delete mode 100644 charts/usma-ui/templates/_helpers.tpl delete mode 100644 charts/usma-ui/templates/usma-ui.yaml create mode 100644 deploy.md delete mode 100644 requirements.yaml delete mode 100644 templates/comfigmap-usma.yaml create mode 100644 templates/configmap.yaml create mode 100644 templates/cros-ingresstoute.yaml create mode 100644 templates/file-upload/deployment.yaml create mode 100644 templates/file-upload/ingressroute.yaml create mode 100644 templates/file-upload/pvc.yaml rename {charts/file-upload/templates => templates/file-upload}/service.yaml (61%) create mode 100644 templates/ingresshost.yaml delete mode 100644 templates/ingressroute.yaml rename templates/{configmap-sms.yaml => sms/configmap.yaml} (53%) create mode 100644 templates/sms/deployment.yaml create mode 100644 templates/sms/ingressroute.yaml rename {charts/sms-verify-api/templates => templates/sms}/service.yaml (56%) create mode 100644 templates/usma-api/deployment.yaml create mode 100644 templates/usma-api/ingressroute.yaml create mode 100644 templates/usma-api/pvc.yaml create mode 100644 templates/usma-api/service.yaml create mode 100644 templates/usma-login/api/deployment.yaml create mode 100644 templates/usma-login/api/ingressroute.yaml rename {charts/usma-login-api/templates => templates/usma-login/api}/service.yaml (63%) create mode 100644 templates/usma-login/ui/deployment.yaml create mode 100644 templates/usma-login/ui/ingressroute.yaml create mode 100644 templates/usma-login/ui/service.yaml create mode 100644 templates/usma-ui/deployment.yaml create mode 100644 templates/usma-ui/ingressroute.yaml rename {charts/usma-ui/templates => templates/usma-ui}/service.yaml (51%) delete mode 100644 values-overrides.yaml diff --git a/Chart.yaml b/Chart.yaml index 157d834..98924e8 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 0000000..d187661 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +### 概要说明 + +``` +统一用户v2.4.0 +``` + +### 安装方式 + +``` shell +helm install usma . -f values.yaml -n namespace +``` + +### 卸载方式 + +``` shell +helm uninstall usma -n namespace +``` +## 迁移对应数据库 + +1. postgresql (数据库) 运维自行部署,运行usma_db_init 镜像 +2. redis (中间件) 运维自行部署 + + +## 部署 + +1. ingresshost.yaml 域名配置 +2. usma.cm.yaml (根据实际的数据库和redis修改连接地址) diff --git a/charts/file-upload/Chart.yaml b/charts/file-upload/Chart.yaml deleted file mode 100644 index fe66240..0000000 --- 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 91df64c..0000000 --- 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 d22ab2a..0000000 --- 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/portal/Chart.yaml b/charts/portal/Chart.yaml new file mode 100644 index 0000000..886cb4f --- /dev/null +++ b/charts/portal/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +appVersion: v1.0.0 +description: 统一门户 +name: portal +type: application +version: v1.0 diff --git a/charts/portal/templates/configmap.yaml b/charts/portal/templates/configmap.yaml new file mode 100644 index 0000000..651839c --- /dev/null +++ b/charts/portal/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal-ui + namespace: {{ .Release.Namespace }} +data: +{{ toYaml .Values.conf | indent 2 }} diff --git a/charts/portal/templates/deployment.yaml b/charts/portal/templates/deployment.yaml new file mode 100644 index 0000000..93562c7 --- /dev/null +++ b/charts/portal/templates/deployment.yaml @@ -0,0 +1,58 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: portal-ui + namespace: {{ .Release.Namespace }} + labels: +{{ include "portal-ui.labels" . | indent 4 }} + app: portal-ui + versoin: {{ .Values.image.tag }} +spec: + replicas: 1 + selector: + matchLabels: + app: portal-ui + template: + metadata: + labels: +{{ include "portal-ui.labels" . | indent 8 }} + app: portal-ui + version: {{ .Values.image.tag }} + spec: + volumes: + - name: localtime + hostPath: + path: /etc/localtime + type: '' + - name: menu + configMap: + name: portal-ui + containers: + - name: portal-ui + {{- if contains "/" .Values.image.repository }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}{{ template "beagle.imageArch" . }}" + {{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.image.repository }}:{{ .Values.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: menu + mountPath: /www/static + resources: + limits: + cpu: 0.5 + memory: 1Gi + requests: + cpu: 0.1 + memory: 256Mi + restartPolicy: Always + + diff --git a/charts/portal/templates/ingressroute.yaml b/charts/portal/templates/ingressroute.yaml new file mode 100644 index 0000000..a6610f4 --- /dev/null +++ b/charts/portal/templates/ingressroute.yaml @@ -0,0 +1,17 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: portal-ui + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/portal/ui`) + services: + - kind: Service + name: portal-ui + port: 80 + tls: + certResolver: default diff --git a/charts/portal/templates/service.yaml b/charts/portal/templates/service.yaml new file mode 100644 index 0000000..dbd3656 --- /dev/null +++ b/charts/portal/templates/service.yaml @@ -0,0 +1,19 @@ +kind: Service +apiVersion: v1 +metadata: + name: portal-ui + namespace: {{ .Release.Namespace }} + labels: +{{ include "portal-ui.labels" . | indent 4 }} + app: portal-ui + versoin: {{ .Values.image.tag }} +spec: + ports: + - name: portal-ui + protocol: TCP + port: 80 + targetPort: 80 + selector: + app: portal-ui + type: ClusterIP + sessionAffinity: None diff --git a/charts/postgresql/Chart.yaml b/charts/postgresql/Chart.yaml new file mode 100644 index 0000000..890a57c --- /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 0000000..4e4117c --- /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 0000000..cd9ee6f --- /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 0000000..5c34232 --- /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 0000000..b2175fd --- /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 0000000..0d983c2 --- /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 0000000..ee6b064 --- /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 0000000..01c214a --- /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 92f872a..0000000 --- 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 b7f0d52..0000000 --- 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 76c163a..0000000 --- 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 4789f81..0000000 --- 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 e098969..0000000 --- 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/service.yaml b/charts/usma-api/templates/service.yaml deleted file mode 100644 index 3116ba2..0000000 --- a/charts/usma-api/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: usma-api - labels: -{{ include "usma-api.labels" . | indent 4 }} - app: usma-api -spec: - selector: - app: usma-api - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP diff --git a/charts/usma-api/templates/usma-api.yaml b/charts/usma-api/templates/usma-api.yaml deleted file mode 100644 index d39ddc2..0000000 --- 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 47556f5..0000000 --- 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 9bf4672..0000000 --- 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 f0f6ddc..0000000 --- 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 84c6497..0000000 --- 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 408174d..0000000 --- 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/service.yaml b/charts/usma-login/templates/service.yaml deleted file mode 100644 index 751849e..0000000 --- a/charts/usma-login/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: usma-login - labels: -{{ include "usma-login.labels" . | indent 4 }} - app: usma-login -spec: - selector: - app: usma-login - ports: - - name: http - port: 80 - targetPort: 80 - protocol: TCP \ No newline at end of file diff --git a/charts/usma-login/templates/usma-login.yaml b/charts/usma-login/templates/usma-login.yaml deleted file mode 100644 index 79e91a7..0000000 --- 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 9e36981..0000000 --- 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 0eb4de3..0000000 --- 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 f9e37f1..0000000 --- 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 96d43b9..0000000 --- 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 6269a74..0000000 --- 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 060396d..0000000 --- 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 ea32b5d..0000000 --- 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 93bf186..0000000 --- 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 220abff..0000000 --- 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 9001ef7..0000000 --- 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 4cf7d15..0000000 --- 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 cf50e60..0000000 --- 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/usma-ui.yaml b/charts/usma-ui/templates/usma-ui.yaml deleted file mode 100644 index ffc4068..0000000 --- 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 0000000..e69de29 diff --git a/requirements.yaml b/requirements.yaml deleted file mode 100644 index c6a9727..0000000 --- a/requirements.yaml +++ /dev/null @@ -1,25 +0,0 @@ -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 diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 3c5e498..87ccbff 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 48dbd23..0000000 --- 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.yaml b/templates/configmap.yaml new file mode 100644 index 0000000..b32fe2b --- /dev/null +++ b/templates/configmap.yaml @@ -0,0 +1,11 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: usma + namespace: {{ .Release.Namespace }} +data: + GIN_MODE: "debug" + # GIN_MODE: "release" + LOG_DIR_PREFIX: "/app/log" + USMA_HOST: "https://{{ .Values.global.host }}" +{{ toYaml .Values.usma.conf | indent 2 }} diff --git a/templates/cros-ingresstoute.yaml b/templates/cros-ingresstoute.yaml new file mode 100644 index 0000000..d653c58 --- /dev/null +++ b/templates/cros-ingresstoute.yaml @@ -0,0 +1,25 @@ +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: IngressRoute +metadata: + name: usma-cros + namespace: {{ .Release.Namespace }} +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/apaas/serviceapp`) + services: + - kind: Service + name: apaas-serviceapp + namespace: {{ .Values.cros.apaasNamespace }} + port: 80 + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/awecloud/apiserver`) + services: + - kind: Service + name: awecloud-apiserver + namespace: {{ .Values.cros.cloudNamespace }} + port: 80 + tls: + certResolver: default diff --git a/templates/file-upload/deployment.yaml b/templates/file-upload/deployment.yaml new file mode 100644 index 0000000..ca08173 --- /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 0000000..b4e1783 --- /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 0000000..6e2e51f --- /dev/null +++ b/templates/file-upload/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: data-file-upload +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 32b2411..f0a9479 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 0000000..db910cd --- /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 8a2c3b0..0000000 --- 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/configmap-sms.yaml b/templates/sms/configmap.yaml similarity index 53% rename from templates/configmap-sms.yaml rename to templates/sms/configmap.yaml index fd38851..f02c63c 100644 --- a/templates/configmap-sms.yaml +++ b/templates/sms/configmap.yaml @@ -1,16 +1,11 @@ ---- kind: ConfigMap apiVersion: v1 metadata: - name: sms - labels: -{{ include "usma.labels" . | indent 4 }} - release: sms - app: sms + name: sms-verify-api + namespace: {{ .Release.Namespace }} data: GIN_MODE: "debug" -# GIN_MODE: "release" - REDIS_URL: "redis://usma-redis.{{ .Release.Namespace }}:6379" + REDIS_URL: "redis://redis.usma:6379" REDIS_PASSWORD: "passwd123" ACCESS_KEY_ID: "LTAI4GBcVubRjzX7ABPcHnhB" ACCESS_SECRET: "dYE2dtABFOqYtK1ijcrits0yedHkw7" @@ -18,15 +13,8 @@ data: TPL_CODE_PWD: "SMS_212925127" TPL_CODE_REGISTRY: "SMS_212925128" TPL_CODE_LOGIN_ABNORMAL: "SMS_212925129" - TPL_CODE_ID_CARD: "SMS_212925131" + TPL_CODE_ID_CARD: "SMS_460741011" 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/sms/deployment.yaml b/templates/sms/deployment.yaml new file mode 100644 index 0000000..6ed8f21 --- /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 0000000..52bc058 --- /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 f2e7a0c..bd32e13 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 0000000..1985f2f --- /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 0000000..b53a550 --- /dev/null +++ b/templates/usma-api/ingressroute.yaml @@ -0,0 +1,23 @@ +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: service + port: 80 + - kind: Rule + match: Host(`{{ .Values.global.host }}`) && PathPrefix(`/service`) + 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 0000000..cb8cd6e --- /dev/null +++ b/templates/usma-api/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: data-usma-log +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.usmaApi.storageClassName }} + resources: + requests: + storage: 10Gi diff --git a/templates/usma-api/service.yaml b/templates/usma-api/service.yaml new file mode 100644 index 0000000..b1c222d --- /dev/null +++ b/templates/usma-api/service.yaml @@ -0,0 +1,19 @@ +kind: Service +apiVersion: v1 +metadata: + name: usma-api + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-api.labels" . | indent 4 }} + app: usma-api + versoin: {{ .Values.usmaApi.image.tag }} +spec: + ports: + - name: "usma-api" + protocol: "TCP" + port: 80 + targetPort: 8080 + selector: + app: usma-api + type: ClusterIP + sessionAffinity: None diff --git a/templates/usma-login/api/deployment.yaml b/templates/usma-login/api/deployment.yaml new file mode 100644 index 0000000..51a830c --- /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 0000000..40e1b0b --- /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 64ccb0e..dddc89c 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 0000000..16ecabd --- /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 0000000..6052688 --- /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/templates/usma-login/ui/service.yaml b/templates/usma-login/ui/service.yaml new file mode 100644 index 0000000..df638dc --- /dev/null +++ b/templates/usma-login/ui/service.yaml @@ -0,0 +1,19 @@ +kind: Service +apiVersion: v1 +metadata: + name: usma-login + namespace: {{ .Release.Namespace }} + labels: +{{ include "usma-login.labels" . | indent 4 }} + app: auto-ui + versoin: {{ .Values.usmaLogin.image.tag }} +spec: + ports: + - name: usma-login + protocol: TCP + port: 80 + targetPort: 8080 + selector: + app: usma-login + type: ClusterIP + sessionAffinity: None diff --git a/templates/usma-ui/deployment.yaml b/templates/usma-ui/deployment.yaml new file mode 100644 index 0000000..6ea385d --- /dev/null +++ b/templates/usma-ui/deployment.yaml @@ -0,0 +1,53 @@ +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: '' + 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: 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-ui/ingressroute.yaml b/templates/usma-ui/ingressroute.yaml new file mode 100644 index 0000000..6c9d328 --- /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: 80 + tls: + certResolver: default diff --git a/charts/usma-ui/templates/service.yaml b/templates/usma-ui/service.yaml similarity index 51% rename from charts/usma-ui/templates/service.yaml rename to templates/usma-ui/service.yaml index eb2c0a4..fd02cbc 100644 --- a/charts/usma-ui/templates/service.yaml +++ b/templates/usma-ui/service.yaml @@ -1,15 +1,19 @@ -apiVersion: v1 kind: Service +apiVersion: v1 metadata: name: usma-ui + namespace: {{ .Release.Namespace }} labels: {{ include "usma-ui.labels" . | indent 4 }} - app: usma-ui -spec: - selector: app: usma-ui + versoin: {{ .Values.usmaUi.image.tag }} +spec: ports: - - name: http + - name: usma-ui + protocol: TCP port: 80 targetPort: 80 - protocol: TCP \ No newline at end of file + selector: + app: usma-ui + type: ClusterIP + sessionAffinity: None diff --git a/values-overrides.yaml b/values-overrides.yaml deleted file mode 100644 index 5374a2a..0000000 --- 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 a4545ba..e7a9e51 100644 --- a/values.yaml +++ b/values.yaml @@ -1,95 +1,92 @@ -# 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: usma.wodcloud.local + # 镜像拉取策略 + imagePullPolicy: "IfNotPresent" + # 镜像架构(amd64,arm64,ppc64le,mips64le),只控制servicechoreography业务系统的镜像架构,依赖组件不受此参数控制 + imageArch: arm64 +usma: + conf: + DB_URL: "host=postgresql.test port=5432 user=postgres password=passwd123 dbname=usma sslmode=disable" + REDIS_URL: "redis://redis.test: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.test: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: 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/usma/bg-usma-api + tag: v2.2.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/usma/bg-login-base + tag: v2.2.2 + storageClassName: "hostpath" -usma-login: - enabled: true - image: usma-login - tag: hbyjt-2.2.2 +usmaLogin: + image: + repository: hub.wodcloud.com/usma/usma-login + tag: v2.2.1 -usma-login-api: - enabled: true - image: bg-login-base - tag: v2.2.2 +usmaUi: + image: + repository: hub.wodcloud.com/usma/usma-ui + tag: v2.2.2 -usma-postgresql: +# 统一门户 +portal: 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 + image: + repository: ui-base + tag: v6.0 + conf: + configmap: "window.serviceConfig = {\n apaas: 'https://apaas.hbyjkffn.hb.cegn.cn:30443/apaas/ui/#/',\n}" -usma-redis: +cros: + apaasNamespace: apaas + cloudNamespace: beagle-system +redis: enabled: true - image: redis - tag: 5.0.3 + 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: 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" -- 2.26.0