-
Notifications
You must be signed in to change notification settings - Fork 16
/
ALB-Ingress-golang-app
90 lines (84 loc) · 1.93 KB
/
ALB-Ingress-golang-app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Kubernetes
# https://www.youtube.com/watch?v=XqMdrtwRwqw&ab_channel=ContainersfromtheCouch ---> 40min
# https://github.com/aws-samples/amazon-eks-sample-http-service
goapp
------
goapp.yaml with AWS ALB Ingress
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: goapp
labels:
app: goapp
spec:
replicas: 1
selector:
matchLabels:
app: goapp
tier: frontend
template:
metadata:
labels:
app: goapp
tier: frontend
spec:
containers:
- image: quickbooks2018/goapp:v1
imagePullPolicy: Always
name: goapp
ports:
- containerPort: 80
name: http
resources:
limits:
cpu: 500m
memory: 1024Mi
requests:
cpu: 500m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: goapp
labels:
app: goapp
spec:
ports:
- name: http
port: 80
targetPort: http
selector:
app: goapp
tier: frontend
type: NodePort
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: devops.cloudgeeks.ca
labels:
name: goapp
namespace: default
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
alb.ingress.kubernetes.io/healthcheck-path: /
alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15'
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5'
alb.ingress.kubernetes.io/success-codes: '200'
alb.ingress.kubernetes.io/healthy-threshold-count: '2'
alb.ingress.kubernetes.io/unhealthy-threshold-count: '2'
spec:
rules:
- host: devops.cloudgeeks.ca
http:
paths:
- path: /
backend:
serviceName: goapp
servicePort: 80