From f269d012b3896ecdd4e7f7e458767464c31f3f5d Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Tue, 8 Aug 2023 21:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0k8s=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s/base/api-svr.yaml | 12 ++++++++++++ k8s/base/api.yaml | 24 ++++++++++++++++++++++++ k8s/base/ns.yaml | 4 ++++ 3 files changed, 40 insertions(+) create mode 100644 k8s/base/api-svr.yaml create mode 100644 k8s/base/api.yaml create mode 100644 k8s/base/ns.yaml diff --git a/k8s/base/api-svr.yaml b/k8s/base/api-svr.yaml new file mode 100644 index 00000000..6c383cb2 --- /dev/null +++ b/k8s/base/api-svr.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: coal-api +spec: + selector: + app: coal-api + ports: + - protocol: TCP + port: 7456 + targetPort: 7456 + type: ClusterIP \ No newline at end of file diff --git a/k8s/base/api.yaml b/k8s/base/api.yaml new file mode 100644 index 00000000..464b12d1 --- /dev/null +++ b/k8s/base/api.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: coal-api + labels: + app: coal-api +spec: + replicas: 1 + selector: + matchLabels: + app: coal-api + template: + metadata: + name: coal-api + labels: + app: coal-api + spec: + containers: + - name: coal-api + image: coal + imagePullPolicy: Always + ports: + - containerPort: 7456 + restartPolicy: Always diff --git a/k8s/base/ns.yaml b/k8s/base/ns.yaml new file mode 100644 index 00000000..d428c7a0 --- /dev/null +++ b/k8s/base/ns.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: coal \ No newline at end of file