Deploy Iron Gallery App on Kubernetes task fails even though final resutls are appaering properly.
Here is the Question,
There is an iron gallery app that the Nautilus DevOps team was developing. They have recently customized the app and are going to deploy the same on the Kubernetes cluster. Below you can find more details:
- Create a namespace
iron-namespace-xfusion - Create a deployment
iron-gallery-deployment-xfusionforiron galleryunder the same namespace you created.:- Labelsrunshould beiron-gallery.:- Replicas count should be1.:- Selector’s matchLabelsrunshould beiron-gallery.:- Template labelsrunshould beiron-galleryunder metadata.:- The container should be named asiron-gallery-container-xfusion, usekodekloud/irongallery:2.0image ( use exact image name / tag ).:- Resources limits for memory should be100Miand for CPU should be50m.:- First volumeMount name should beconfig, its mountPath should be/usr/share/nginx/html/data.:- Second volumeMount name should beimages, its mountPath should be/usr/share/nginx/html/uploads.:- First volume name should beconfigand give itemptyDirand second volume name should beimages, also give itemptyDir. - Create a deployment
iron-db-deployment-xfusionforiron dbunder the same namespace.:- Labelsdbshould bemariadb.:- Replicas count should be1.:- Selector’s matchLabelsdbshould bemariadb.:- Template labelsdbshould bemariadbunder metadata.:- The container name should beiron-db-container-xfusion, usekodekloud/irondb:2.0image ( use exact image name / tag ).:- Define environment, setMYSQL_DATABASEits value should bedatabase_host, setMYSQL_ROOT_PASSWORDandMYSQL_PASSWORDvalue should be with some complex passwords for DB connections, andMYSQL_USERvalue should be any custom user ( except root ).:- Volume mount name should bedband its mountPath should be/var/lib/mysql. Volume name should bedband give it anemptyDir. - Create a service for
iron dbwhich should be namediron-db-service-xfusionunder the same namespace. Configure spec as selector’s db should bemariadb. Protocol should beTCP, port and targetPort should be3306and its type should beClusterIP. - Create a service for
iron gallerywhich should be namediron-gallery-service-xfusionunder the same namespace. Configure spec as selector’s run should beiron-gallery. Protocol should beTCP, port and targetPort should be80, nodePort should be32678and its type should beNodePort.
Note:
- We don’t need to make connection b/w database and front-end now, if the installation page is coming up it should be enough for now.
- The
kubectlonjump_hosthas been configured to work with the kubernetes cluster.
thor@jump_host ~$ k get svc --namespace iron-namespace-xfusion
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
iron-db-service-xfusion ClusterIP 10.96.160.144 <none> 3306/TCP 82s
iron-gallery-service-xfusion NodePort 10.96.64.81 <none> 80:32678/TCP 103s
thor@jump_host ~$ k get pods --namespace iron-namespace-xfusion
NAME READY STATUS RESTARTS AGE
iron-db-deployment-xfusion-b7ddd899-cvxpb 1/1 Running 0 7m22s
iron-gallery-deployment-xfusion-8656b85c65-c8lnl 1/1 Running 0 11m
thor@jump_host ~$ k get deployments.apps --namespace iron-namespace-xfusion
NAME READY UP-TO-DATE AVAILABLE AGE
iron-db-deployment-xfusion 1/1 1 1 7m28s
iron-gallery-deployment-xfusion 1/1 1 1 11m
galley-app
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: iron-gallery
name: iron-gallery-deployment-xfusion
namespace: iron-namespace-xfusion
spec:
replicas: 1
selector:
matchLabels:
run: iron-gallery
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: iron-gallery
spec:
volumes:
- name: config
emptyDir:
- name: images
emptyDir:
containers:
- image: kodekloud/irongallery:2.0
name: iron-gallery-container-xfusion
resources:
limits:
memory: "100Mi"
cpu: "50m"
volumeMounts:
- mountPath: /usr/share/nginx/html/data
name: config
volumeMounts:
- mountPath: /usr/share/nginx/html/uploads
name: images
status: {}
db
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
db: mariadb
name: iron-db-deployment-xfusion
namespace: iron-namespace-xfusion
spec:
replicas: 1
selector:
matchLabels:
db: mariadb
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
db: mariadb
spec:
volumes:
- name: db
emptyDir:
containers:
- image: kodekloud/irondb:2.0
name: iron-db-container-xfusion
resources: {}
env:
- name: MYSQL_DATABASE
value: database_host
- name: MYSQL_ROOT_PASSWORD
value: R00t@#32
- name: MYSQL_PASSWORD
value: Admin@342
- name: MYSQL_USER
value: admin
volumeMounts:
- mountPath: /var/lib/mysql
name: db
status: {}
Appreciate the help. Thanks!

