Outline:
? How to discover services in Kubernetes
? How to discover the services provided by pod
? How to use service discovery Services
? How to use the Kube-dns discovery service
? Kube-dns principle
? Composition
? Domain name format
? Configuration
Note: this share is based on the Kubernetes 1.2 version!Let's start with a simple example.1.How to discover service
Author: Peng Jingtian
The node nodes of Kubernetes are composed of Kubelet, Kube-proxy, flannel, dockerd four components, this paper mainly analyzes the functions and principles of kube-proxy components. Pod is the smallest unit of resource allocation in kubernetes and the smallest entity to perform tasks.
Each pod has a separate IP on the flannel overlay network. Pod Communication in node nodes is impleme
Outline:
How to discover services in KubernetesHow to discover how pod-provided services use the Service Discovery service to use the Kube-dns discovery service
Kube-dns principleCompose domain name format configuration
Note: This share is based on the Kubernetes 1.2 version.
Let's start with a simple example. 1. How to discover service in Kubernetes
Discover pod-provided services
First create a Nginx depl
This article is based on the Kubernetes 1.5.2 version to write the configuration method
When the kubernetes version is greater than or equal to 1.2, the external network (that is, the network within the K8s cluster) accesses the cluster IP by:Change Master's/etc/kubernetes/proxy, kube_proxy_args= "" to Kube_proxy_args= "–proxy-mode=userspace"Restart the Kube-proxy serviceAdds a route to the core routing device or source host, and the route to the clus
Deploying k8s Cluster 04 with KUBEADM-Configuring Kubelet Access Kube-apiserver2018/1/4Configuring Kubelet Access Kube-apiserver
Switch master node to connect to the Apiserver of this node
Toggle worker node connected to Apiserver's LB portal (recorded in the corresponding document)
Premise: This LB has been deployed to complete
Switch master node to connect to the Apiserv
traffic to.
Targetport is well understood, Targetport is the port on the pod, and data coming from port and Nodeport eventually goes through kube-proxy into the back-end pod's targetport and into the container. Port, Nodeport summary
In general, both port and Nodeport are ports of service, the former exposed to customer access services in the cluster, and the latter exposed to client access services outside the cluster. Data coming from both ports re
Kube-scheduler Component Source Reading notes
Before I start, let's talk about the way I read the project source code for the Go language. Reading other people's frame code is often a painful thing to read, especially the go (because of the way the interface is implemented, and so on). This is how I read, first find the relevant components of the Main method, and then go down one layer of the rationale, and finally do the general idea of finishing.
N
Body in the Plugin/cmd/kube-scheduler/app/options.go file, Schedulerserver defines the context and parameters required to run a scheduler
Schedulerserver has all "context" and params needed to run a Scheduler
{
componentconfig. Kubeschedulerconfiguration//Master is the ' address ' of the
kubernetes API server (Overrides any
//value in Kubeco Nfig).
Master string
//Kubeconfig is Path to kubeconfig file with authoriza
clients of the cluster (the other way is LoadBalancer), so TargetportThe port on the pod, the service should proxy traffic to.Targetport well understood that Targetport is the port on the pod, and the data coming from port and Nodeport eventually go through the kube-proxy into the container on the targetport of the back-end pod.Port, Nodeport SummaryIn general, both port and Nodeport are service ports that are exposed to client access services in the
Deploying k8s Cluster 05 with KUBEADM-Configuring KUBECTL Access Kube-apiserver2018/1/4Configuring KUBECTL Access Kube-apiserver
Switch master node to connect to the Apiserver of this node
Confirm Cluster Information
Switch master node to connect to the Apiserver of this node ### in order to perform kubectl on these 2 new nodes requires configuration admin.yaml[[emailprotected] ~]# mkdir-p
Kube-dns compositionKube-dns can solve the service discovery problem, k8s registers the service name as a domain name into Kube-dns, and can access the services it provides through the name of the service.Kube-dns of four components: ETCD, which is used to save DNS rules. kube2sky, the role is to write DNS rules. skydns, provides DNS resolution services. healthz, provides health check function. whi
This article QQ space link: http://user.qzone.qq.com/29185807/blog/1460620187
This article csdn Links: http://blog.csdn.net/screscent/article/details/51152192
The kube-proxy is the load Balancer and service agent for services in Kubernetes. Kube-proxy runs on the Minion, this article mainly explains how the proxy obtains ServiceConfig and Endpointsconfig
Source code in the K8s.io\kubernetes\cmd\
This is a creation in
Article, where the information may have evolved or changed.
Help documentation
Variables to use
The variables used in this document are defined as follows:
$ export MASTER_IP=XX.XX.XX.XX # 替换为 kubernetes master VIP$ export KUBE_APISERVER="https://${MASTER_IP}:6443"$
Create a kubectl config file
$ # 设置集群参数$ kubectl config set-cluster kubernetes \ --insecure-skip-tls-verify=true \ --server=${KUBE_APISERVER} $ # 设置客户端认证参数$ kubectl config set-credentials crd-admin \ --token=7
After a lapse of years, and began to play csdn.
the service in k8s is a virtual concept, completely by Kube-proxy implementation
for each service you create, you need to define three variables: Clusterip port targetport nodeport
which
Clusterip + port is used for internal pod Access service and is then assigned
Targetport is the port of the container.
Nodeport is the back-end pod for the external Access service, and can be accessed by any node-nodepo
This text is transferred from oneself space: http://user.qzone.qq.com/29185807/blog/1459831332
Source code for k8s v1.1.1 stable version one, main flow 1. Main entrance
Source code in K8s.io/kubernetes/plugin/cmd/kube-scheduler
This package is k8s inside the consistent package style, no longer say more
Source code in K8s.io/kubernetes/plugin/cmd/kube-scheduler/app
Keep going down.
The real entrance.
Ther
kubernetes Scheduling Component Kube-scheduler Source analysis
1. Dispatch Flow chart
2 Introduction to the default scheduling algorithm
3 Data Structure
func
Main ()
{
Runtime. Gomaxprocs (runtime. NUMCPU ())
S:=options. Newschedulerserver ()
S.addflags (Pflag.commandline)
Util. Initflags ()
Util. Initlogs ()
defer util. Flushlogs ()
Verflag. Printandexitifrequested ()
App. Run (s)
}
The main function first constructs and initializes t
Turn from my own space, http://user.qzone.qq.com/29185807/blog/145872228
Continue to connect the Kube-apiserver analysis (2)
In the previous article, we analyzed the registration of storage. Below is an analysis of how storage is converted into restful format.
Let's start with the k8s.io\kubernetes\pkg\master\master.go.
In function func (M *master) init (c *config)
We saw Api_v1 's installrest.
Trace it in.
This selection of the default Apigroupver
From my space turn over, space address http://user.qzone.qq.com/29185807/blog/1458208552 Source version for v1.1.1 stable versionStart file K8s.io/kubernetes/cmd/kube-apiserver/apiserver.go from function mainWe enter the Server.go in the K8s.io/kubernetes/cmd/kube-apiserver/app catalogue.We see a lot of parameters in apiserver and we don't care about it for a while. Newapiserver also just do some parameter
From my space turn over, space address http://user.qzone.qq.com/29185807/blog/1458270203
And then an article.
We're back in k8s.io\kubernetes\pkg\master\master.go.
Func (M *master) init (c *config) {
From the code, it generates a lot of storage,podstorage,eventstorage,nodestorage.
These storage are then registered in master's storage variable, which is the restful route, but not the restful routing format.
So where are these routes registered?
Let's keep looking down the code.
or the Init
Php imports mysql Big Data Program online, and php imports mysql Data
Php online import mysql Big Data Program
Applicability: the SQL file exported by phpmyadmin is too large to be imported to online phpmyadmin.
Upload the program and SQL file to the space and delete it after use.
Share the methods of other netizens. For more information, see
$rate_info = file("$table.txt"); print $n_s = chop($rate_info[0]
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.