In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to pull harbor private warehouse image from K8s". The explanation in this article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to pull harbor private warehouse image from K8s".
When using K8S deployment service, if the specified image address is an internal image repository, a permission error may be reported when downloading the image. This is because when deploying services in K8S, K8S needs to do a verification in Harbor, which is independent of using docker login to log in to Harbor in the node. So in order for K8S to be verified successfully, you need to specify the secret that logs in to the Harbor when deploying the service. For example, create the following Secret:
Kubectl create secret docker-registry harbor-secret-namespace=default-docker-server= http://harbor.com-docker-username=admin-docker-password=123
Docker-registry: is a parameter that specifies the creation of a secret for Docker Registry
Harbor-secret: specifies the name of the secret
-- namespace: specify the namespace, which must be consistent with the namespace of the deployment service, otherwise you cannot reference secret
After the creation is completed, you can view it using the following command:
[@ k8s-master1 ~] # kubectl get secret-n defaultNAME TYPE DATA AGEdefault-token-qdgzk kubernetes.io/service-account-token 3 52dharbor-secret kubernetes.io/dockerconfigjson 1 2d18h
Next, reference secret in the yaml file, as shown in the following example:
Spec: containers:-image: harbor.inner.com/alarm/alarm:prd-v1 imagePullPolicy: IfNotPresent imagePullSecrets: # add this option reference secret-name: harbor-secret # specify the name of the secret
Just reapply the yaml file.
Thank you for your reading. the above is the content of "how to pull harbor private warehouse image from K8s". After the study of this article, I believe you have a deeper understanding of how K8s pulls the image of harbor private warehouse, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.