From 5898c416b3b7e5cbbb78f55296123a0260a68fa9 Mon Sep 17 00:00:00 2001 From: dustoair <107600816+dustoair@users.noreply.github.com> Date: Sun, 24 Jul 2022 17:34:16 +0800 Subject: [PATCH] yaml upgrade --- readme.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e61b779..dc0eaea 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ - +![](https://cnjdmh6kwm1w.compat.objectstorage.ap-seoul-1.oraclecloud.com/s3/2022/07/29d6e88c6061f4d56315cb36f2c66036.png) # 接收消息与事件 https://developer.work.weixin.qq.com/document/10514 @@ -21,6 +21,83 @@ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -v -a -o wechat.b docker build -t sre/wechatgateway:arm64 . kubectl rollout restart deployment -n sre wehcat-gateway ``` +## k8s +```yaml +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: {} + labels: + app/name: wehcat-gateway + name: wehcat-gateway + namespace: sre +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app/name: wehcat-gateway + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app/name: wehcat-gateway + spec: + containers: + - image: 'sre/wechatgateway:arm64' + imagePullPolicy: IfNotPresent + name: wehcat-gateway + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /app/data + name: volume-x6hei + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - hostPath: + path: /data/wx-data + type: Directory + name: volume-x6hei + +--- +apiVersion: v1 +kind: Service +metadata: + annotations: {} + labels: + app/name: wehcat-gateway + name: wehcat-gateway + namespace: sre +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app/name: wehcat-gateway + sessionAffinity: None + type: ClusterIP + + +``` + ## ingress ```yaml