From 86a1c580df4d8c1a88c4f4b6a700b7fb35131bf8 Mon Sep 17 00:00:00 2001 From: Waterball Date: Wed, 24 Feb 2021 12:17:23 +0000 Subject: [PATCH] Add kubernetes manifest --- kubernetes/quizzer-deployment.yaml | 39 +++++++++++++++++++++ kubernetes/rabbitmq-deployment.yaml | 52 ++++++++++++++++++++++++++++ kubernetes/webapi-deployment.yaml | 42 ++++++++++++++++++++++ kubernetes/websocket-deployment.yaml | 44 +++++++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 kubernetes/quizzer-deployment.yaml create mode 100644 kubernetes/rabbitmq-deployment.yaml create mode 100644 kubernetes/webapi-deployment.yaml create mode 100644 kubernetes/websocket-deployment.yaml diff --git a/kubernetes/quizzer-deployment.yaml b/kubernetes/quizzer-deployment.yaml new file mode 100644 index 0000000..9ffbfd7 --- /dev/null +++ b/kubernetes/quizzer-deployment.yaml @@ -0,0 +1,39 @@ +kind: Service +apiVersion: v1 +metadata: + name: quizzer +spec: + ports: + - name: http + protocol: TCP + port: 31924 + targetPort: 31924 + selector: + app: quizzer + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: quizzer-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: quizzer + template: + metadata: + labels: + app: quizzer + spec: + containers: + - name: quizzer + image: waterball/allegro-quizzer:latest + ports: + - containerPort: 31924 + env: + - name: "ASPNETCORE_URLS" + value: "http://0.0.0.0:31924;" + - name: "RabbitMQConnection" + value: "rabbitmq://rabbitmq" + diff --git a/kubernetes/rabbitmq-deployment.yaml b/kubernetes/rabbitmq-deployment.yaml new file mode 100644 index 0000000..1cac663 --- /dev/null +++ b/kubernetes/rabbitmq-deployment.yaml @@ -0,0 +1,52 @@ +kind: Service +apiVersion: v1 +metadata: + name: rabbitmq +spec: + clusterIP: None + ports: + - name: http + protocol: TCP + port: 15672 + targetPort: 15672 + - name: amqp + protocol: TCP + port: 5672 + targetPort: 5672 + selector: + app: rabbitmq +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: rabbitmq +spec: + serviceName: rabbitmq + selector: + matchLabels: + app: rabbitmq + replicas: 1 + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + app: rabbitmq + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: rabbitmq + image: rabbitmq:3.8-management + imagePullPolicy: Always + ports: + - name: http + protocol: TCP + containerPort: 15672 + - name: amqp + protocol: TCP + containerPort: 5672 + readinessProbe: + exec: + command: ["true"] + initialDelaySeconds: 30 + timeoutSeconds: 5 \ No newline at end of file diff --git a/kubernetes/webapi-deployment.yaml b/kubernetes/webapi-deployment.yaml new file mode 100644 index 0000000..9b4a109 --- /dev/null +++ b/kubernetes/webapi-deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapi-deployment +spec: + selector: + matchLabels: + app: webapi + template: + metadata: + labels: + app: webapi + spec: + containers: + - name: webapi + image: waterball/allegro-webapi:latest + resources: + ports: + - containerPort: 31597 + env: + - name: "QuizGrpcApi" + value: "http://quizzer:31924" + - name: "ASPNETCORE_URLS" + value: "http://0.0.0.0:31597;" +--- +apiVersion: v1 +kind: Service +metadata: + name: webapi-service +spec: + type: NodePort + selector: + app: webapi + ports: + - name: http + protocol: TCP + port: 31597 + targetPort: 31597 + - name: https + protocol: TCP + port: 31598 + targetPort: 31598 diff --git a/kubernetes/websocket-deployment.yaml b/kubernetes/websocket-deployment.yaml new file mode 100644 index 0000000..7f5375f --- /dev/null +++ b/kubernetes/websocket-deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: websocket-deployment +spec: + selector: + matchLabels: + app: websocket + template: + metadata: + labels: + app: websocket + spec: + containers: + - name: websocket + image: waterball/allegro-websocket:latest + resources: + ports: + - containerPort: 31274 + env: + - name: "QuizGrpcApi" + value: "http://quizzer:31924" + - name: "ASPNETCORE_URLS" + value: "http://0.0.0.0:31274;" + - name: "RabbitMQConnection" + value: "rabbitmq://rabbitmq" +--- +apiVersion: v1 +kind: Service +metadata: + name: websocket-service +spec: + type: NodePort + selector: + app: websocket + ports: + - name: http + protocol: TCP + port: 31274 + targetPort: 31274 + - name: https + protocol: TCP + port: 31275 + targetPort: 31275