Kubernetes Daily Task Aug 17


Userlevel 7
Badge +22

We will continue with our task from yesterday. First of all check to see that your pod is still running

 

kubectl get po -n nginx

Create a text file called index.html with the following content: I love the Kubernetes Korner!

copy this into the pod (do a kubectl get pods -n nginx to get your specific pod name

 kubectl cp index.html -n nginx nginx-58bcd76ff8-tm4h4:/usr/share/nginx/html/

Now lets create a service:

apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: nginx
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
nodePort: 30011
selector:
app: nginx

Now type the following and see what happens, or what should happen :) 

minikube service nginx -n nginx

 


2 comments

Userlevel 7
Badge +20

Cool need to finish the other parts from yesterday before this but will work to get it done.

Userlevel 7
Badge +4

Awesome.. 

Comment