https://github.com/gravitational/planet
Installable Kubernetes delivered in containers
https://github.com/gravitational/planet
Last synced: about 1 month ago
JSON representation
Installable Kubernetes delivered in containers
- Host: GitHub
- URL: https://github.com/gravitational/planet
- Owner: gravitational
- License: apache-2.0
- Archived: true
- Created: 2015-07-18T17:45:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-28T21:42:27.000Z (almost 2 years ago)
- Last Synced: 2024-11-01T10:35:06.467Z (6 months ago)
- Language: Go
- Homepage:
- Size: 93.7 MB
- Stars: 51
- Watchers: 32
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-repositories - gravitational/planet - Installable Kubernetes delivered in containers (Go)
README
# Planet
> **Warning**
> Planet was archived 2023-07-01.
>
> Please see the [Gravity](https://github.com/gravitational/gravity) README.md for more information.Planet is a containerized [Kubernetes](https://kubernetes.io/) environment. It is a self-containerizing Debian image with
Kubernetes services running inside. [Gravity](https://github.com/gravitational/gravity) is the
recommended way to deploy planet containers.## Installation
Planet images are automatically packaged by [Gravity](https://github.com/gravitational/gravity) - this is the easiest way to use and hack on planet.
See the development section below for details on how to build & hack on planet locally.## Details of Operation
Planet is a generic `container image` with executable entry points -- it is an archived [root filesystem](http://www.tldp.org/LDP/sag/html/root-fs.html)
Planet uses [libcontainer](https://github.com/opencontainers/runc/tree/master/libcontainer) to self-containerize.
Planet launches [systemd](http://www.freedesktop.org/wiki/Software/systemd/) inside the container as the main process which manages the
lifetime of all the other services - [Kubernetes](https://github.com/kubernetes/kubernetes), among others.
A `planet` binary is available within planet at `rootfs/usr/bin/planet`That `planet` binary defines all entry points for this package. Here is a brief summary of the planet interface:
```
Commands:
help [...]
Show help.version
Print version informationstart []
Start Planet containeragent --leader-key=LEADER-KEY --election-key=ELECTION-KEY []
Start Planet Agentstop
Stop planet containerenter [] []
Enter running planet containerstatus []
Query the planet cluster statustest --kube-addr=KUBE-ADDR []
Run end-to-end tests on a running clusterdevice add --data=DATA
Add new device to containerdevice remove --node=NODE
Remove device from containeretcd promote --name=NAME --initial-cluster=INITIAL-CLUSTER --initial-cluster-state=INITIAL-CLUSTER-STATE
Promote etcd running in proxy mode to a full memberleader pause
Pause leader election participation for this nodeleader resume
Resume leader election participation for this nodeleader view --leader-key=LEADER-KEY
Display the IP address of the active master
```### Building (installing from source)
Prerequisites for planet development are:
- [docker](https://docker.com/) version >= 1.8.2 is required. For development, you need to be
inside docker group and have the docker daemon running so the typical docker commands like `docker run`
do not require sudo permissions. Here's official [docker configuration](https://docs.docker.com/engine/articles/configuring/) reference.
- (optional) [vagrant](https://www.vagrantup.com/) version >= 1.7.4The building process has been tested on `Debian 8` and `Ubuntu 15.04`.
The output of Planet build is a tarball that goes into `build/$TARGET`:
Following are the most common targets:
- `make production` - builds a planet image. These are the images used by Gravity.
Building planet for the first time takes considerable amount of time since it has to download/build/configure
quite a few dependencies:
- Kubernetes
- docker registry
- [flannel](https://github.com/coreos/flannel>)
- [etcd](https://github.com/coreos/etcd)Subsequent builds are much faster because intermediate results are cached (in `build/assets` directory).
To clear and rebuild from scratch, run the `make clean`.### Upgrading dependencies
If your patch depends on new go packages, the dependencies must:
- be licensed via Apache2 license
- be approved by core Planet contributors ahead of time
- be vendored via go modulesNon-go (root fs) dependencies are encapsulated into their own build packages rooted
at `build.assets`.For instance, to upgrade etcd, edit build.assets/makefiles/etcd/etcd.mk:
```Makefile
...
VER := v2.2.3
...
```The version of Kubernetes is defined in the root makefile:
```Makefile
...
KUBE_VER := v1.17.9
...
```## Planet Design
### Planet Daemon
Once started, planet will continue running and waiting for the main systemd process to end.
The container environment is encapsulated by the [box](https://github.com/gravitational/planet/tree/master/lib/box) package.
As part of its operation, planet will also start a web server to enable remote process control.
The server listens on the unix socket (in a `/var/run/planet.sock` by default) and is capable of
running commands inside the container on behalf of the client - this is how the commands `planet stop`
and `planet enter` are implemented.### Planet Agent
One additional service is the agent. Agent is responsible for maintaining the health status
of the cluster (obtainable with `planet status`) and implementing the master fail-over by
dynamically promoting nodes to master should the active master fail.