Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog Proposal: From Zero to Kubernets for Python #58

Open
salmaniqbal opened this issue Apr 9, 2018 · 4 comments
Open

Blog Proposal: From Zero to Kubernets for Python #58

salmaniqbal opened this issue Apr 9, 2018 · 4 comments

Comments

@salmaniqbal
Copy link
Contributor

Title: From Zero to Kubernets for Python
Info: This blog post will help you if you have a python application and you would like to deploy it using Kubernets.

1. The application
You have a python application, in this example we will use a Python Hello world web app. This app is run in a website using flask. When accessed via your favourite web browser it prints the text "Hello World" on the page. This can be replaced by any python application.
a. [Give link to Github that includes the source code for this app]

2. Deployment
You dev this app in your local machine and then it is deployed in Test, QA and Prod environment. Sometimes you might run into an issue in other environments where it would fail on deployment

3. Docker
This is where Docker helps, if you can contain your application in an image, you can reliably deploy it on any envirnment.
a. [Brief description of Docker containers and its advantages, perhaps link to other docker resources]
b. [Show and walk through the docker file]
c.
d. Is it worth showing how a container can hold different versions of Python (2.7 / 3) without having to change your local references??

4. How can Kubernets help?
K8s helps with automating deployment, scaling and management of containers.
[Put a couple of lines on features of k8s, rolling updates, declarative configuration etc]
[Give a line on options of where k8s can be run]
[Simplified k8s architecture diagram]
[Install Minikube instructions for windows and mac]
[Install/get kubectl]

5. k8s Deployment
[Show the deployment.yaml file and point out the container name and other properties e.g. replicas etc]
[kubectl create -f deployment.yaml]
[kubectl expose]
[Perhaps show how replicasets work?]

6. Conclude
[Summarise what was learnt and provide next steps for further learning?]

@salmaniqbal
Copy link
Contributor Author

@danielepolencic

@danielepolencic
Copy link
Contributor

danielepolencic commented Apr 9, 2018

Title: From Zero to Kubernetes for Python
I'd like to suggest something like:

  • Introduction to Kubernetes: How to Deploy a Flask Docker App
  • How to deploy a Flask app to Kubernetes

We should focus on doing something useful with Kubernetes, rather than talking about k8s itself.

      1. I don't know how much preexisting knowledge we should assume about the reader. If we need to explain the basics of containers, this is going to be a long post. I think mentioning Docker & benefits is fine, but I'd rather make it quick and to the point than digging into the details such as "a container can hold different versions of Python (2.7 / 3)"
  1. I like the outline. I think we could boil it down to k8s is cool because I can deploy a web app in 5 minutes. As for minikube instructions, I think we should link to that instead of including it. Same for kubectl.

  2. I think replicaset is a bonus. But we should cover Ingress.

Recap:

  • Flask Hello World Intro
  • Packaging Flask application using Docker
    • Docker benefits
    • A simple Docker file
    • Running the container locally (maybe?)
  • K0s - zero to k8s
    • Kubernetes architecture in a nutshell (deployment + service)
    • kubectl and minikube (links to instructions)
    • Deploying using imperative commands
    • Creating a (load balancer) service
    • Scaling the number of replicas up
    • Deleting an instance and waiting for Kubernetes to reschedule it
    • Exposing the service with minikube expose
    • Introduction to how to expose services to the outside world: the Ingress
    • Creating an ingress using declarative way
  • Recap
  • Further reading

@salmaniqbal
Copy link
Contributor Author

@danielepolencic sounds good what you are suggesting. Shall start cracking it out?

@danielepolencic
Copy link
Contributor

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants