Skip to content

leeeennyy/k8s-lightning-talk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-lightning-talk

Prerequisites

Install the following:

Docker

Login to docker

Ensure you have an account in Docker Hub, and login/enter creds.

docker login

Building the image

Navigate to the API solution and run:

docker build -t leeeennyy/k8s-lightning-talk-demo:v1 -f k8s-lightning-talk-demo\Dockerfile .

Pushing the image

docker push leeeennyy/k8s-lightning-talk-demo:v1

You'll need to replace leeeennyy with the name of your docker registry if you want to make your own. You can create an account at https://hub.docker.com/.

Kubernetes

To deploy locally, ensure that minikube is started and that kubectl is connected to it.

minikube start
kubectl config use-context minikube

Deploying k8s resources

Navigate to the top level of this repo

kubectl apply -f service.yaml
kubectl apply -f deployment.yaml

Check resources are up

kubectl get po
kubectl get deployment
kubectl get svc

Once resources are up, we can connect to our API. The command below will open up a tab in your browser, and we can navigate to <url>/weatherforecast. We should see our API.

minikube service k8s-lightning-talk-demo-svc

Cool commands you can do

kubectl scale deployment k8s-lightning-talk-demo --replicas=5
kubectl logs po <podname>

Clean up

kubectl delete -f service.yaml
kubectl delete -f deployment.yaml
minikube stop

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published