Guest Book - K8s Deployment

Hi
Tasks falied with - “cpu’ resources requests for redis master deployment is not ‘100m’”

But my deployment/services are working properly and i was able to access the guest book app through nodeport.

This is the code (Ignore syntax as the this form is not supporting yaml format) and can you check what i am missing here?

apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: redis-master
name: redis-master
spec:
replicas: 1
selector:
matchLabels:
app: redis-master
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: redis-master
spec:
containers:
- image: redis
name: master-redis-datacenter
resources:
requests:
memory: “100Mi”
cpu: “100m”
ports:
- containerPort: 6379
resources: {}
status: {}

apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: redis-slave
name: redis-slave
spec:
replicas: 2
selector:
matchLabels:
app: redis-slave
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: redis-slave
spec:
containers:
- image: gcr.io/google_samples/gb-redisslave:v3
name: slave-redis-datacenter
resources:
requests:
memory: “100Mi”
cpu: “100m”
ports:
- containerPort: 6379
env:
- name: GET_HOSTS_FROM
value: dns
resources: {}
status: {}

apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: frontend
name: frontend
spec:
replicas: 3
selector:
matchLabels:
app: frontend
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: frontend
spec:
containers:
- image: gcr.io/google-samples/gb-frontend:v4
name: php-redis-datacenter
resources:
requests:
memory: “100Mi”
cpu: “100m”
ports:
- containerPort: 80
env:
- name: GET_HOSTS_FROM
value: dns
resources: {}
status: {}

apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: redis-master
name: redis-master
spec:
ports:

  • port: 6379
    protocol: TCP
    targetPort: 6379
    selector:
    app: redis-master
    status:
    loadBalancer: {}

apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: frontend
name: frontend
spec:
ports:

  • port: 80
    protocol: TCP
    targetPort: 80
    nodePort: 30009
    type:
    NodePort
    selector:
    app: frontend
    status:
    loadBalancer: {}

apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: redis-slave
name: redis-slave
spec:
ports:

  • port: 6379
    protocol: TCP
    targetPort: 6379
    selector:
    app: redis-slave
    status:
    loadBalancer: {}

hi @Jayaram, sorry for the issue, this is marked success for you.

Hi @rahul456 , I had a similar issue. Task was completed, but marked failed with the comment “containerPort for redis master deployment is not ‘6379’”. Can you please check and let me know where I got it wrong?

hi @Oyebimpe, as per question, you need to define containerPort: 6379 in redis master deployment.

1 Like