Skip to content

mavilam/k8s-getting-started-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

k8s examples

This project is intended to be use as playground to learn some kubernetes concepts over minikube. Under the folder k8s-resources, there are some yamls which each one defines a kubernetes resource.

this project is under construction

Install minikube

You can find the official info here

Install kubectl

You can find the official info here

Build image

To test some resources it will be using a tiny python script with two hello world sentences.

Image

To build the image using the Dockerfile use the following command from the root of the project:

docker build -t python-helloworld docker/

Upload to minikube

To upload the image to the minikube container registry use the following line:

docker save python-helloworld | (eval $(minikube docker-env) && docker load)

Apply k8s resourcers

To create resources in k8s, you can use the following command:

kubectl apply -f [filename]

So to begin with the basic environment and run the first test execute those commands:

kubectl apply -f configmap.yaml
kubectl apply -f pod.yaml

Once executed, you will see Hello from configmap in the logs of the pod. You can extract the with this command:

kubectl logs $(kubectl get pods -o=name | head -n 1 | cut -d / -f 2)

About

Tiny repository to store some getting started into Kubernetes resources

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors