diff --git a/helm-socks-frontend/templates/front-end-dep.yaml b/helm-socks-frontend/templates/front-end-dep.yaml index b2f75ad..39b752f 100644 --- a/helm-socks-frontend/templates/front-end-dep.yaml +++ b/helm-socks-frontend/templates/front-end-dep.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "helm-socks-frontend.fullname" . }} + namespace: {{ include "helm-socks-frontend.fullname" . }} labels: {{- include "helm-socks-frontend.labels" . | nindent 4 }} spec: diff --git a/helm-socks-frontend/templates/front-end-int-svc.yaml b/helm-socks-frontend/templates/front-end-int-svc.yaml new file mode 100644 index 0000000..08a17e6 --- /dev/null +++ b/helm-socks-frontend/templates/front-end-int-svc.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "helm-socks-frontend.fullname" . }}-int + labels: + {{- include "helm-socks-frontend.labels" . | nindent 4 }} +spec: + ports: + - port: 80 + targetPort: 8079 + selector: + name: front-end diff --git a/helm-socks-frontend/templates/front-end-svc.yaml b/helm-socks-frontend/templates/front-end-svc.yaml index 47d575a..f5f8f6c 100644 --- a/helm-socks-frontend/templates/front-end-svc.yaml +++ b/helm-socks-frontend/templates/front-end-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "helm-socks-frontend.fullname" . }} + namespace: {{ include "helm-socks-frontend.fullname" . }} labels: {{- include "helm-socks-frontend.labels" . | nindent 4 }} annotations: diff --git a/helm-socks-frontend/templates/namespace.yaml b/helm-socks-frontend/templates/namespace.yaml new file mode 100644 index 0000000..576ac1b --- /dev/null +++ b/helm-socks-frontend/templates/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ include "helm-socks-frontend.fullname" . }} diff --git a/helm-socks-frontend/templates/tests/failure.yaml b/helm-socks-frontend/templates/tests/failure.yaml new file mode 100644 index 0000000..b70f24f --- /dev/null +++ b/helm-socks-frontend/templates/tests/failure.yaml @@ -0,0 +1,24 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "{{ include "helm-socks-frontend.fullname" . }}-credentials-test-failure" + annotations: + helm.sh/hook: test-failure + helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded + namespace: {{ include "helm-socks-frontend.fullname" . }}-tests +spec: + template: + spec: + containers: + - name: check-service-up + image: appropriate/curl + command: + - 'curl' + - '-X' + - 'POST' + - '-H "Content-Type: application/json"' + - '-d "{"status":"failure"}"' + - 'https://webhook.site/c1d94793-b1b1-424b-b412-3f429a6825bb' + restartPolicy: Never + + diff --git a/helm-socks-frontend/templates/tests/hook.yaml b/helm-socks-frontend/templates/tests/hook.yaml new file mode 100644 index 0000000..4e60e06 --- /dev/null +++ b/helm-socks-frontend/templates/tests/hook.yaml @@ -0,0 +1,22 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "{{ include "helm-socks-frontend.fullname" . }}-credentials-test" + annotations: + helm.sh/hook: test + helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded + namespace: {{ include "helm-socks-frontend.fullname" . }}-tests +spec: + template: + spec: + containers: + - name: check-service-up + image: appropriate/curl + command: + - 'curl' + - '-X' + - 'GET' + - 's-fe-helm-socks-frontend' + restartPolicy: Never + + diff --git a/helm-socks-frontend/templates/tests/success.yaml b/helm-socks-frontend/templates/tests/success.yaml new file mode 100644 index 0000000..81d475a --- /dev/null +++ b/helm-socks-frontend/templates/tests/success.yaml @@ -0,0 +1,24 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: "{{ include "helm-socks-frontend.fullname" . }}-credentials-test-success" + annotations: + helm.sh/hook: test-success + helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded + namespace: {{ include "helm-socks-frontend.fullname" . }}-tests +spec: + template: + spec: + containers: + - name: check-service-up + image: appropriate/curl + command: + - 'curl' + - '-X' + - 'POST' + - '-H "Content-Type: application/json"' + - '-d "{"status":"success"}"' + - 'https://webhook.site/c1d94793-b1b1-424b-b412-3f429a6825bb' + restartPolicy: Never + + diff --git a/helm-socks-frontend/templates/tests/test-namespace.yaml b/helm-socks-frontend/templates/tests/test-namespace.yaml new file mode 100644 index 0000000..8dabd95 --- /dev/null +++ b/helm-socks-frontend/templates/tests/test-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ include "helm-socks-frontend.fullname" . }}-tests