diff --git a/k8s/deployment.yml b/k8s/deployment.yml new file mode 100644 index 0000000..5d14e7a --- /dev/null +++ b/k8s/deployment.yml @@ -0,0 +1,26 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: welcome-svc + labels: + app: welcome-svc +spec: + replicas: 1 + selector: + matchLabels: + app: welcome-svc + template: + metadata: + labels: + app: welcome-svc + spec: + containers: + - name: welcome-svc + image: ghcr.io/flawmop/welcome-svc + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: [ "sh", "-c", "sleep 5" ] + ports: + - containerPort: 9001 diff --git a/k8s/kustomization.yml b/k8s/kustomization.yml new file mode 100644 index 0000000..141988d --- /dev/null +++ b/k8s/kustomization.yml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployment.yml + - service.yml diff --git a/k8s/service.yml b/k8s/service.yml new file mode 100644 index 0000000..4de62f7 --- /dev/null +++ b/k8s/service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: welcome-svc + labels: + app: welcome-svc +spec: + type: ClusterIP + selector: + app: welcome-svc + ports: + - protocol: TCP + port: 80 + targetPort: 9001