Lightening Lab - 1

Hi KodeKloud Team,

I am having some issues with Lightening Lab - 1…specifically with with the Netpolicy challenge, which for some reason (even though my answer appears to be correct) always comes up as being incorrect:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-network-policy
  namespace: default
spec:
  podSelector:
    matchLabels:
      run: secure-pod
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          name: webapp-color
    ports:        - protocol: TCP
      port: 80

I tested to see if the service port was open & everything appears to be OK on that end:

kb exec -it webapp-color -- sh
nc -z -v -w 1 secure-service 80

I am also facing an issue with the last task. This is what I have, but it’s coming up as being incorrect:

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: redis
  name: redis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: redis
    spec:
      nodeSelector:
        kubernetes.io/hostname: master
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: "Exists"
        effect: "NoSchedule"
      volumes:
      - name: data
        emptyDir: {}
      - name: config
        configMap:
          name: redis-config
      containers:
      - image: redis:alpine
        name: redis
        volumeMounts:
        - mountPath: /redis-master-data
          name: data
        - mountPath: /redis-master
          name: config
        ports:
        - containerPort: 6379
        resources:
          requests:
            cpu: "0.2"

Is there somewhere I can view the answers so that I can’t see where I’ve going wrong?

Thanks:-)

Hello, @juliettet
Answer is available in the /var/answers/ in the same cluster.

1 Like

Hi @Tej-Singh-Rana,

Thank you for responding. I actually do see the answers under the /var/answers/ directory now (I was thinking about Lightening Lab #2 for a second and confused the two…in Lab#2 there are no answers under the /var/answers/ directory, unless I switch to the controlplane ) and I can see that (in my notes) I have the correct answer for task #5. The 2nd task test-network-policy fails even though I have the same answer as what is shown under /var/answers/, so I’m not too sure about what’s going on there. :face_with_raised_eyebrow: