Spin up a full fledged Kubernetes environment designed for local development & CI
pupernetes (a play on “Kubernetes” and “puppy”) is a tool written at Datadog for spinning up a full-fledged Kubernetes environment for local development and CI environments similar to other tools like minikube but with a few more features. pupernetes was originally designed to perform e2e testing of the Datadog Agent.
The goal of pupernetes is to be a smarter "Makefile" to setup, run, and clean up a full-fledged Kubernetes environment using any combination of the supported versions of Kubernetes, etcd, container runtime, and CNI plugin to validate any software project on top of it. Additionally, pupernetes provides user-friendly features like:
coredns
) during startup so you can use kubectl
immediately after pupernetes has started.Provides:
--container-runtime=containerd
)The default setup is secured with:
You can use pupernetes to validate a software dependency on Kubernetes itself or just to run some app workflows with argo.
As pupernetes runs in travis and circle-ci, it becomes very easy to integrate this tool in any Kubernetes project.
A Linux system is required.
tar
unzip
systemctl
systemd-resolve
(or a non-systemd managed /etc/resolv.conf
)mount
iptables
nsenter
libseccomp2
(if using containerd)Additionally any implicit requirements needed by the kubelet, like the container runtime and more.
Currently only reporting docker
, please see the current limitations.
If you're using Docker
as the container runtime, you must already have Docker installed.
A recent systemd version is better to gain:
systemd-resolve
journalctl --since
Ensure your hostname is discoverable:
dig $(hostname) +short
pupernetes must be run on linux (or linux VM).
Please see our ubuntu 18.04 notes about it.
To compile pupernetes, you need the following binaries:
go
1.10
make
go get -u github.com/DataDog/pupernetes
cd ${GOPATH}/src/github.com/DataDog/pupernetes
make
You need to download the last version:
VERSION=0.12.0
curl -LOf https://github.com/DataDog/pupernetes/releases/download/v${VERSION}/pupernetes
chmod +x ./pupernetes
./pupernetes --help
sudo ./pupernetes daemon run /opt/sandbox/
Note:
kubectl
can be automatically installed by pupernetes.You need to run the following command to add
kubectl
to the$PATH
:sudo ./pupernetes daemon run /opt/sandbox/ --kubectl-link /usr/local/bin/kubectl
$ kubectl get svc,ds,deploy,job,po --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 192.168.254.1 <none> 443/TCP 3m
kube-system coredns ClusterIP 192.168.254.2 <none> 53/UDP,53/TCP 3m
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-system kube-proxy 1 1 1 1 1 <none> 3m
kube-system kube-scheduler 1 1 1 1 1 <none> 3m
NAMESPACE NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
kube-system coredns 1 1 1 1 3m
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-747dbcf5df-p2lhq 1/1 Running 0 3m
kube-system kube-controller-manager 1/1 Running 0 3m
kube-system kube-proxy-wggdn 1/1 Running 0 3m
kube-system kube-scheduler-92zrj 1/1 Running 0 3m
Gracefully stop it with:
--timeout
curl -XPOST 127.0.0.1:8989/stop
pupernetes can start a specific Kubernetes version with the flag --hyperkube-version=1.9.3
.
These are the current supported versions:
pupernetes can start a specific container runime with the flag --container-runtime=docker
. The default is docker
.
These are the current supported container runtimes:
It's possible to run pupernetes as a systemd service directly with the command line. In this case, pupernetes asks to systemd-dbus to be daemonised with the given arguments. See more info about it in the run command.
This command line is very convenient to run pupernetes in SaaS CI:
The full documentation is available here.
pupernetes exposes prometheus metrics to improve the observability.
You can have a look at which metrics are available here.