Kubernetes task failed wrongly

Hi,

Today, I have received one task for Sr Devops and it’s related to Kubernetes. I have performed that task and created Persistent Volume, Persistent Volume Claim, Service, Deployment and POD but still task resulted in failure. I think there is something wrong in result checking process for this task.

Please find set-1.jpg and set-2.jpg files. In Set-1. jpg file, you can see that all required Kubernetes objects have been created successfully. As soon as I have clicked on “Check” button, all of these objects disappered and task is marked as failure. Set-2.jpg is the screenshot after task marked as failure.


Hi @GKunal

Can you please share your KKE username or email address?

Hi,

Please find KKE email ID: [email protected] and task name is “Kubernetes Troubleshooting” for which I faced this problem.

Thanks,
Kunal Gandhi

Hi @GKunal

Can you please try this task again, its marked pending for you.

Hi,

But as I have mentioned that I have already performed this task but because of validation process error it was marked with failure.

Still, Do I need to perform this task again?

Thanks,
Kunal Gandhi

Yes, because it seems to be working fine on our end. Also please save a copy of the final template you are going to apply and in case task fails again share the same with us.

Hi,

As I have already given screenshot proof of task done and I have kept final template copy of task done. I had finished task in less than 15 mins. As you can see in first screenshot that it’s showing all the kubernetes objects created and in second screenshot, it’s not showing objects created so, it got disappeared automatically after clicking on “Check” button. Also, you can check video recording of task done from your end. When I had done review of task then in video recording I was able to see that task was performed all well.

It’s not allowed to attach .yml file here so, I can’t send it to you.

Please let me know that how can I share final template file of task completed with you.

Thanks,
Kunal Gandhi

You can copy/paste the yaml and can DM me.

Please find yaml file of task completed as following. I am not sure that copy/pasting yaml file here will preserve formatting or not.

apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-pv
labels:
spec:
storageClassName: standard
capacity:
storage: 250Mi
accessModes:
- ReadWriteOnce
hostPath:
path: “/mnt/data”
persistentVolumeReclaimPolicy: Retain

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
labels:
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 250Mi

apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
app: mysql-app
spec:
type: NodePort
ports:
- targetPort: 3306
port: 3306
nodePort: 30011
selector:
app: mysql-app

apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-deployment
labels:
app: mysql-app
spec:
selector:
matchLabels:
app: mysql-app
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: mysql-app
tier: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-root-pass
key: password
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-db-url
key: database
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-user-pass
key: username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-user-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim

I can see that formatting is getting changed after copying it here but It’s a valid yaml file content. Also, there is “—” between each of the kubernetes object definition in file which is also getting disappeared here.

Hi,

You can also download yml file which contains solution for the given task using this url.

https://newcontent-2021.s3.us-east-1.amazonaws.com/mysql-k8s.yml

Thanks,
Kunal Gandhi

ok, this is looking good. Perhaps there was some temporary issue during that time when you submitted the task. This is marked successful for you. Sorry for the inconvenience.

Thank you very much!