diff --git a/.gitignore b/.gitignore index 397b31a..7c9651e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.pdf -deploy/ validation/report.html .terraform .terraform.lock.hcl diff --git a/deploy/manifests/app-deploy.yaml b/deploy/manifests/app-deploy.yaml new file mode 100644 index 0000000..70299ae --- /dev/null +++ b/deploy/manifests/app-deploy.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: demo-app + namespace: "default" + labels: + app: demo-app + +spec: + replicas: 1 + selector: + matchLabels: + app: demo-app + + template: + metadata: + labels: + app: demo-app + spec: + containers: + - name: demo-app + image: DOCKER_IMAGE + imagePullPolicy: Always + env: + - name: HTTP_PORT + value: "HTTPPORT" + - name: ENVIRONMENT + value: "ENV" + ports: + - containerPort: HTTPPORT + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 \ No newline at end of file diff --git a/deploy/manifests/app-ingress.yaml b/deploy/manifests/app-ingress.yaml new file mode 100644 index 0000000..0eb7be5 --- /dev/null +++ b/deploy/manifests/app-ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + namespace: default + name: demo-ingress + annotations: + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip +spec: + ingressClassName: alb + rules: + - http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: demo-app-service + port: + number: 8080 \ No newline at end of file diff --git a/deploy/manifests/app-service.yaml b/deploy/manifests/app-service.yaml new file mode 100644 index 0000000..dded5a2 --- /dev/null +++ b/deploy/manifests/app-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: demo-app-service + namespace: "default" + labels: + app: demo-app +spec: + selector: + app: demo-app + + ports: + - port: 8080 + targetPort: 8080 \ No newline at end of file diff --git a/main_test.go b/main_test.go index 1a4d22a..cf80973 100644 --- a/main_test.go +++ b/main_test.go @@ -25,7 +25,7 @@ func TestHelloHandler(t *testing.T) { } // Check the response body - expected := "Hello! From Nitro\n" + expected := "Hello! From DevOps Sri Lanka\n" if body := rr.Body.String(); body != expected { t.Errorf("Handler returned unexpected body: got %v want %v", body, expected) }