In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the function of API and Dashboard in Rancher 2.5". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the role of API and Dashboard in Rancher 2.5?"
Kubernetes Native API
In versions prior to Rancher 2.5, we encapsulated the native Kubernetes API to meet our UI presentation needs. The advantage of these wrappers is that we can define our own data structures and provide a set of API-UI that can interact separately, which users can use to simulate calling API. Usually in many portals of Rancher UI, click "View API" or visit "https:///v3"" in the browser to view the access. These API are implemented based on Kubernetes CRD and encapsulated to form a Rancher-style API. As to how to define Rancher style API, you can visit this link to see:
Https://github.com/rancher/api-spec
Of course, the disadvantages of this approach are obvious, and from the experience of Rancher engineers and community users, there are mainly the following points:
Extending Rancher API is very complex and can only be done by developers who read the Rancher code in depth or have received some training.
As Kubernetes API evolves, it becomes more and more difficult for Rancher API to be compatible with multiple versions of Kubernetes API.
Rancher API masks some advanced API parameters, which is very unfriendly for some advanced users.
With regard to these problems, we have begun to try to make some changes in Rancher 2.4. careful friends may have discovered the new Dashboard of Rancher 2.4, which uses a new style of Rancher API. The implementation of this set of API relies on a relatively independent component, steve. In order to solve the previous API problem, steve has made the following improvements:
Completely follow the API-UI mode of Rancher without destroying the user's habits.
Compatible with Kubernetes Native API, including native objects and CRD, preserving their data fields as much as possible.
Extending API is very simple, as long as you register CRD,steve with Kubernetes to watch CRD resource changes through built-in controller, and add its hot load to steve API.
Steve is a relatively independent component that can run independently even without Rancher. If you want to re-develop Kubernetes, but feel that native API is not friendly, you can enable Steve-style API on it. The author has done a small experiment, deploy K3s and install steve independently, it is very convenient to get a friendly API.
The installation process of K3s is relatively simple and directly skipped, and the compilation of steve can be directly referred to Makefile/Dockerfile. After successful compilation, a steve:latest image is generated locally, then start steve using docker run-itd-- net=host-v ${HOME} / .kube:/root/.kube steve:latest, and we can get a Rancher API of Kubernetes Native. Visit "https://:9443/v1"" to view the results:
Kubernetes Native Dashboard
Nowadays, there are more and more extension components that can be accessed in the Kubernetes ecology. often, we will install various programs such as Prometheus, Istio, ArgoCD and so on in Kubernetes. These programs will basically enhance their service capabilities through CRD. This leads to a large number of CRD in the cluster, and it is more and more difficult to manage, so many experienced senior technicians begin to expect the visual management of CRD to avoid the tedious operation of Kubectl CLI. With this requirement in mind, the new Dashboard integrated in Rancher 2.5 is also more Kubernetes Native.
All of this stems from the ability of Steve API to use Kubernetes API indirectly very easily. In Rancher 2.4, we have provided an experimental version of this feature, which I believe many users have tried. In Rancher 2.5, this feature will be officially available, which will be very friendly to senior technicians who manage a single Kubernetes cluster.
The new Dashboard can visually manage both Kubernetes native resources and CRD extension resources, and provide comprehensive parameter settings on forms such as the creation of Kubernetes native resources, which is more mature than the experimental Dashboard in the Rancher 2.4 era. The overall page style also tends to be more concise, for skilled developers of Kubernetes will be very convenient, but also using the Vue framework to write, which for domestic users to do secondary development is also a great benefit.
Hands-on experience of Rancher 2.5
You can continue to use the docker run trial experience in Rancher 2.5, unlike the previous one, you need to add the privileged parameter:
$sudo docker run-d-- restart=unless-stopped-p 80:80-p 443-- privileged rancher/rancher:v2.5.1
After the startup is complete, enter the login page for the first time, in addition to configuring the initialization password, but also set the default view. The two views are: multi-cluster management and single-cluster management, the former using Rancher2.4 UI and enhanced, the latter is the Kubernetes Native Dashboard introduced earlier. For Native Dashboard, you can start a complete local cluster in the container due to the addition of privileged weighting parameters during startup. Previously, the docker run method can only start kube-api, not a complete cluster, but now you can completely manage it through the new Dashboard and create a new workload on the local cluster. Of course, we believe you will only use this when developing and testing.
In general, users who expect a single cluster to manage will save a lot of deployment resources than before. For users who expect to use multi-cluster management, Rancher 2.5 will still retain the access entrance, while the core functions of multi-cluster management will also be greatly improved, and the overall architecture of Rancher 2.5 will be more flexible, which will be very convenient for users to carry out modular expansion, which we will gradually communicate in the following articles.
At this point, I believe you have a deeper understanding of "what is the role of API and Dashboard in Rancher 2.5". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.