In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to create a single master node cluster in kubeadm. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Kubeadm maturity AreaMaturity LevelCommand line UXGAImplementationGAConfig file APIbetaCoreDNSGAkubeadm alpha subcommandsalphaHigh availabilityalphaDynamicKubeletConfigalphaSelf-hostingalpha
The overall characteristic state of kubeadm is GA. Some sub-features, such as the configuration file API, are still under active development. The implementation of creating a cluster may change slightly as the tools evolve, but the overall implementation should be fairly stable. By definition, any command under kubeadm alpha is supported at the alpha level.
Preparatory work for installation
One or more machines running the deb/rpm-compatible operating system, such as Ubuntu or CentOS
2 GB or more memory per machine
More than 2 CPU for master host
Full network connection between all machines in the cluster (public or private networks are good)
Install kubeadm
Kubeadmin installation View https://my.oschina.net/jennerlo/blog/3007440
Initialize master
Master is the machine on which the control panel components run, including etcd (cluster database) and API server (with which kubectl CLI communicates).
Select the pod network add-on and verify that any parameters need to be passed to the kubeadm initialization. Depending on the third-party vendor you choose, you may need to set-- pod-network-cidr to a vendor-specific value. View the installation of pod network add-ons.
(optional) unless otherwise specified, kubeadm uses the network interface associated with the default gateway to advertise the IP of master.
To use a different network interface, specify the-- apiserver-advertise-address= parameter when performing kubeadm init. To deploy an IPv6 Kubernetes cluster using IPv6 addressing, you must specify an IPv6 address, for example-- apiserver-advertise-address=fd00::101
(optional) run kubeadm config images pull before kubeadm init to verify connectivity to gcr.io registries.
Initialization command:
Kubeadm init more information
For more information about the kubeadm init parameters, see the kubeadm reference Guide.
For a complete list of configuration options, see the profile documentation
"to customize the dashboard component, including the optional IPv6 activity probe assigned to the dashboard component and the etcd server, provide additional parameters for each component, as described in Custom parameters."
To run kubeadm init again, you must first tear down the cluster.
If you add nodes with different architectures to the cluster, create separate Deployment or DaemonSet for kube-proxy and kube-dns on the nodes. This is because the Docker images of these components do not currently support multiple architectures.
Kubeadm init first runs a series of pre-checks to ensure that the machine is ready to run Kubernetes. These pre-checks throw a warning and exit on error. Kubeadm init then downloads and installs the cluster control plane components. This may take a few minutes. The output should look like this:
[init] Using Kubernetes version: vX.Y.Z [preflight] Running pre-flight checks [kubeadm] WARNING: starting in 1.8 Tokens expire after 24 hours by default (if you require a non-expiring token use-- token-ttl 0) [certificates] Generated ca certificate and key. [certificates] Generated apiserver certificate and key. [certificates] apiserver serving cert is signed for DNS names [kubeadm-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.138.0.4] [certificates] Generated apiserver-kubelet-client certificate and key. [certificates] Generated sa key and public key. [certificates] Generated front-proxy-ca certificate and key. [certificates] Generated front-proxy-client certificate and key. [certificates] Valid certificates and keys now exist in "/ etc/kubernetes/pki" [kubeconfig] Wrote KubeConfig file to disk: "admin.conf" [kubeconfig] Wrote KubeConfig file to disk: "kubelet.conf" [kubeconfig] Wrote KubeConfig file to disk: "controller-manager.conf" [kubeconfig] Wrote KubeConfig file to disk: "scheduler.conf" [controlplane] Wrote Static Pod manifest for component kube-apiserver to "/ etc/ Kubernetes/manifests/kube-apiserver.yaml "[controlplane] Wrote Static Pod manifest for component kube-controller-manager to" / etc/kubernetes/manifests/kube-controller-manager.yaml "[controlplane] Wrote Static Pod manifest for component kube-scheduler to" / etc/kubernetes/manifests/kube-scheduler.yaml "[etcd] Wrote Static Pod manifest for a local etcd instance to" / etc/kubernetes/manifests/etcd.yaml "[init] Waiting for the kubelet to boot up the controlplane as Static Pods from directory" / etc/kubernetes/manifests "[init] This often takes around a minute Or longer if the control plane images have to be pulled. [apiclient] All control plane components are healthy after 39.511972 seconds [uploadconfig] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace [markmaster] Will mark node master as master by adding a label and a taint [markmaster] Master master tainted and labelled with key/value: node-role.kubernetes.io/master= "[bootstraptoken] Using token: [bootstraptoken] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials [ Bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token [bootstraptoken] Creating the "cluster-info" ConfigMap in the "kube-public" namespace [addons] Applied essential addon: CoreDNS [addons] Applied essential addon: kube-proxyYour Kubernetes master has initialized fulfilling to start using your cluster You need to run (as a regular user): mkdir-p $HOME/.kube sudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id-u): $(id-g) $HOME/.kube/configYou should now deploy a podnetwork to the cluster.Run "kubectl apply-f [podnetwork] .yaml" with one of the addon options listed at: http://kubernetes.io/docs/admin/addons/You can now join any number of machines by running the following on each nodeas root : kubeadm join-token:-discovery-token-ca-cert-hash sha256:
To make kubectl work in a non-root user environment, run these commands:
Mkdir-p $HOME/.kubesudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id-u): $(id-g) $HOME/.kube/config
If you are a root user, you can run:
Export KUBECONFIG=/etc/kubernetes/admin.conf
Token is used for mutual authentication between the primary node and the connected node. The token included here is confidential. Make sure it's secure, because anyone with this token can add authenticated nodes to the cluster.
How to create a single master node cluster in kubeadm is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.