In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "how to use Deployment in Kubernetes". In the operation of actual cases, many people will encounter such a dilemma, 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!
Start
The configuration file includes a static page. First, we want to start serving its static content. Starting with Kubernetes repository's root, run:
This runs a proxy on port 8001. You can now visit: http://localhost:8001/static/, which is the demo web version (it now logs in and displays a blank page). Now we want to run an application and display it on a web page.
The code deploys a copy of the application with "update-demo:nautilus", which you can click here to view: http://localhost:8001/static/
The cards displayed on the page represent the name (ID), status, image and tag of a Kubernetes pod,pod.
The quantity becomes larger.
Now we want more copies of this app!
Update your application
What happens when you update the application?
This code opens your default editor, and then you can update the configuration on fly. Find .spec.template.spec.containers [0] .image, then modify nautilus to kitty, and you will see:
What you need to do now is to update the image of the application from "update-demo:nautilus" to "update-demo:kitty".
After a while, you will find that the update seems to be stuck. Oh, but what happened to the Cartesian form?
Debug rollout
If you look more closely, you will see that the images marked with "Kitty" are still pending. Once the run fails, Deployment automatically stops roll. Let's take a look at what happens on the new pod:
If you take a look at the events of this pod, you will notice that Kubernetes cannot pull the image because it cannot find "kitty":
Roll back
Okay, now we want to undo the changes and take the time to figure out which mirror tag we should use.
Everything is back to normal, yeah!
Update your application
After that, we finally found out that the correct image tag is "kitten", not "Kitty". Now put .spec.template.spec.containers [0]. Change the image label from "nautilus" to "kitten".
Now you can see 4 kittens on the demo website, which means that we have successfully updated the app! If you want to understand the mirror image behind this, take a look at this Deployment:
You can see from the events section that the configuration is managing another resource called Replica Set, each of which manages the number of copies of different pod templates.
This is the end of the content of "how to use Deployment in 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.