From 7aef13246ecae4b8f600b372a5a6f6b7019781f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=88=98=E6=B4=AA=E9=9D=92?= Date: Sat, 18 Sep 2021 11:24:23 +0800 Subject: [PATCH] =?utf8?q?chore:=20authx-log=EF=BC=8C=E5=8F=91=E5=B8=83?= =?utf8?q?=E7=89=88=E6=9C=AC=201.4.0-RELEASE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../8.authx-log/0.authx-log-base.yaml | 16 +++ .../8.authx-log/1.authx-log-env.yaml | 26 ++++ .../8.authx-log/4.0.authx-log-installer.yaml | 45 +++++++ .../8.authx-log/4.2.authx-log-sa.yaml | 116 ++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/0.authx-log-base.yaml create mode 100644 deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/1.authx-log-env.yaml create mode 100644 deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.0.authx-log-installer.yaml create mode 100644 deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.2.authx-log-sa.yaml diff --git a/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/0.authx-log-base.yaml b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/0.authx-log-base.yaml new file mode 100644 index 0000000..84e9a09 --- /dev/null +++ b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/0.authx-log-base.yaml @@ -0,0 +1,16 @@ +# 0.authx-log-base.yaml + +#################################################### +# supwisdom harbor private docker registry +#################################################### +--- +apiVersion: v1 +kind: Secret +type: kubernetes.io/dockerconfigjson +metadata: + namespace: authx-log + name: harbor-registry +data: + # 修改harbor仓库配置,并使用 base64 工具进行编码 + # {"auths":{"harbor.supwisdom.com":{"password":"PWMgP85qiLFC","username":"rancher.devops"}}} + .dockerconfigjson: eyJhdXRocyI6eyJoYXJib3Iuc3Vwd2lzZG9tLmNvbSI6eyJwYXNzd29yZCI6IlBXTWdQODVxaUxGQyIsInVzZXJuYW1lIjoicmFuY2hlci5kZXZvcHMifX19 diff --git a/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/1.authx-log-env.yaml b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/1.authx-log-env.yaml new file mode 100644 index 0000000..8b20aad --- /dev/null +++ b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/1.authx-log-env.yaml @@ -0,0 +1,26 @@ +# 1.authx-log-env.yaml + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: authx-log + name: jvm-env +data: + MAX_RAM_PERCENTAGE: "75.0" + +--- +apiVersion: v1 +kind: Secret +metadata: + namespace: authx-log + name: datasource-env-secret +type: Opaque +data: + # jdbc:mysql://mysql-server.authx-service.svc.cluster.local:3306/authx_log?serverTimezone=Asia/Shanghai + JDBC_URL: amRiYzpteXNxbDovL215c3FsLXNlcnZlci5hdXRoeC1zZXJ2aWNlLnN2Yy5jbHVzdGVyLmxvY2FsOjMzMDYvYXV0aHhfbG9nP3NlcnZlclRpbWV6b25lPUFzaWEvU2hhbmdoYWk= + # authx_log + JDBC_USERNAME: YXV0aHhfbG9n + # 修改为实际的数据库密码,并使用 base64 工具进行编码 + # kingstar + JDBC_PASSWORD: a2luZ3N0YXI= diff --git a/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.0.authx-log-installer.yaml b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.0.authx-log-installer.yaml new file mode 100644 index 0000000..91a19ba --- /dev/null +++ b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.0.authx-log-installer.yaml @@ -0,0 +1,45 @@ +# 4.0.authx-log-installer.yaml + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: authx-log + name: authx-log-installer-env +data: + DB_TYPE: mysql8 + + +--- +apiVersion: batch/v1 +kind: Job +metadata: + namespace: authx-log + name: authx-log-installer +spec: + completions: 1 + parallelism: 1 + template: + metadata: + labels: + app: authx-log-installer + spec: + restartPolicy: Never + containers: + - name: authx-log-installer + image: harbor.supwisdom.com/authx-log/authx-log-installer:1.4.0-RELEASE + imagePullPolicy: Always + envFrom: + - configMapRef: + name: jvm-env + - secretRef: + name: datasource-env-secret + - configMapRef: + name: authx-log-installer-env + resources: + requests: + memory: "256Mi" + limits: + memory: "256Mi" + imagePullSecrets: + - name: harbor-supwisdom diff --git a/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.2.authx-log-sa.yaml b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.2.authx-log-sa.yaml new file mode 100644 index 0000000..dc4facf --- /dev/null +++ b/deploy-manifests/k8s-rancher/1.authx-service/8.authx-log/4.2.authx-log-sa.yaml @@ -0,0 +1,116 @@ +# 4.2.authx-log-sa.yaml + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: authx-log + name: authx-log-sa-env +data: + SERVER_PORT: "8080" + SSL_ENABLED: "false" + #SSL_KEYSTORE_FILE: file:/certs/server/server.keystore + #SSL_KEYSTORE_PASSWORD: "" + #SSL_TRUSTSTORE_FILE: file:/certs/server/server.truststore + #SSL_TRUSTSTORE_PASSWORD: "" + + SERVER_MAXHTTPHEADERSIZE: "10240" + + #同环境中用户的地址 + USER_DATA_SERVICE_SERVER_URL: http://user-data-service-goa-svc.user-data-service.svc.cluster.local:8080 + USER_DATA_SERVICE_CLIENT_AUTH_ENABLED: "false" + # USER_DATA_SERVICE_CLIENT_AUTH_KEY_PASSWORD: "" + # USER_DATA_SERVICE_CLIENT_AUTH_KEYSTORE_FILE: file:/certs/common/common.keystore + # USER_DATA_SERVICE_CLIENT_AUTH_KEYSTORE_PASSWORD: "" + # USER_DATA_SERVICE_CLIENT_AUTH_TRUSTSTORE_FILE: file:/certs/common/common.truststore + # USER_DATA_SERVICE_CLIENT_AUTH_TRUSTSTORE_PASSWORD: "" + + #ipaddr + IPADDR_SERVER_URL: http://ipaddr.ipaddr.svc.cluster.local:9090 + IPADDR_CLIENT_AUTH_ENABLED: "false" + #IPADDR_CLIENT_AUTH_KEY_PASSWORD: "" + #IPADDR_CLIENT_AUTH_KEYSTORE_FILE: file:/certs/client/client.keystore + #IPADDR_CLIENT_AUTH_KEYSTORE_PASSWORD: "" + #IPADDR_CLIENT_AUTH_TRUSTSTORE_FILE: file:/certs/client/client.truststore + #IPADDR_CLIENT_AUTH_TRUSTSTORE_PASSWORD: "" + + + AUTHX_LOG_ENABLED: "true" + AUTHX_LOG_RABBITMQ_HOST: rabbitmq-server.authx-service.svc.cluster.local + AUTHX_LOG_RABBITMQ_PORT: "5672" + AUTHX_LOG_RABBITMQ_USERNAME: guest + AUTHX_LOG_RABBITMQ_PASSWORD: guest + + +--- +apiVersion: v1 +kind: Service +metadata: + namespace: authx-log + name: authx-log-sa-svc + labels: + app: authx-log-sa + needMonitor: 'true' +spec: + ports: + - port: 8080 + targetPort: http + protocol: TCP + name: http + - port: 6060 + targetPort: http-metrics + protocol: TCP + name: http-metrics + selector: + app: authx-log-sa + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: authx-log + name: authx-log-sa +spec: + selector: + matchLabels: + app: authx-log-sa + replicas: 1 + template: + metadata: + labels: + app: authx-log-sa + annotations: + co.elastic.logs/enabled: "true" + spec: + containers: + - name: authx-log-sa + image: harbor.supwisdom.com/authx-log/authx-log-sa:1.4.0-RELEASE + imagePullPolicy: Always + ports: + - containerPort: 8080 + name: http + - containerPort: 6060 + name: http-metrics + envFrom: + - configMapRef: + name: jvm-env + - secretRef: + name: datasource-env-secret + - configMapRef: + name: authx-log-sa-env + resources: + requests: + memory: "400Mi" + limits: + memory: "400Mi" + readinessProbe: + httpGet: + path: /actuator/health + port: 8080 + initialDelaySeconds: 20 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 10 + imagePullSecrets: + - name: harbor-supwisdom -- 2.17.1