Some of the following has not yet been implemented! When the simple Angular2 app is finished with the rewrite, and I actually use Redis for something... I'll likely squash this history!
This repository is an example of a "full stack application" (a very simple Guest Book), which is ready to be deployed into a Kubernetes cluster.
The README walks through deployment of:
- a Kubernetes cluster on the Azure Container Service
- a private Docker registry hosted by Azure Container Registry
Next, the service's components are deployed on the Kubernetes cluster:
- an AspNetCore application powered by .NET Core
- a Redis instance, used as a cache in the AspNetCore application
- a(n) SQL Server for Linux instance, used a the persistent store for the AspNetCore application
- an Angular2 frontend with Material UI components
- a Kubernetes [Ingress object] with a Service that will result in the application being available to the Internet via
an Azure Load Balancer and
nginx(via the nginx-ingress-controller).
The application is running at polykube.io and api.polykube.io.
This is an Asciinema presentation that shows these steps, from scratch, in realtime.
From having nothing deployed in Azure, to having this exposed to the world takes less than 15 minutes:
[ insert asciinema screenshot link here ]
There is also a less real-time version with the waits removed.
- Linux
makedockerkubectl(linux: amd64) (darwin: amd64) (windows: amd64)az, the Azure CLI, aka, "the new Python Azure CLI", not the nodejs, azure-xplat-cli.
- Anyone can hack on this project, with a single command
./devenv.sh(or even.\devenv.ps1) This command drops you in a development environment with any and all SDKs installed, ready to use. - Each project requiring a real build, can be built in the development
environment with
./build.shin the project directory. - All container image builds are done by first performing the builds are done inside containers for portability and reproducability
- Final container images are built by first doing a containerized build of the project, and then placing the build output into the final container image.
- Final containers created for the service are as minimal as possible.
(The dotnet api simply connects to postgres via
tcp://db:5432, redis viatcp://redis:6379, etc.) No development-time dependencies are included. For example, this means that the final AspNetCore containers do not have the SDK and tooling installed in them. This reduces image size and speeds up deployment. - Respect the "docker build container pattern".
As a summary, this means that containerized build output is owned by the correct user (not root)
and it means the containerized final build process can be run even in configurations where the
dockerdaemon is running remotely (like a really powerful remote Azure VM).
This will perform all steps automatically:
export CLUSTER_NAME=colemick-polykube1
./magic.shWith expected output:
# output:
# ...
# `polykube` is live at: http://1.2.3.4(For now, read ./magic.sh and see how it works.)
- Finish the frontend for the third time. (Angular2)
- move dotnet dns hack out of kube deploy files and into C#