Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Deployment1.yml #2

Open
wants to merge 11 commits into
base: yemnaing-k8s-guide
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 3-Deployments/Deployment1.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apiVersion: apps/v1 #version of the API to use
kind: Deployment #What kind of object we're deploying
metadata: #information about our object we're deploying
name: apache2-deployment #Name of the deployment
name: mqtt-deployment #Name of the deployment
labels: #A tag on the deployments created
app: apache2
app: mqtt
spec: #specifications for our object
replicas: 2 #The number of pods that should always be running
selector: #which pods the replica set should be responsible for
matchLabels:
app: apache2 #any pods with labels matching this I'm responsible for.
app: mqtt #any pods with labels matching this I'm responsible for.
template: #The pod template that gets deployed
metadata:
labels: #A tag on the replica sets created
app: apache2
app: mqtt
spec:
containers:
- name: apache2-container #the name of the container within the pod
image: yenaing/ubuntu_apache2 #which container image should be pulled
- name: mqtt-container #the name of the container within the pod
image: yenaing/ubuntu_mosqutto_python #which container image should be pulled
ports:
- containerPort: 80 #the port of the container within the pod
29 changes: 15 additions & 14 deletions 4-Services/services.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
apiVersion: apps/v1 #version of the apache2 API to use
kind: Deployment #What kind of object we're deploying
metadata: #information about our object we're deploying
name: apache2-deployment #Name of the deployment
name: python-deployment #Name of the deployment
labels: #A tag on the deployments created
app: apache2
app: python
spec: #specifications for our object
replicas: 2 #The number of pods that should always be running
selector: #which pods the replica set should be responsible for
matchLabels:
app: apache2 #any pods with labels matching this I'm responsible for.
app: python #any pods with labels matching this I'm responsible for.
template: #The pod template that gets deployed
metadata:
labels: #A tag on the replica sets created
app: apache2
app: python
spec:
containers:
- name: apache2-container #the name of the container within the pod
image: yenaing/ubuntu_apache2 #which container image should be pulled
- name: python-container #the name of the container within the pod
image: yenaing/python_flask #which container image should be pulled
ports:
- containerPort: 80 #the port of the container within the pod
- containerPort: 5000 #the port of the container within the pod


---
apiVersion: v1 #version of the API to use
kind: Service #What kind of object we're deploying
metadata: #information about our object we're deploying
name: ingress-apache2 #Name of the service
name: ingress-python #Name of the service
spec: #specifications for our object
type: NodePort #Ignore for now discussed in a future post
ports: #Ignore for now discussed in a future post
- name: http
port: 80
targetPort: 80
nodePort: 30022
- name: python
port: 5000
targetPort: 5000
protocol: TCP
selector: #Label selector used to identify pods
app: apache2
selector: #Label selector usedf to identify pods
app: python