Deploy Iron Gallery App on Kubernetes - Validation Error

I am getting validation errors though I received final output of installation page.

Here is the error what I am getting

first volumeMount name for ‘iron-gallery’ deployment is not ‘config’ under namespace ‘iron-namespace-nautilus’

Deploy_Service YAML file

apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: iron-gallery
name: iron-gallery-deployment-nautilus
namespace: iron-namespace-nautilus
spec:
replicas: 1
selector:
matchLabels:
run: iron-gallery
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: iron-gallery
spec:
containers:
- image: kodekloud/irongallery:2.0
name: iron-gallery-container-nautilus
resources:
limits:
cpu: “50m”
memory: “100Mi”
volumeMounts:
- mountPath: /usr/share/nginx/html/data
name: config
volumeMounts:
- mountPath: /usr/share/nginx/html/uploads
name: images
volumes:
- name: config
emptyDir: {}
volumes:
- name: images
emptyDir: {}
status: {}

apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
db: mariadb
name: iron-db-deployment-nautilus
namespace: iron-namespace-nautilus
spec:
replicas: 1
selector:
matchLabels:
db: mariadb
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
db: mariadb
spec:
containers:
- image: kodekloud/irondb:2.0
name: iron-db-container-nautilus
env:
- name: MYSQL_DATABASE
value: “database_host”
- name: MYSQL_ROOT_PASSWORD
value: “mysql12345#”
- name: MYSQL_PASSWORD
value: “mysql54321#”
- name: MYSQL_USER
value: “trust”
volumeMounts:
- mountPath: /var/lib/mysql
name: db
volumes:
- name: db
emptyDir: {}
status: {}

apiVersion: v1
kind: Service
metadata:
name: iron-db-service-nautilus
namespace: iron-namespace-nautilus
spec:
selector:
db: mariadb
ports:
- port: 3306
protocol: TCP
targetPort: 3306

apiVersion: v1
kind: Service
metadata:
name: iron-gallery-service-nautilus
namespace: iron-namespace-nautilus
spec:
type: NodePort
selector:
run: iron-gallery
ports:
- port: 80
targetPort: 80
protocol: TCP
nodePort: 32678

FInal Output of executing the above code.

image

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

1 Like

Hey, I’m having the exact same issue as this person: Deploy Iron Gallery App on Kubernetes - Validation Error

I’ve tried the lab twice and get the same validation error:

first volumeMount name for ‘iron-gallery’ deployment is not ‘config’ in blah namespace
and volumeMount ‘config’ not set to ‘/usr/share/nginx/html/data’ in blah namespace

apiVersion: apps/v1
kind: Deployment
metadata:
name: iron-gallery-deployment-datacenter
labels:
run: iron-gallery
spec:
selector:
matchLabels:
run: iron-gallery
strategy:
type: Recreate
template:
metadata:
labels:
run: iron-gallery
spec:
containers:
- image: kodekloud/irongallery:2.0
name: iron-gallery-container-datacenter
volumeMounts:
- name: config
mountPath: /usr/share/nginx/html/data
volumeMounts:
- name: images
mountPath: /usr/share/nginx/html/uploads
resources:
requests:
memory: “100Mi”
cpu: “50m”
limits:
memory: “100Mi”
cpu: “50m”
volumes:
- name: config
emptyDir: {}
volumes:
- name: images
emptyDir: {}

apiVersion: apps/v1
kind: Deployment
metadata:
name: iron-db-deployment-datacenter
labels:
db: mariadb
spec:
selector:
matchLabels:
db: mariadb
strategy:
type: Recreate
template:
metadata:
labels:
db: mariadb
spec:
containers:
- image: kodekloud/irondb:2.0
name: iron-db-container-datacenter
env:
- name: MYSQL_ROOT_PASSWORD
value: “Pa$$w0rd”
- name: MYSQL_DATABASE
value: database_web
- name: MYSQL_USER
value: db_user
- name: MYSQL_PASSWORD
value: “Pa$$w0rd”
volumeMounts:
- name: db
mountPath: /var/lib/mysql
volumes:
- name: db
emptyDir: {}

apiVersion: v1
kind: Service
metadata:
name: iron-db-service-devops
labels:
db: mariadb
spec:
ports:
- port: 3306
selector:
db: mariadb
type: ClusterIP

We cannot validate your YAML if you post it like that. All the formatting and indentation is lost, and that is significant.

Please see https://github.com/kodekloudhub/community-faq/blob/main/docs/code-of-conduct.md#seeking-technical-guidance