From 66d7a01ca20576bfe59e30c3745403c4fbb9a405 Mon Sep 17 00:00:00 2001 From: starsliao Date: Mon, 31 Jul 2023 22:01:54 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=8E=BB=E9=99=A4=E8=87=AA=E5=BB=BAECS?= =?UTF-8?q?=E6=8E=A5=E5=85=A5consul=E8=87=AA=E5=B8=A6=E7=9A=84=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/k8s/1.consul-deploy.yaml | 119 ------------------------------ install/k8s/2.tensuns-deploy.yaml | 118 ----------------------------- 2 files changed, 237 deletions(-) delete mode 100644 install/k8s/1.consul-deploy.yaml delete mode 100644 install/k8s/2.tensuns-deploy.yaml diff --git a/install/k8s/1.consul-deploy.yaml b/install/k8s/1.consul-deploy.yaml deleted file mode 100644 index 554bc62..0000000 --- a/install/k8s/1.consul-deploy.yaml +++ /dev/null @@ -1,119 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: tensuns ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: consul-config - namespace: tensuns - labels: - app: consul -data: - consul.hcl: |+ - log_level = "error" - data_dir = "/consul/data" - client_addr = "0.0.0.0" - ui_config { - enabled = true - } - ports = { - grpc = -1 - https = -1 - dns = -1 - grpc_tls = -1 - serf_wan = -1 - } - peering { - enabled = false - } - connect { - enabled = false - } - acl = { - enabled = true - default_policy = "deny" - enable_token_persistence = true - tokens { - initial_management = "0fa6736f-745f-411a-886c-0d6800818253" - agent = "0fa6736f-745f-411a-886c-0d6800818253" - } - } - server = true - bootstrap_expect = 1 ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: consul - namespace: tensuns - labels: - app: consul -spec: - replicas: 1 - selector: - matchLabels: - app: consul - template: - metadata: - labels: - app: consul - spec: - volumes: - - name: consul-config - configMap: - name: consul-config - containers: - - name: consul - image: 'swr.cn-south-1.myhuaweicloud.com/starsl.cn/consul:latest' - ports: - - name: http - containerPort: 8500 - protocol: TCP - env: - - name: TZ - value: Asia/Shanghai - volumeMounts: - - name: consul-data - mountPath: /consul/data - - name: consul-config - mountPath: /consul/config/consul.hcl - subPath: consul.hcl - imagePullPolicy: IfNotPresent - restartPolicy: Always - volumeClaimTemplates: - - kind: PersistentVolumeClaim - apiVersion: v1 - metadata: - name: consul-data - namespace: tensuns - annotations: - everest.io/disk-volume-type: SAS - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi - storageClassName: csi-disk - volumeMode: Filesystem - serviceName: consul - ---- -apiVersion: v1 -kind: Service -metadata: - name: consul - namespace: tensuns - labels: - app: consul -spec: - ports: - - name: http - protocol: TCP - port: 8500 - targetPort: 8500 - selector: - app: consul - type: ClusterIP diff --git a/install/k8s/2.tensuns-deploy.yaml b/install/k8s/2.tensuns-deploy.yaml deleted file mode 100644 index 06ed4ab..0000000 --- a/install/k8s/2.tensuns-deploy.yaml +++ /dev/null @@ -1,118 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: tensuns ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: flask-consul - namespace: tensuns - labels: - app: flask-consul -spec: - replicas: 1 - selector: - matchLabels: - app: flask-consul - template: - metadata: - labels: - app: flask-consul - spec: - initContainers: - - name: wait-for-consul - image: busybox - command: - - sh - - '-c' - - >- - for i in $(seq 1 60); do nc -z -w3 consul 8500 && exit 0 || - sleep 5; done; exit 1 - imagePullPolicy: IfNotPresent - containers: - - name: flask-consul - image: 'swr.cn-south-1.myhuaweicloud.com/starsl.cn/flask-consul:latest' - ports: - - name: http-2026 - containerPort: 2026 - protocol: TCP - env: - - name: admin_passwd - value: 'sss' - - name: consul_token - value: '0fa6736f-745f-411a-886c-0d6800818253' - - name: consul_url - value: 'http://consul:8500/v1' - - name: log_level - value: INFO - - name: TZ - value: Asia/Shanghai - imagePullPolicy: Always - restartPolicy: Always ---- -kind: Service -apiVersion: v1 -metadata: - name: flask-consul - namespace: tensuns - labels: - app: flask-consul -spec: - ports: - - name: http-2026 - protocol: TCP - port: 2026 - targetPort: 2026 - selector: - app: flask-consul - type: ClusterIP ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: nginx-consul - namespace: tensuns - labels: - app: nginx-consul -spec: - replicas: 1 - selector: - matchLabels: - app: nginx-consul - template: - metadata: - labels: - app: nginx-consul - spec: - containers: - - name: nginx-consul - image: 'swr.cn-south-1.myhuaweicloud.com/starsl.cn/nginx-consul:latest' - ports: - - name: http-1026 - containerPort: 1026 - protocol: TCP - env: - - name: TZ - value: Asia/Shanghai - imagePullPolicy: Always - restartPolicy: Always ---- -kind: Service -apiVersion: v1 -metadata: - name: tensuns - namespace: tensuns - labels: - app: tensuns -spec: - ports: - - name: nginx-consul - protocol: TCP - port: 1026 - targetPort: 1026 - nodePort: 31026 - selector: - app: nginx-consul - type: NodePort - externalTrafficPolicy: Cluster