diff --git a/.k8s/deployment.yaml b/.k8s/deployment.yaml new file mode 100644 index 0000000..b0b7393 --- /dev/null +++ b/.k8s/deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: playground + namespace: apps + labels: + app: playground +spec: + replicas: 1 + selector: + matchLabels: + app: playground + template: + metadata: + labels: + app: playground + spec: + imagePullSecrets: + - name: gitea-registry-cred + containers: + - name: playground + image: gitea.ia-innovacion.work/innovacion/playground:latest + env: + - name: VAULT_TOKEN + valueFrom: + secretKeyRef: + name: playground-secret + key: VAULT_TOKEN + ports: + - containerPort: 80 + readinessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 15 + periodSeconds: 20 diff --git a/.k8s/ingress.yaml b/.k8s/ingress.yaml new file mode 100644 index 0000000..041475f --- /dev/null +++ b/.k8s/ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: playground-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + ingressClassName: nginx + rules: + - host: playground.app.ia-innovacion.work + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: playground-service + port: + number: 80 diff --git a/.k8s/secrets.yaml b/.k8s/secrets.yaml new file mode 100644 index 0000000..ce67dcc --- /dev/null +++ b/.k8s/secrets.yaml @@ -0,0 +1,14 @@ +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: playground-vault + namespace: apps +spec: + refreshInterval: "15s" + secretStoreRef: + name: vault-backend + kind: ClusterSecretStore + target: + name: playground-secret + dataFrom: + - key: playground diff --git a/.k8s/service.yaml b/.k8s/service.yaml new file mode 100644 index 0000000..f0de260 --- /dev/null +++ b/.k8s/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: playground-service + labels: + app: playground +spec: + selector: + app: playground + ports: + - port: 80 + targetPort: 3000 + protocol: TCP + type: ClusterIP