diff --git a/config/kubernetes/deployment.yaml b/config/kubernetes/deployment.yaml new file mode 100644 index 0000000..8befca5 --- /dev/null +++ b/config/kubernetes/deployment.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: daanvm-nl +spec: + selector: + matchLabels: + app: daanvm-nl + replicas: 2 + template: + metadata: + labels: + app: daanvm-nl + spec: + containers: + - name: daanvm-nl-nginx + image: daanvm/daanvm.nl:latest + ports: + - containerPort: 80 + lifecycle: + preStop: + exec: + # Gracefully shutdown nginx + command: ["/bin/bash", "-c", "/bin/sleep5 && /usr/sbin/nginx -s quit"] diff --git a/config/kubernetes/service.yaml b/config/kubernetes/service.yaml new file mode 100644 index 0000000..f059795 --- /dev/null +++ b/config/kubernetes/service.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: daanvm-nl +spec: + type: LoadBalancer + selector: + app: daanvm-nl + ports: + - port: 80 + targetPort: 80 + protocol: TCP