Skip to content

Commit

Permalink
Merge pull request #1 from DevOpsLK/add-deploy
Browse files Browse the repository at this point in the history
add deplpy files
  • Loading branch information
amila-ku authored Feb 25, 2024
2 parents 3c3af41 + a61f27d commit 809ccc2
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*.pdf
deploy/
validation/report.html
.terraform
.terraform.lock.hcl
Expand Down
35 changes: 35 additions & 0 deletions deploy/manifests/app-deploy.yaml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions deploy/manifests/app-ingress.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions deploy/manifests/app-service.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 809ccc2

Please sign in to comment.