Noel is an example Platform-as-a-Service-like workflow built on top of Kubernetes.
The intention is to show one way to compose the building blocks provided by Kubernetes to create an opinionated workflow for deploying stateless (12-factor) applications/microservices.
Noel provides two example workflows:
- Local build and deploy. The application's Docker image is built locally and resources are created on the cluster. This is similar to how Google App Engine works.
- Remote build and deploy. The application code is pushed to a special git repository, and a builder service handles creating the Docker image and creating resources on the cluster. This is similar to how Deis and Heroku works.
Noel is designed to be as simple as possible to illustrate how to achieve these workflows. For a more detailed look at how all of the components of Noel and Kubernetes work together, see design.md. If you want a more complete Platform-as-a-Service on Kubernetes, look for Deis v2.
Create a project in the Google Cloud Platform Console.
Enable billing for your project.
Install the Google Cloud SDK
$ curl https://sdk.cloud.google.com | bash $ gcloud init
Create a cluster
Create a cluster, you can specify as many nodes as you want but you need at least one. The
storage-rwscope is needed by the remote builder to push images to Google Container Registry.
gcloud container clusters create noel \ --num-nodes 2 \ --scopes storage-rw
kubectlto use the container's credentials.
gcloud container clusters get-credentials noel
Verify everything is working:
Deploying Noel cluster components
Deploy Noel's cluster-level components (the HTTP frontend and the remote builder) with
Verify that Noel's pods have started:
kubectl --namespace noel get pods
Installing the Noel client
You can install the Noel client using
pip (recommended that you do this in a virtualenv):
pip install ./noel
Running the Kubernetes proxy
Noel requires access to the Kubernetes API, the easiest way to do this is to just run a proxy:
kubectl proxy &
Defining an application
A Noel app only needs a
Dockerfile in the root of the repository. The Dockerfile should start a web server on port
8080. Everything else is up to you. There's a simple Python/Flask example app that you can use to start with.
To deploy locally:
This command will build a docker image locally and push it to Google Container Registry. It will then create the necessary Kubernetes resources to run the application on the cluster.
Before you can use remote deployment you'll need to tell the builder about your SSH public key:
To deploy remotely you must do a
git push to a special git remote. To add the remote to the current git repository:
Then you can push to the remote to deploy:
git push noel master
Setting and reading configuration
To set application configuration values:
noel set-config --app your-app key1=value1 key2=value2
Any existing config is kept. The application will be re-deployed.
Noel mounts all config values in the application's file system under
/var/noel/config, so for example if you set
bar, reading the file
/var/noel/config/foo will give you
Making requests to your applications
Within the cluster you can send requests to
appname.noelapp. This is the preferred way when designing applications as microservices.
http-frontend service handles proxying external traffic to a given noel application. You can get the external, internet-accessible IP address of this service using
kubectl --namespace noel get svc http-frontend
You have two options for using this IP address to access your applications.
You can point a wildcard top-level domain to this IP address. For example, if you map
*.example.comto the IP address, you can access your application at
You can manually specify a host header when testing requests to applications, for example using
curl -H "Host: app.example.com" external-ip
This is not an official Google product, experimental or otherwise. It's just code that happens to be owned by Google. This is for education purposes, it's not intended to be production-ready.
See CONTRIBUTING.md. Contributions are more than welcome, but remember, Noel is intended to be simple and educational.
Noel is made available under the Apache License, Version 2.0. See LICENSE.