|
This article CoreOS official blog published news and notes, introduced in CoreOS integration and support for Kubernetes core components of kubelet. By installing and using Kubelet, demonstrates the use of skills in CoreOS Kubelet, and demonstrate how to better manage and monitor in Kubernetes container resources.
This week we CoreOS Linux in the alpha development version integrates kubelet - Kubernetes a core embedded component. Kubelet responsible for maintaining the pod (application examples) collection. Pod set consists of one or more containers of the local system. In Kubernetes cluster, it kubelet used as a local agent by accessing Kubernetes the API server, the monitoring PodSpecs state. kubelet also responsible for registering the node to Kubernetes, send events and pod status, resource utilization reporting.
kubelet Kubernetes play an important role in the cluster, but also can work in stand-alone mode. The next article will focus on in stand-alone mode that is running Kubernetes cluster technique but use Kubelet next node, and how to use built-in tools cAdvisor use Kubelet monitor container resource utilization.
First we need to install kubelet up and running. Use this guide in CoreOS Linux 773.1.0 or later.
With systemd configuration Kubelet
CoreOS Linux reasonable default integrated kubelet, and made safety and ease of use to optimize optimization. But we will be relaxed security restrictions to support advanced container. This requires the agent to run on a single node Kubernetes components, the components need iptables operating authority, in order to facilitate the configuration Kubernetes service discovery model.
Create kubelet systemd (system management daemon) unit
sudo vim /etc/systemd/system/kubelet.service
[Unit]
Description = Kubernetes Kubelet
Documentation = https: //github.com/kubernetes/kubernetes
[Service]
ExecStartPre = / usr / bin / mkdir -p / etc / kubernetes / manifests
ExecStart = / usr / bin / kubelet \
--api-servers = http: //127.0.0.1: 8080 \
--allow-privileged = true \
--config = / etc / kubernetes / manifests \
--v = 2
Restart = on-failure
RestartSec = 5
[Install]
WantedBy = multi-user.target
Start kubelet Service
After leaving good systemd unit files, use the command to start kubelet systemctl
sudo systemctl daemon-reload
sudo systemctl start kubelet
To ensure kubelet can boot from the start, you need to activate the service:
sudo systemctl enable kubelet
Then kubelet service should have been run up. You can use the status command to confirm systemctl:
sudo systemctl status kubelet
Start a single-node cluster Kubernetes
kubelet provides a convenient interface for local system management container. Kubelet provide a list (manifest) dictionary, to be monitored once every 20 seconds to update the pod's manifest file. Prior to this, in kubelet systemd unit requires the use -config flag profile directory / etc / kubernetes / manifests.
Pod manifest file format and set the volume description file and one or more containers JSON or YAML file. We can use a directory in the manifest pod manifest, Kubernets deploy a single-node cluster.
Download Kubernetes pod manifest
wget https://raw.githubusercontent.com/coreos/pods/master/kubernetes.yaml
Internet Download pod manifest there is a potential security risk, so be sure to check the contents of all pod manifest before using them.
cat kubernetes.yaml
At this point we just need to copy kubernetes.yaml this pod manifest to the manifest kubelet directory to start a single-node cluster.
sudo cp kubernetes.yaml / etc / kubernetes / manifests /
When copying is complete, you can use standard command-line tool to see Docker Docker mirror and containers start:
sudo docker images sudo docker ps
A few minutes later you have a running Kubernetes cluster. Then download the official Kubernetes client tools.
Download Kubernetes client
kubectl is the official command-line tool for interaction and Kubernetes cluster. Each Kubernetes release includes a new version of kublet. Download and change it to an executable program:
wget https://storage.googleapis.com/kubernetes-release/release/v1.0.3/bin/linux/amd64/kubectl
chmod + x kubectl
kubectl be used to get a running cluster information.
./kubectl cluster-info
Kubernetes master running http: // localhost: 8080
kubectl can also be used to launch pods
./kubectl run nginx --image = nginx
Get pods with the command to run pods:
./kubectl get pods
For more details please refer to Kubernets Kubernetes on CoreOS docs.
Vessel monitoring by cAdvisor
kubelet built packaged cAdvisor, which is used to collect, aggregate, process and export the information to a given system running in the container. cAdvisor includes built-in web interface that can be accessed via port 4194.
[Cadvisor web interface]
By cAdvisor web UI, you can easily view system resource utilization and disposal list.
[System utilization diagram]
cAdvisor can also be used to monitor a special container, for example kube-apiserver in Kubernetes pod in the running:
[View with cadvisor container information]
For more information, please refer cAdvisor upstream docs.
For more information and Kubernetes of CoreOS
CoreOS Linux mirror integrated kubelet demonstrate our commitment to the (support) Kubernetes and open the container to bring the best technology for our users (determined). Native support Kubernetes kubelet, we hope to enhance the efficiency Kubernetes deploy, and provide a robust interface to manage and monitor the container CoreOS system. |
|
|
|