Hitesh Kumar:
Hi @Mumshad Mannambeth, i am getting below error while deploying pod or deployments in Mock Exam-2 CKAD course. Can you please look into it? Attached is the screenshot
Mohamed Ayman:
Can you please specify the question number
Hitesh Kumar:
Question no. 1 and 3 both
Hitesh Kumar:
Rest I didn’t attempt because of this issue
Mohamed Ayman:
Please try to create the deployment as followed
$ vi deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-webapp
labels:
app: my-webapp
spec:
replicas: 2
selector:
matchLabels:
tier: frontend
template:
metadata:
labels:
tier: frontend
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
Then expose it as a node port using this yaml file
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: my-webapp
name: front-end-service
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
nodePort: 30083
selector:
tier: frontend
type: NodePort
status:
loadBalancer: {}