From d013eb694b0687a8da805d227426e31812ade7f7 Mon Sep 17 00:00:00 2001 From: kleph Date: Sat, 15 Feb 2020 16:01:55 +0100 Subject: [PATCH] [CI] Add kube deployment, service and ingress --- kube/beer-deployment.yaml | 21 +++++++++++++++++++++ kube/beer-ingress.yaml | 16 ++++++++++++++++ kube/beer-service.yaml | 12 ++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 kube/beer-deployment.yaml create mode 100644 kube/beer-ingress.yaml create mode 100644 kube/beer-service.yaml diff --git a/kube/beer-deployment.yaml b/kube/beer-deployment.yaml new file mode 100644 index 0000000..f3aad88 --- /dev/null +++ b/kube/beer-deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: beer-deployment +spec: + selector: + matchLabels: + app: beer + replicas: 1 + template: + metadata: + labels: + app: beer + spec: + containers: + - name: beer + image: kleph/beer + imagePullPolicy: Always + ports: + - containerPort: 5000 + diff --git a/kube/beer-ingress.yaml b/kube/beer-ingress.yaml new file mode 100644 index 0000000..c0c769c --- /dev/null +++ b/kube/beer-ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: beer-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + rules: + - host: beer.k3s.kleph.eu + http: + paths: + - path: / + backend: + serviceName: beer + servicePort: 80 + diff --git a/kube/beer-service.yaml b/kube/beer-service.yaml new file mode 100644 index 0000000..5a2de90 --- /dev/null +++ b/kube/beer-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: beer +spec: + selector: + app: beer + ports: + - protocol: TCP + port: 80 + targetPort: 5000 +