-
Notifications
You must be signed in to change notification settings - Fork 1
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
Quickstart #22
base: master
Are you sure you want to change the base?
Quickstart #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Quickstart | ||
|
||
We will setup a simple django app using kubeyard built-in template. | ||
|
||
**IMPORTANT:** Kubeyard uses docker as "VM" driver, so many containers will be created on your host to create minikube cluster. | ||
|
||
## Requirements: | ||
|
||
- docker - [install guide](https://docs.docker.com/install/linux/docker-ce/ubuntu/) and [setup guide](https://docs.docker.com/install/linux/linux-postinstall/) | ||
- minikube - [install guide](https://kubernetes.io/docs/tasks/tools/install-minikube/#linux) | ||
- kubectl - [install guide](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-curl) | ||
|
||
## Optional requirements: | ||
|
||
- some kind of virtual environment for kubeyard (recommended) | ||
|
||
## Setup guide | ||
|
||
First, we need to setup kubeyard: | ||
|
||
```bash | ||
pip install kubeyard | ||
kubeyard # you can see available commands | ||
kubeyard install-bash-completion # optional, gives you bash completion for kubeyard | ||
kubeyard setup --development | ||
kubeyard install-global-secrets | ||
``` | ||
|
||
It may take about 10 minutes (or even more - it depends on your internet | ||
connection - minikube needs to download docker images for the k8s cluster) | ||
to setup cluster. Next run will be significantly faster. | ||
|
||
_If you have a problem with minikube setup, please check if all ports required are available (1-32767)._ | ||
|
||
Now, we are ready to setup project from the template! | ||
|
||
```bash | ||
mkdir simple_django | ||
cd simple_django/ | ||
kubeyard init --template django | ||
``` | ||
|
||
Kubeyard will ask you about some project details. You can leave default values for now. | ||
Now you can see the project structure: | ||
|
||
- **config** | ||
- kubeyard.yml - project-level configuration file for kubeyard | ||
- kubernetes/ | ||
- deploy/ - all definition files used to deploy application on cluster | ||
- development_overrides/ - files that overrides values from deploy/ directory. Used only in `development` mode | ||
- dev_secrets/ - development secrets files. Used only in `development` mode | ||
- **docker** - all files that will be in docker image such as: | ||
- Dockerfile - dockerfile based on python package image (many `ON BUILD` automagic). | ||
- requirements/ - all (compiled) requirements. In our example only python requirements. | ||
- source - application sources | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any django-specific directories/files layout? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All app files are located inside source directory, we don't care about framework directories layout |
||
- **scripts** - empty directory, used to override or add project-specific commands to kubeyard (we don't do that in quickstart guide) | ||
|
||
|
||
Ok, lets build project image: | ||
```bash | ||
kubeyard build | ||
``` | ||
Kubeyard can automatically build images and add a tag. For the development environment, it will be `:dev`. | ||
|
||
We can run test inside image: | ||
```bash | ||
kubeyard test | ||
``` | ||
|
||
If everything is fine, we can do the most important part - application deployment. | ||
|
||
```bash | ||
kubeyard deploy | ||
``` | ||
|
||
You will be asked for sudo password. | ||
Kubeyard needs it to configure /etc/hosts and make your service accessible via domain. | ||
|
||
Now your first application is deployed on k8s cluster! You can access it using | ||
http://simple-django.testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this document into quickstart_django.md or I would write down here that apart django there are other possibilities like flask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not django specific quickstart docs. Django is only app, but we want to explain how to setup
kubeyard
environment.