In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what is the federal mechanism of Kubernetes". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Federation (Federal)
This page explains why and how to use federation to manage multiple Kubernetes clusters.
Why federation
Caveats
Hybrid cloud capabilities
Setting up federation
API resources
Cascading deletion
Scope of a single cluster
Selecting the right number of clusters
What's next
Why does the federation
Federation can easily manage multiple clusters. It is implemented by providing two main components:
Synchronize resources across clusters: federation can keep resources in multiple clusters synchronized. For example, you can ensure that the same program is deployed in multiple clusters.
Cross-cluster discovery: the federation provides the ability to automatically configure DNS servers and load balancers with all cluster backends. For example, you can ensure that the backend of multiple clusters can be accessed using global VIP or DNS records.
Some other uses of federation are as follows:
High availability: by propagating loads between clusters and automatically configuring DNS servers and load balancers, the federation minimizes the impact of cluster failures.
Avoid provider lockout (lock-in): by making it easier to migrate applications across clusters, federation prevents cluster provider lockout (lock-in).
Unless there are multiple clusters, federation is of no use. Some of the reasons why you may need multiple clusters are:
Low latency: let clusters in multiple regions minimize latency by providing services to the clusters closest to them.
Fault isolation: it is better to have multiple small clusters than a single large cluster for fault isolation (for example, there are multiple clusters in different availability zones of cloud providers).
Scalability: a single kubernetes cluster has scalability limitations (most users should not do so, see Kubernetes Scaling and Performance Goals for more details).
Hybrid cloud: you can have multiple clusters on different cloud providers or local data centers.
Matters needing attention
While federation has many attractive uses, there are some caveats:
Increase network bandwidth and cost: the federal console monitors all clusters to ensure that the current state is as expected. If the cluster runs in different areas (regions) of cloud providers or different cloud providers this may result in significant network costs.
Reduce cross-cluster isolation: errors in the federated console can affect all clusters. This problem can be mitigated by keeping the logic in the federated console to a minimum. Whenever possible, it is mostly delegated to the console's kubernetes cluster. The design and implementation also make a lot of security considerations and avoid multi-cluster downtime when errors occur.
Maturity: federal projects are relatively new and immature. Not all resources are available, and many resources are still in the alpha state. Issue 88 lists known system issues that the team is busy solving.
Hybrid Cloud Featur
The Kubernetes cluster federation can run clusters in different cloud providers (such as Google Cloud,AWS) and locally (such as OpenStack). Kubefed is the recommended way to deploy federated clusters.
After that, your API resources can span different clusters and cloud providers.
Set up federation
In order to be able to federate multiple clusters, you first need to set up a federated console. Follow the setup guidelines.
API resources
Once the console is set up, you can start creating federated API resources. The following guidelines explain some resources in detail:
Cluster
ConfigMap
DaemonSets
Deployment
Events
Hpa
Ingress
Jobs
Namespaces
ReplicaSets
Secrets
Services
The API reference documentation lists all the resources supported by the federated apiserver.
Cascade deletion
Kubernetes version 1.6 supports cascading deletion of federated resources. When resources are deleted from the federated console, the corresponding resources in all underlying clusters are also deleted.
Cascading deletions are not enabled by default when using REST API. To enable it, set the DeleteOptions.orphanDependents=false option when you delete a resource from the federated console using REST API. Cascading deletions can be enabled by default using kubectl delete. You can also disable it by running kubectl delete-- cascade=false
Note: Kubernetes version 1.5 includes cascading deletion support for a subset of federated resources.
Scope of a single cluster
In IaaS vendors such as Google Compute Engine or Amazon Web Services, virtual machines exist in zone or AZ. We recommend that all virtual machines in the Kubernetes cluster be in the same availability zone because:
There are fewer single points of failure than having a single global Kubernetes cluster.
It is easier to infer the availability properties of a single-area cluster than a cluster that spans available zones.
When Kubernetes developers are designing systems (such as assumptions about latency, bandwidth, or related failures), they assume that all machines are located in a single data center or are very close to each other.
It is recommended that you run fewer virtual machine clusters in each availability zone, but you can run multiple clusters in each availability zone.
The reasons for choosing fewer clusters in each available zone are:
In some cases, having more nodes (fewer resources) in a cluster can improve the packing of Pod.
Reduced operation and maintenance costs (although the advantages are less obvious as operational tools and processes mature).
Reduce the cost of fixed resources per cluster, such as apiserver virtual machines (but a small proportion of the overall cluster cost for large and medium-sized clusters).
The reasons why there are multiple clusters include:
Strict security policies require that one type of work be isolated from another (but see partitioned clusters below)
Test the cluster canary to the new Kubernetes version or other cluster software.
Select the correct number of clusters
The number of Kubernetes clusters chosen is generally the same, but will be revisited occasionally occasionally. In contrast, the number of nodes in the cluster and the number of pod in services may change frequently with load and business growth.
To select the number of clusters, you first need to determine in which areas (region) you need to deploy so that the services running on Kubernetes provide the lowest latency for all end users (CDN- managed content is not considered if you are using a content delivery network). Legal issues may also have an impact on this. For example, a company with a global customer base may decide to have clusters in the United States, the European Union, the Associated Press and South Africa. The number of areas to be used is R.
Second, determine how many clusters can be tolerated at the same time without affecting the overall business. Set the maximum number of unavailable clusters to U. If you are not sure, then Utility 1 is a good choice.
If load balancing is allowed to direct traffic to any area in the event of a cluster failure, at least a larger R or U + 1 cluster is required. If not (for example, if you want to ensure low latency for all users in the event of a cluster failure), you need to have an R * (U + 1) cluster (U + 1 in each R zone). In any case, try to put each cluster into a different area.
Finally, if you need to build a cluster with more nodes than the maximum recommended number of nodes for Kubernetes, you may need multiple clusters. Kubernetes v1.3 supports clusters of up to 1000 nodes. Kubernetes v1.8 supports clusters of up to 5000 nodes. For more guidance, see Building large clusters.
This is the end of the content of "what is the federal mechanism of Kubernetes". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.