kpm is no longer developed or maintained by CoreOS.
[](https://travis-ci.org/coreos/kpm)
if you have any question you can **chat** with us [](https://kubespray.slack.com)
# KPM
KPM is a tool to deploy and manage application stacks on kubernetes.
KPM provides the glue between kubernetes resources (ReplicaSet, DaemonSet, Secrets...). It defines a package as a composition of kubernetes resources and dependencies to other packages.
##### Versioning and rollbacks
KPM uses a global registry, packages are immediately accessible and visible to the community. Versioning is strong and was easy to implement: https://cnr.kubespray.com
##### Clustered applications and persistent-storage !
- How to scale database slaves(postgresql/mysql/redis) ?
- How to deploy a production-grade elasticsearch/rabbitmq/zookeep/etcd/ clusters on kubernetes?
It requires stable network identity and a unique storage per pod!
---> KPM creates multiple variation of a single template with simplicity
Creating a 3 node rabbitmq cluster is easy:
1. List the resources
2. Add the keyword `sharded: true` to enable unique variation
3. List the shards and define
```
resources:
- name: rabbitmq
file: rabbitmq-rc.yaml
type: replicationcontroller
sharded: yes
- name: rabbitmq
file: rabbitmq-svc.yaml
type: service
sharded: yes
# LB to any of the rabbitmq shard
- name: rabbitmq
file: rabbitmq-umbrella-svc.yaml
type: service
shards:
- name: hare
variables:
data_volume: {name: data, persistentVolumeClaim: {claimName: claim-hare}}
- name: bunny
variables:
data_volume: {name: data, persistentVolumeClaim: {claimName: claim-bunny}}
- name: rabbit-on-ram
variables:
data_volume: {name: data, emptyDir: ""}
args: [--ram]
```
Demo:
[](https://asciinema.org/a/2ktj7kr2d2m3w25xrpz7mjkbu?speed=2)
##### Server-side
KPM is an API with an command line interface, its major difference in terms of design and possible integration.
--> We wanted a tool that could be integrated anywhere, for that KPM is building the package server side.
Clients are brainless and easy to implement. As a POC we integrated KPM to a fork of https://github.com/kubernetes/dashboard in less than a day:
https://youtu.be/7SJ6p38W-WM
## Install kpm
##### From Pypi
kpm is a python2 package and available on pypi
```
$ sudo pip install kpm -U
````
##### From git
```
git clone https://github.com/coreos/kpm.git kpm-cli
cd kpm-cli
sudo make install
```
### Configuration
KPM uses `kubectl` to communicate with the kubernetes cluster.
Check if the cluster is accessible:
```bash
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"1", GitVersion:"v1.1.4", GitCommit:"a5949fea3a91d6a50f40a5684e05879080a4c61d", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"1", GitVersion:"v1.1.4", GitCommit:"a5949fea3a91d6a50f40a5684e05879080a4c61d", GitTreeState:"clean"}
```
### List packages
- All packages: `kpm list`
- Filter by user: `kpm -u username`
The website [https://kpm.kubespray.io](https://kpm.kubespray.io) has more advanced search and browsing featutres than the CLI.
### Deploy an application
`kpm deploy package_name [-v VERSION] [--namespace namespace]`
```
$ kpm deploy ant31/rocketchat --namespace myns
create ant31/rocketchat
package version type name namespace status
---------------- --------- --------------------- ---------- ----------- --------
ant31/mongodb 1.0.0 namespace myns myns created
ant31/mongodb 1.0.0 service mongodb myns created
ant31/mongodb 1.0.0 replicationcontroller mongodb myns created
ant31/rocketchat 1.6.2 namespace myns myns ok
ant31/rocketchat 1.6.2 service rocketchat myns created
ant31/rocketchat 1.6.2 replicationcontroller rocketchat myns created
```
It deploys the package and its dependencies.
The command can be executed multiple times, kpm detects changes in resource and apply only the modified ones.
### Uninstall an application
The opposite action to `deploy` is the `remove` command. It performs a delete on all resources created by `deploy`. It's possible to mark some resources as `protected`.
`Namespace` resources are protected by default.
```
kpm remove ant31/rocketchat --namespace demo
package version type name namespace status
---------------- --------- --------------------- ---------- ----------- ---------
ant31/mongodb 1.0.0 namespace myns myns protected
ant31/mongodb 1.0.0 service mongodb myns deleted
ant31/mongodb 1.0.0 replicationcontroller mongodb myns deleted
ant31/rocketchat 1.6.2 namespace myns myns protected
ant31/rocketchat 1.6.2 service rocketchat myns deleted
ant31/rocketchat 1.6.2 replicationcontroller rocketchat myns deleted
```
=======
History
=======
0.1.0 (2016-2-22)
------------------
* First release on PyPI.
Metadata
Release files for kpm 0.25.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kpm-0.25.0.tar.gz | 58.5 kB | Without provenance | Details for kpm-0.25.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kpm-0.25.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for kpm-0.25.0-py2.py3-none-any.whl |
Total release size: 105.3 kB
Release files / kpm-0.25.0.tar.gz
| Download URL | kpm-0.25.0.tar.gz |
|---|---|
| Size | 58.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8b67d227cac74f88fc7442675c1bdb9b933ba04b47b85b820128e4448b3ab70
|
|
BLAKE2b-256 checksum How to use checksums |
683c14cb1c3be76e443063bdd48bbc4a3782b2f177e49ba636719f6a997812e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / kpm-0.25.0-py2.py3-none-any.whl
| Download URL | kpm-0.25.0-py2.py3-none-any.whl |
|---|---|
| Size | 46.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
852a056e76515190fd3b29354b38e2baca066946e6fb83aa016d1272b565347d
|
|
BLAKE2b-256 checksum How to use checksums |
ba483b2b6197f11a230bca815079b4d1bc5d9506acfe8be922118cf01f6d41a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kpm 0.25.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.