From ab8a0314321f5673319a1a1aeeb85356b83cace4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Thu, 1 Aug 2019 14:05:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4k8s=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts | 2 +- k8s/rabbitmq.yaml | 67 +++++++++++++++++++++++++++++++++++++++++++++++ k8s/redis.yaml | 45 +++++++++++++++++++++++++++++++ prod/.gitkeep | 0 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 k8s/rabbitmq.yaml create mode 100644 k8s/redis.yaml delete mode 100644 prod/.gitkeep diff --git a/hosts b/hosts index c838d13..3a29336 100644 --- a/hosts +++ b/hosts @@ -1,4 +1,4 @@ -192.168.0.20 idc20.nodes.fangjia.com +192.168.0.20 idc20.nodes.fangjia.com 192.168.0.38 monitor.jms.db.fangjia.com #线上数据库 192.168.0.43 online.mongo.db.fangjia.com diff --git a/k8s/rabbitmq.yaml b/k8s/rabbitmq.yaml new file mode 100644 index 0000000..f786c14 --- /dev/null +++ b/k8s/rabbitmq.yaml @@ -0,0 +1,67 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: rabbitmq-pod + namespace: fangjia + labels: + app: rabbitmq +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + revisionHistoryLimit: 5 + template: + metadata: + labels: + project: rabbitmq-pod + app: rabbitmq + spec: + imagePullSecrets: + - name: nexussecret + containers: + - name: rabbitmq + image: rabbitmq:3-management + imagePullPolicy: Always +--- +apiVersion: v1 +kind: Service +metadata: + name: rabbitmq-http + namespace: fangjia + labels: + project: rabbitmq-pod + app: rabbitmq +spec: + type: NodePort + selector: + project: rabbitmq-pod + app: rabbitmq + ports: + - name: app-http + protocol: TCP + port: 15672 + targetPort: 15672 + nodePort: 35672 +--- +apiVersion: v1 +kind: Service +metadata: + name: rabbitmq-api + namespace: fangjia + labels: + project: rabbitmq-pod + app: rabbitmq +spec: + type: NodePort + selector: + project: rabbitmq-pod + app: rabbitmq + ports: + - name: app-api + protocol: TCP + port: 5672 + targetPort: 5672 + nodePort: 45672 diff --git a/k8s/redis.yaml b/k8s/redis.yaml new file mode 100644 index 0000000..08fe834 --- /dev/null +++ b/k8s/redis.yaml @@ -0,0 +1,45 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: redis-pod + namespace: fangjia + labels: + app: redis +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + revisionHistoryLimit: 5 + template: + metadata: + labels: + project: redis-pod + app: redis + spec: + imagePullSecrets: + - name: nexussecret + containers: + - name: redis + image: 192.168.0.19:9012/redis + imagePullPolicy: Always +--- +apiVersion: v1 +kind: Service +metadata: + name: redis-pod + namespace: fangjia + labels: + project: redis-pod + app: redis +spec: + type: NodePort + selector: + project: redis-pod + app: redis + ports: + - port: 6379 + targetPort: 6379 + nodePort: 30000 diff --git a/prod/.gitkeep b/prod/.gitkeep deleted file mode 100644 index e69de29..0000000