This is a creation in
Article, where the information may have evolved or changed. [Previous post] (https://studygolang.com/articles/12799) We looked at creating a container engine cluster with [TerraForm] (https://terraform.io/). In this blog post, we look at deploying containers into clusters using the container engine and [Kubernetes] (https://kubernetes.io/). # # Kubernetes First, what is [
, RC, and podFor the application we are deploying, it is generally composed of multiple abstract service. In Kubernetes, a service uses the label selector to match out a pods collection, which is the endpoint of the service and the entity that actually hosts the business. The number of deployments, schedules, and replicas of pods within a cluster is managed through higher-level abstractions such as deployment or RC. Such as:The new version of
Spec:Serviceaccountname:Heapster containers:
-Name:Heapster image: k8s.GCR.io/Heapster-Amd64:v1.4.2Imagepullpolicy:Ifnotpresent command:
- /heapster
---source=kubernetes:https://kubernetes.default
---sink=influxdb:http://150.109.39.33:31001 # Here fill in the address of the INFLUXDB server just recorded.
---
Apiversion:v1
Kind:service
metadata:
Labels:
task:monitoring
# for use as a Cluster add-on(https://github.com/
kubernetes clinet-go Development (I.)
Kubernetes currently provides two ways to create the required pod,service,replicationcontroller, one is through Kubectl create-f, a restful interface via HTTP, because of the work item's reason, Need to be customized according to the actual business needs of the development of K8s API, I used the library is the official, code base address: Https://github.com/
From Mesos to KubernetesThe previous scheduling framework was based on Mesos self-research. The language used is Python. Run for about two years, and has been relatively stable. But as the business grows, the problems of the existing framework are gradually exposed.
Scheduling speed encountered bottlenecks, affecting the deployment of large business speed.
There is no good support for stateful services.
There are two solutions to this problem, one for improved refactoring of ex
corresponding.Modify its configuration file/etc/sysconfig/flanneld content as follows:# Flanneld configuration options # ETCD URL location. Point the server where Etcd runsflannel_etcd_endpoints="https://10.10.90.105:2379,https://10.10.90.106:2379,https://10.10.90.107:2379"# ETCD config key. This is the configuration key, which flannel queries# for address range Assignment#flannel_etcd_prefix="/atomic.io/network"Flannel_etcd_prefix="/kube-centos/network"# Any additional options and want to pass
footprint.3. Log in hub.docker.com using the Docker login command4. Push the local image to hub.docker.com using a command such as Docker push Chenxizhang/mvcapp, which may take a certain amount of time, depending on your network configurationIf all goes well, you can see the following resultsNote: If you are creating your own Docker warehouse, you can learn about the Azure Container Registry service. (https://azure.microsoft.com/zh-cn/services/conta
Use Kubernetes step by stepWhy Docker and Kubernetes?
Containers allow us to build, publish, and run distributed applications. They free applications from machine restrictions and allow us to create a complex application in a certain way.
Writing applications using containers can bring development and QA closer to the production environment (if you try to do so ). By doing so, you can publish changes faster
Brief introduction:Docker: An open-source application container engine that can create a lightweight, portable, self-sufficient container for your application.Kubernetes: The Docker container Cluster Management system, which is open source by Google, provides the functions of resource scheduling, deployment operation, service discovery, capacity scaling and so on for containerized applications.ETCD: A highly available key-value storage system developed and maintained by CoreOS, primarily for sha
there is no/var/lib/rancher/state/this folder, if any, delete it;
If you have previously installed kubernetes through rancher, execute the command:
Docker Rm-f-V $ (Docker Ps-aq) Docker volume RM $ (Docker volume LS) rm-rf/var/etcd/
If you choose Vxlan Network deployment, you need the/etc/hosts file to have: ' native IP localhost ' this line, if not, add;
Prohibit Swap:sudo Swapoff–a
address. While this approach enables accelerated deployment of kubernetes, many components (network, health check, etc.) will not be able to guarantee timely updates because custom store warehouses cannot be synchronized with the official warehouses in real time. Therefore, in order to solve this problem, we have modified the official catalog template, adding the ability to customize the warehouse address and namespace. This allows us to customize th
First, prerequisites1, first you will have ready-made kubernetes cluster, if you have nothing now, please refer to:http://zlyang.blog.51cto.com/1196234/19510102, the proposed use ETCD cluster, the construction process please refer to:http://zlyang.blog.51cto.com/1196234/1951164Ii. Deployment of Kubernetes-dashboard[All machines: Master, Node1, Node2]1, install flannel (Flannel for Management containers Netw
installed to use dashboard.
When the dashboard service starts, check to see if the service is working:[[emailprotected] ~]# kubectl get pod -n kube-systemNAME READY STATUS RESTARTS AGEcoredns-77c989547b-2rg9h 1/1 Running 0 2hcoredns-77c989547b-cbj5h 1/1 Running 0 2hkubernetes-dashboard-7d5dcdb6d9-h66fs 1/1 Running 0 1h[[emailprotected] ~]# kubectl get svc -n kube-s
balancing, the subordinate node needs to report its status and resource status to the main control node, and finally carry out the business.Similarly, Kubernetes does provide the basic functions of the principal and subordinate roles described above, and identifies specific components to divide and conquer specific functions:On master, ETCD load persistent storage, used to store various types of resources inside KubernetesKube-apiserver responsible f
install and configure the Gcloud command-line tool and include the Kubectl component (Gcloud components install kubectl). If you do not want to install the Gcloud client on your own machine, you can use Gcloud to perform the same task via Google Cloud script .
Warning: You must set your default calculation service account to include:
To set this item, navigate to the IAM section of the Cloud console and projectNumber-compute@developer.gserviceaccount
Before installation, the three CENTOS7 servers are banned from the firewall, and the mirror that needs to be started 2 node machines must be kept consistent, otherwise the pod will not start1 has three CENTOS7 servers: 10.1.1.170 (Master), 10.1.1.169 node1,10.1.1.171 Node22 Install NTP service on three machines to ensure all time can be synchronized#yum-y Install NTP#systemctl Start NTPD#systemctl Enable NTPD3 Installing Kubernetes Master on 10.1.1.17
Kubernetes ArchitectureThe overall architecture of the kubernetes is as follows:Master is the main control node, which runs Apiserver,scheduler,controller-manager and other components. Minion is the equivalent of a working node, which runs Kubelet,proxy,cadvisor and the most important Docker components. Here's how to actually deploy this cluster management tool.EnvironmentYy1 10.193.6.35Yy2 10.193.6.36Yy1 a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.