mirror of
https://github.com/ION606/learn.git
synced 2026-05-14 21:06:56 +00:00
1.2 KiB
1.2 KiB
Initial Steps (readying your app)
Note: I assume you already have a minikube running
-
check if you have any pods running with
kubectl get podand stop them if so -
create external configurations
- kubectl apply -f mongo-config.yaml
- kubectl apply -f mongo-secret.yaml ★ the -f is for file
-
create connection for the database
- kubectl apply -f mongo.yaml
-
deploy the web app
- kubectl apply -f webapp.yaml
Kubectl
- check your pods using
kubectl get all - check your configmap using
kubectl get configmap - check your secrets using
kubectl get secret
-
you can use
kubectl get [component_name]to get some data for any component or runkubectl get --helpfor help with thegetsubcommand -
you can use
kubectl describe service [service_name]to get a description of the service -
you can use
kubectl logs [pod_name]to get the logs for that pod
Accessing the Application Externally
In our case from the browser
- use
kubectl get svcto get the service - get the
nodPort's ip usingminikube ip★ you can access more data usingkubectl get node -o wide - access the ip using the corresponding IP address : port