Skip to content

devopswithbrad/kubernetes-python-flask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploying an Application to Kubernetes

  1. Clone the repo
git clone https://github.com/IBT-learning/kubernetes-python-flask

Start with a Fresh Minikube cluster

Remember your minikube commands. Here is how to delete the cluster and start a fresh one. Remember docker needs to be running before minikube will work.

minikube delete
minikube start

Deploying the Application

The solution is is in the solution1 folder. Try filling out the deployment, namespaces and services.yml files in the manifests folder. You can use the solution1 folder as a reference. If you run into problems you can always just copy over the files from the solution1 folder.

  1. Start with creating the namespaces first. This will create the namespaces for the application. Namespaces need to be created first because the other resources will be created in the namespaces.
kubectl apply -f ./manifests/namespaces.yml
  1. Now start filling out the deployment.yml file. Once complete run the command:
kubectl apply -f ./manifests/deployment.yml
  1. Once the deployment is created, create the service.
kubectl apply -f ./manifests/services.yml
  1. Check out the resources you have created
kubectl get all -n dev
  1. Want to test a connection to the application? You can use minikube service command to get the url to the application. The --all flag will list all the services in the cluster. The -n flag will list the services in the namespace.
minikube service --all -n dev
  1. Want to make changes to any of the manifests and apply them all?
kubectl apply -f ./manifests/

The above command will apply ALL the manifests in the manifests folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 59.3%
  • Dockerfile 40.7%