Up and running with Kubernetes.io and Raspberry Pis
来源:互联网 发布:h5营销游戏源码 编辑:程序博客网 时间:2024/05/05 13:14
转自:http://kubecloud.io/getting-up-and-running-with-kubernetes-io/
The following post is based on this link written by Arjen Wassink. Arjen demonstrated the Kubernetes.io cluster at Devoxx 2015 together with Ray Tsang. The talk about Kubernetes and the demonstration of the Raspberry Pi cluster is embedded below.
Prerequisites
You need the following for this guide:
- A couple of Raspberry Pis including power supply, sd-cards etc.
- HypriotOS image installed. (See the Running docker on your Raspberry Pi guide)
Installing Kubernetes on the master node
First, we need to setup the master node. To get started we need to download Arjen Wassink great install scripts. Thank you for the hard work! Get the stuff by running the following command:
Next run the following command to update the package lists from the repositories
For unpacking the zip-file, we need to get unzip.
Unzip the downloaded zip-file by using unzip.
The last thing we need to do is running the install-script for the master node. Type in the following command and press enter!
Be aware that this can take a while.
The install-script will install 5 services, namely:docker-bootstrap.service
, k8s-etcd.service
, k8s-flannel.service
, docker.service
and k8s-master.service
.
Now we need to verify that everything went as expected. To do this run the following command and you should see 2 docker daemons running as shown in the output below:
Next we have to be sure that flannel
and etcd
are up and running. It should look something like the following, where flanneld
and etcd
are up and running.
Lastly we need to check that the hyperkube kubelet, apiserver, scheduler, controller and proxy are running. Now you should be able to see the hyperkube kubelet
, apiserver
, scheduler
, controller
and proxy
. To do this, type in the following.
Deploying the first pod
Now we are ready to deploy our first pod. First we need to go grab the command line tool for accessing the Kubernetes cluster. Type in the following command
In order to access the command-line tool change the permission of /usr/bin/kubectl
In order to see available nodes, use the following command
Let's try to run a simple pod, namely the hypriot/rpi-busybox-httpd
, which is just a simple webserver displaying a static page. Run the pod as follows
Now we can check that the pod is running by entering the command below
Now, we have a pod running locally, but only locally. Export the pod to the outside by running the expose
command. The --port
option specifies the external port our pod will be accessible through. Remember to update the external-ip to your masters ip.
To check that pod is now exposed, we can run the kubectl get svc
which displays the services running and the ports at which they are accessible at
Go to the ip-address you specified (in our case: http://192.168.1.21:90
) and check to see if everything is running!
You can also verify this through the commandline:
Setting up worker nodes
Now that our master node is up and running, we continue to setup our worker nodes. On a new node execute the following commands.
IMPORTANT: Change the ip-address in /etc/kubernetes/k8s.conf to match the master node's ip-address before running the following command.
The install script setup everything needed in order to be a worker-node. This involves installing 4 services, which is quite similar to what the master install script was doing. The biggest difference is that the etcd
service is not running and the kubelet service is configured as a worker node.
To see verify that all nodes are registered correctly, run the following.
Scaling the pod
The last thing we will be going through in this post is how to scale a pod. We have 4 Raspberry Pis in our cluster, but you can choose the number you please.
And lastly we can check that we got 4 busyboxes running in our cluster
Now you have a Kubernetes cluster running with some worker nodes. Stay tuned for a guide to get up and running with Kubernetes dashboard.
For more information about the installation procedure for Kubernetes, please check out the Getting started guide and the link written by Arjen Wassink.
- Up and running with Kubernetes.io and Raspberry Pis
- up and running with cassandra
- up and running with cassandra
- up and running with cassandra
- Up and Running with C++
- Up and Running with Houdini ( lynda--H14)
- How to get up and running with Apparat
- CHAPTER 9 -Up and Running with TensorFlow part1
- CHAPTER 9 -Up and Running with TensorFlow part2
- HTMLCSS_《HTML5 Up and Running》
- GETTING UP AND RUNNING WITH NODE.JS, EXPRESS, JADE, AND MONGODB
- OReilly.Ruby.on.Rails.Up.and.Running
- Ruby on Rails: Up and Running
- 读《Java Web Services: Up and Running》
- iOS on Rails- up and running
- Navigation with Back and Up
- Raspberry Pi with Node.js and Arduino
- Raspberry Pi with Node.js and Arduino
- jquery实现监听文本框
- cmd下获取指定进程名的pid号,并通过taskkill结束该进程
- java Iterator(未完成)
- iOS Socket的使用
- Oracle 窗口函数over()与窗口子语句
- Up and running with Kubernetes.io and Raspberry Pis
- iOS 动画教程-自定义 View Controller 呈现转换
- 数位dp
- jemalloc Linux 安装与使用方法
- 手机设计公司最基本的六个部门:ID、MD、HW、SW、PM、Sourcing、QA
- 使用Jquery的inArray() 方法排重
- linux 服务器 xshell 常用操作
- js产生对象的3种基本方式
- 自定义通知(推送)效果