Tutorial from Youtube,
This demo app shows a simple user profile app set up using
- index.html with pure js and css styles
- nodejs backend with express module
- mongodb for data storage
- nanajanashia/k8s-demo-app:v1.0
- mongo:latest
- mongo-express:latest
- load configs
- Load Secrets
- Load Deployments
-
Load Configs
apiVersion: v1 kind: ConfigMap metadata: name: kube-config data: mongo-url: mongo-service
-
Load Secrets
apiVersion: v1 kind: Secret metadata: name: kube-secret type: Opaque data: mongo-user: bW9uZ291c2Vy mongo-password: bW9uZ29wYXNzd29yZA==
-
Load Deployment and Service Refer
- kube.yml
- web.yml
- mongoexpress.yml
-
You can apply changes by
- kubectl -f apply kube-config.yml
- kubectl -f apply kube-secrets.yml
- kubectl -f apply kube.yml
- kubectl -f apply web.yml
- kubectl -f apply mongoexpress.yml
-
Access application using
{ip}:30100
minikube start --vm-driver=hyperkit
minikube status
minikube ip
kubectl get node
kubectl get pod
kubectl get svc
kubectl get all
kubectl get pod -o wide
kubectl get node -o wide
kubectl describe svc {svc-name}
kubectl describe pod {pod-name}
kubectl logs {pod-name}
minikube stop
>
minikube service webapp-service
- mongodb image on Docker Hub: https://hub.docker.com/_/mongo
- webapp image on Docker Hub: https://hub.docker.com/repository/docker/nanajanashia/k8s-demo-app
- k8s official documentation: https://kubernetes.io/docs/home/
- webapp code repo: https://gitlab.com/nanuchi/developing-with-docker/-/tree/feature/k8s-in-hour