The Kubernetes Package Manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Adam Reese 946fa6375c
fix(test-style): set git repo path
9 years ago
cmd Merge pull request #371 from technosophos/fix/style-fixes 9 years ago
docs Merge pull request #298 from technosophos/doc/workflow-post-rebase 9 years ago
examples Restore #290 9 years ago
expansion Add flake8 test and fix pep8 style in expansion scripts 9 years ago
hack Add Vagrantfile for build 9 years ago
pkg Merge pull request #371 from technosophos/fix/style-fixes 9 years ago
rootfs fix(*): verify $DOCKER_PROJECT is set if using gcr 9 years ago
scripts fix(test-style): set git repo path 9 years ago
.gitignore feat(testcov): add a test coverage helper script 9 years ago
CONTRIBUTING.md doc(CONTRIBUTING): modify the procedural aspects 9 years ago
LICENSE Initial commit for DeploymentManager on k8s. 9 years ago
MAINTAINERS.md doc(CONTRIBUTING): modify the procedural aspects 9 years ago
Makefile ref(test-style): add a script for linting tools 9 years ago
README.md Point users to the latest release 9 years ago
circle.yml Add flake8 test and fix pep8 style in expansion scripts 9 years ago
get-install.sh fixing shell variable references 9 years ago
glide.lock Add sprig as a dependency. 9 years ago
glide.yaml Add sprig as a dependency. 9 years ago

README.md

Deployment Manager

Circle CI Go Report Card

Deployment Manager (DM) dm makes it easy to create, describe, update and delete Kubernetes resources using declarative configuration. A configuration is just a YAML file that configures Kubernetes resources or supplies parameters to templates. Templates are just YAML files with Jinja mark up or Python scripts.

For example, this simple configuration deploys the Guestbook example:

resources:
- name: frontend
  type: github.com/kubernetes/application-dm-templates/common/replicatedservice:v1
  properties:
    service_port: 80
    container_port: 80
    external_service: true
    replicas: 3
    image: gcr.io/google_containers/example-guestbook-php-redis:v3
- name: redis
  type: github.com/kubernetes/application-dm-templates/storage/redis:v1
  properties: null

It uses two templates. The front end is a replicated service, which creates a service and replication controller with matching selectors, and the back end is a Redis cluster, which creates a Redis master and two Redis slaves.

Templates can use other templates, making it easy to create larger structures from smaller building blocks. For example, the Redis template uses the replicated service template to create the Redis master, and then again to create each Redis slave.

DM runs server side, in your Kubernetes cluster, so it can tell you what templates you've instantiated there, what resources they created, and even how the resources are organized. So, for example, you can ask questions like:

  • What Redis instances are running in this cluster?
  • What Redis master and slave services are part of this Redis instance?
  • What pods are part of this Redis slave?

Because DM stores its state in the cluster, not on your workstation, you can ask those questions from any client at any time.

Templates live in ordinary Github repositories called template registries. See the Kubernetes Template Registry for curated Kubernetes applications using Deployment Manager templates.

For more information about configurations and templates, see the design document.

Please hang out with us in the Slack chat room and/or the Google Group for the Kubernetes configuration SIG.

Installing Deployment Manager

Note: if you're exploring or using the project, you'll probably want to pull (the latest release)[https://github.com/kubernetes/deployment-manager/releases/latest], since there may be undiscovered or unresolved issues at HEAD.

From a Linux or Mac OS X client:

curl -s https://raw.githubusercontent.com/kubernetes/deployment-manager/master/get-install.sh | sh

and then install the DM services into your Kubernetes cluster:

helm dm install

That's it. You can now use kubectl to see DM running in your cluster:

kubectl get pod,rc,service --namespace=dm

If you see expandybird-service, manager-service, resourcifier-service, and expandybird-rc, manager-rc and resourcifier-rc with pods that are READY, then DM is up and running!

Using Deployment Manager

Run a Kubernetes proxy to allow the dm client to connect to the cluster:

kubectl proxy --port=8001 --namespace=dm &

Deploy an app

To deploy a simple guestbook app:

$ dm deploy examples/guestbook/guestbook.yaml
$ kubectl get service

The frontend-service should have an external IP that you can navigate to in your browser to play with.

For more information about this example, see examples/guestbook/README.md

Deploying a template

To deploy a redis template from the Kubernetes Template Registry:

dm --properties workers=3 deploy storage/redis:v1

For more information about deploying templates from a template registry or adding types to a template registry, see the template registry documentation.

Uninstalling Deployment Manager

You can uninstall Deployment Manager using the same configuration:

helm dm delete

Building the Container Images

This project runs Deployment Manager on Kubernetes as three replicated services. By default, helm uses prebuilt images stored in Google Container Registry to install them. However, you can build your own container images and push them to your own project in the Google Container Registry:

  1. Set the environment variable PROJECT to the name of a project known to GCloud.
  2. Run make push

Design of Deployment Manager

There is a more detailed design document available.

Status of the Project

This project is still under active development, so you might run into issues. If you do, please don't be shy about letting us know, or better yet, contribute a fix or feature.

Contributing

Your contributions are welcome.

We use the same workflow, License and Contributor License Agreement as the main Kubernetes repository.

Relationship to Google Cloud Platform

DM uses the same concepts and languages as Google Cloud Deployment Manager, but creates resources in Kubernetes clusters, not in Google Cloud Platform projects.