Minimalized version of Kubernetes. Components (except kubelet) are running containerized so you don’t need any more VMs.
These scripts can be used for quick bootstrapping of Kubernetes and Etcd. Predefined values are prepared for running on localhost but it can be easily changed to multi node scenario.
Name | Default | Description |
---|---|---|
|
|
etcd is running from this image |
|
|
cluster name of etcd server |
|
|
etcd listen on this address |
|
|
address advetised to etcd clients |
|
|
address of Kubernetes master (API server) |
|
|
|
|
|
IP range used for Kubernetes services |
|
|
Kubernetes components are using this image |
|
Kubernetes uses this etcd server |
|
|
|
Restart policy for Kubernetes containers |
-
Prepare before demo (pull images)
./etcd.sh pull-only ./kubernetes.sh pull-only
-
Get binaries (optional). Needed only for
kubelet-bare
and testingetcdctl
../etcd.sh get-binary ./kubernetes.sh get-binary
It will copy etcd
, etcdctl
and hyperkube
to ./bin/
directory. Make sure this directory is writable via docker volume mount. You will probably need to run (as root) something like chcon -Rvt svirt_sandbox_file_t ./bin
if you are using SELinux.
-
Start etcd server
./etcd.sh
-
(Optional) Test etcd server
./bin/etcdctl set /me $(whoami) && ./bin/etcdctl get /me
-
Start Kubernetes services
-
API server
./kubernetes.sh apiserver
-
Controller Manager
./kubernetes.sh controller-manager
-
Scheduler
./kubernetes.sh scheduler
-
Proxy
./kubernetes.sh proxy
-
Kubelet
-
Kubelet can be launched in container but this approach is highly discouraged since it is experimental and may break anytime. It is recommended to use kubelet-bare but be aware this wrapper runs binary on your system (not in container!). It is required to run kubelet-bare are root.
./kubernetes.sh kubelet
or
./kubernetes.sh kubelet-bare NODE_IP
Please be aware kubelet-bare
will not fork into background and you should dedicate new terminal windows for it. Substitute NODE_IP
with your IP address.
-
Create sample app in Kubernetes
-
Create service
./bin/kubectl apply -f examples/nginx/nginx-svc.yml
-
Create nginx deployment
./bin/kubectl apply -f examples/nginx/nginx-deploy.yml
-
-
Enjoy