Skip to content

Commit 3a4e901

Browse files
committed
Welcome to Stack Simplify
1 parent 5dc5cad commit 3a4e901

File tree

11 files changed

+58
-101
lines changed

11 files changed

+58
-101
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata: #Dictionary
4+
name: myapp3-deployment
5+
spec: # Dictionary
6+
replicas: 3
7+
selector:
8+
matchLabels:
9+
app: myapp3
10+
template:
11+
metadata: # Dictionary
12+
name: myapp3-pod
13+
labels: # Dictionary
14+
app: myapp3 # Key value paids
15+
spec:
16+
containers: # List
17+
- name: myapp3-container
18+
image: stacksimplify/kubenginx:3.0.0
19+
ports:
20+
- containerPort: 80
21+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: deployment-loadbalancer-service
5+
spec:
6+
type: LoadBalancer # ClusterIp, # NodePort
7+
selector:
8+
app: myapp3
9+
ports:
10+
- name: http
11+
port: 80 # Service Port
12+
targetPort: 80 # Container Port

04-Kubernetes-Fundamentals-with-YAML/04-05-Services-with-YAML/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
- **Important Notes:**
1212
- Name of Cluster IP service should be `name: my-backend-service` because same is configured in frontend nginx reverse proxy `default.conf`.
1313
- Test with different name and understand the issue we face
14-
- We have also discussed about in our section [05-Services-with-kubectl](/05-Services-with-kubectl/README.md)
14+
- We have also discussed about in our section [03-04-Services-with-kubectl](https://github.com/stacksimplify/azure-aks-kubernetes-masterclass/tree/master/03-Kubernetes-Fundamentals-with-kubectl/03-04-Services-with-kubectl)
1515
```
16-
cd <Course-Repo>\kubernetes-fundamentals\10-Services-with-YAML\kube-manifests
16+
cd 04-05-Services-with-YAML/kube-manifests
1717
kubectl get all
1818
kubectl apply -f 01-backend-deployment.yml -f 02-backend-clusterip-service.yml
1919
kubectl get all
@@ -22,9 +22,9 @@ kubectl get all
2222

2323
## Step-03: Create Frontend Deployment & LoadBalancer Service
2424
- Write the Deployment template for frontend Nginx Application
25-
- Write the NodePort service template for frontend Nginx Application
25+
- Write the LoadBalancer service template for frontend Nginx Application
2626
```
27-
cd <Course-Repo>\kubernetes-fundamentals\10-Services-with-YAML\kube-manifests
27+
cd 04-05-Services-with-YAML/kube-manifests
2828
kubectl get all
2929
kubectl apply -f 03-frontend-deployment.yml -f 04-frontend-LoadBalancer-service.yml
3030
kubectl get all
@@ -34,7 +34,7 @@ kubectl get all
3434
# Get Service IP
3535
kubectl get svc
3636
37-
# Access REST Application (Port is static 31234 configured in frontend service template)
37+
# Access REST Application
3838
http://<Load-Balancer-Service-IP>/hello
3939
```
4040

@@ -46,18 +46,18 @@ kubectl get all
4646
```
4747
### Recreate Objects using YAML files in a folder
4848
```
49-
cd <Course-Repo>\kubernetes-fundamentals\10-Services-with-YAML
49+
cd 04-05-Services-with-YAML/
5050
kubectl apply -f kube-manifests/
5151
kubectl get all
5252
```
5353
### Delete Objects using YAML files in folder
5454
```
55-
cd <Course-Repo>\kubernetes-fundamentals\10-Services-with-YAML
55+
cd 04-05-Services-with-YAML/
5656
kubectl delete -f kube-manifests/
5757
kubectl get all
5858
```
5959

6060

6161
## Additional References - Use Label Selectors for get and delete
62-
- https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively
63-
- https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
62+
- [Labels](https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively)
63+
- [Labels-Selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors)
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
apiVersion: apps/v1
2-
kind: Deployment
3-
metadata:
4-
name: backend-restapp
5-
labels:
6-
app: backend-restapp
7-
tier: backend
8-
spec:
9-
replicas: 3
10-
selector:
11-
matchLabels:
12-
app: backend-restapp
13-
template:
14-
metadata:
15-
labels:
16-
app: backend-restapp
17-
tier: backend
18-
spec:
19-
containers:
20-
- name: backend-restapp
21-
image: stacksimplify/kube-helloworld:1.0.0
22-
ports:
23-
- containerPort: 8080
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
apiVersion: v1
2-
kind: Service
3-
metadata:
4-
name: my-backend-service ## VERY VERY IMPORTANT - NGINX PROXYPASS needs this name
5-
labels:
6-
app: backend-restapp
7-
tier: backend
8-
spec:
9-
#type: Cluster IP is a default service
10-
selector:
11-
app: backend-restapp
12-
ports:
13-
- name: http
14-
port: 8080 # ClusterIp Service Port
15-
targetPort: 8080 # Container Port
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +0,0 @@
1-
apiVersion: apps/v1
2-
kind: Deployment
3-
metadata:
4-
name: frontend-nginxapp
5-
labels:
6-
app: frontend-nginxapp
7-
tier: frontend
8-
spec:
9-
replicas: 3
10-
selector:
11-
matchLabels:
12-
app: frontend-nginxapp
13-
template:
14-
metadata:
15-
labels:
16-
app: frontend-nginxapp
17-
tier: frontend
18-
spec:
19-
containers:
20-
- name: frontend-nginxapp
21-
image: stacksimplify/kube-frontend-nginx:1.0.0
22-
ports:
23-
- containerPort: 80
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
apiVersion: v1
2-
kind: Service
3-
metadata:
4-
name: frontend-nginxapp-loadbalancer-service
5-
labels:
6-
app: frontend-nginxapp
7-
tier: frontend
8-
spec:
9-
type: LoadBalancer
10-
selector:
11-
app: frontend-nginxapp
12-
ports:
13-
- name: http
14-
port: 80
15-
targetPort: 80

04-Kubernetes-Fundamentals-with-YAML/04-05-Services-with-YAML/kube-manifests/backup/01-backend-deployment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: backend-restapp
5-
labels:
5+
labels:
66
app: backend-restapp
77
tier: backend
88
spec:
99
replicas: 3
1010
selector:
1111
matchLabels:
1212
app: backend-restapp
13-
template:
13+
template:
1414
metadata:
1515
labels:
1616
app: backend-restapp
@@ -20,4 +20,4 @@ spec:
2020
- name: backend-restapp
2121
image: stacksimplify/kube-helloworld:1.0.0
2222
ports:
23-
- containerPort: 8080
23+
- containerPort: 8080
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: my-backend-service
4+
name: my-backend-service ## VERY VERY IMPORTANT - NGINX PROXYPASS needs this name
55
labels:
66
app: backend-restapp
77
tier: backend
88
spec:
9+
#type: Cluster IP is a default service
910
selector:
1011
app: backend-restapp
11-
ports:
12+
ports:
1213
- name: http
13-
port: 8080
14-
targetPort: 8080
14+
port: 8080 # ClusterIp Service Port
15+
targetPort: 8080 # Container Port

04-Kubernetes-Fundamentals-with-YAML/04-05-Services-with-YAML/kube-manifests/backup/03-frontend-deployment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: frontend-nginxapp
5-
labels:
5+
labels:
66
app: frontend-nginxapp
77
tier: frontend
88
spec:
99
replicas: 3
1010
selector:
1111
matchLabels:
1212
app: frontend-nginxapp
13-
template:
13+
template:
1414
metadata:
1515
labels:
1616
app: frontend-nginxapp
@@ -20,4 +20,4 @@ spec:
2020
- name: frontend-nginxapp
2121
image: stacksimplify/kube-frontend-nginx:1.0.0
2222
ports:
23-
- containerPort: 80
23+
- containerPort: 80

0 commit comments

Comments
 (0)