Pull Image from Private Docker Registry in Kubernetes cluster | Demo

  Рет қаралды 92,889

TechWorld with Nana

TechWorld with Nana

Күн бұрын

This video is a demo of deploying your application image from private docker registry hosted on AWS | Kubernetes pull image from private registry | Kubernetes Docker login
I answer the question of how to get your docker images in your kubernetes cluster from private docker registries?
For images like Mongodb, elastic, that are hosted on docker hub, it’s straightforward because they are hosted in a public repository and anyone can access them. But your own application lives in a private repository and needs explicit access from the cluster. So how do you pull the application images from your private docker repository on kubernetes cluster?
You do that using 2 steps:
1) you create a secret component that contains access token/credentials to your docker registry.
2) you configure your Deployment component to use that secret using a specific imagePullSecrets.
In the video I show you exactly this.
► CLI Commands and YAML Files for this video: gitlab.com/nanuchi/kubernetes...
► Demo Nodejs app: gitlab.com/nanuchi/techworld-...
▬▬▬▬▬▬ T I M E S T A M P S
0:00 - Intro - common workflow
1:11 - Steps to pull image from private registry
1:40 - Environment Setup: Private Registry, Application, Minikube
2:42 - Login to AWS Container Repository | docker login and create docker config.json file
8:20 - Create Secret component
15:45 - Configure Deployment component
20:51 - Summary
-------------------------------------------------------------------------------------------------------
Full Kubernetes and Docker tutorial ► bit.ly/2YGeRp9
DevOps Tools, like Ansible ► bit.ly/2W9UEq6
Complete K8s Application Setup ► • Complete Application D...
Kubernetes Components explained ► • Kubernetes Components ...
For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible. Also please let me know what you want to learn about Docker & Kubernetes or another technology.
#kubernetes #kubernetestutorial #devops #techworldwithnana
-------------------------------------------------------------------------------------------------------
▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
Join private Facebook group ► bit.ly/32UVSZP
Don't forget to subscribe ► bit.ly/3mO4jxT
DEV ► bit.ly/3h2fqiO
INSTAGRAM ► bit.ly/2F3LXYJ
TWITTER ► bit.ly/3i54PUB
LINKEDIN ► bit.ly/3hWOLVT
Legal Notice:
Kubernetes and the Kubernetes logo are trademarks or registered trademarks of The Linux Foundation in the United States and/or other countries. The Linux Foundation and other parties may also have trademark rights in other terms used herein. This video is not accredited, certified, affiliated with, nor endorsed by Kubernetes or The Linux Foundation.

Пікірлер: 94
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
► CLI Commands and YAML Files for this video: gitlab.com/nanuchi/kubernetes-tutorial-series-youtube/-/tree/master/pull-images-from-private-reporsitory-in-k8s ► Demo Nodejs app: gitlab.com/nanuchi/techworld-js-docker-demo-app ▬▬▬▬▬▬ T I M E S T A M P S 0:00 - Intro - common workflow 1:11 - Steps to pull image from private registry 1:40 - Environment Setup: Private Registry, Application, Minikube 2:42 - Login to AWS Container Repository | docker login and create docker config.json file 8:20 - Create Secret component 15:45 - Configure Deployment component 20:51 - Summary 👉🏼 For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible. Please don't forget to subscribe and give me a thumbs up if you liked my video 😊🙏
@tayfun6378
@tayfun6378 3 жыл бұрын
I merged this with Ansible and it worked like a charm! Thank you for saving my week!
@meetalideshmukh6889
@meetalideshmukh6889 2 жыл бұрын
You are my inspiration. My idol in women in tech. Your dedication motivates me and help me work even harder towards my goal. Thanks for being the way you are and Ganesha bless you to inspire many more knowledge seeker like me!
@shafiqruslan1661
@shafiqruslan1661 4 жыл бұрын
Hi Nana, keep up the good work. Your explanation about k8s is the most understandable that I can found on youtube. Thanks ya.
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Wow thanks for your feedback! Will continue for sure :)
@carolinaluz6736
@carolinaluz6736 3 жыл бұрын
You are amazing! thanks to this video I was able to make the gitlab private registry work with the config.json method. Thank you
@marioazevedo1428
@marioazevedo1428 3 жыл бұрын
Nana, just to let you know: I was facing an issue when trying to pull a image from a private dockerhub repo. I did this in an Openshift 4.3 cluster (not mine, it is a private cluster from the company I work for) exactly how you showed in the video and it works fine! Fun fact: I found your video without even looking for it haha. I'm already subscribed, I won't dare to miss a video from now on!
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
This warms my heart Mario. Thank you for the support. Will do my best to help and share my experiences as well as best practices. Keep safe. 😇
@AlvaroAlbuq
@AlvaroAlbuq 4 жыл бұрын
Hello, this video helps me to work on a project of my company, which I spent days of difficulty creating alone, thanks for sharing your knowledge!
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Hi Alvaro, happy to hear! :) When people learn from my videos that's already cool but when they also help in real projects that's even better :)
@word8word
@word8word 2 жыл бұрын
thank you for this video, it helped me a lot with some errors i had and was unable to fix them till i watched and followed your instructions. Thank you again.
@robl39
@robl39 3 жыл бұрын
Thanks for the great video! This does seem like an overly complicated process in general. But thank you for making this.
@adilsonmenechini4876
@adilsonmenechini4876 3 жыл бұрын
Continue to be that wonderful person. Thank you very much for sharing the knowledge :D
@hidayatirnas5882
@hidayatirnas5882 3 жыл бұрын
What a great explanation, subscribed already!!
@tanyananda9867
@tanyananda9867 4 жыл бұрын
Hi Nana, I have been following your video series. I must say you explain concepts with great ease. It gets in the head very easily. Keep up the good work!! Can you also upload a video explaining various service types and their use-cases? and also how to secure and monitor K8S cluster.. I'll be waiting for it:) Thanks Nana in advance. Keep posting new videos:)
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Thank you so much Tanya! Happy to hear that my videos are so helpful for you :) Yes, I actually already planned to do a separate video about Service component covering various service types. 🙂 Will come in next few weeks. Also thank you for the other suggestions! 👍:)
@1377sv
@1377sv 4 жыл бұрын
Been waiting for this..Thank you
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
That's great, hope you liked it :)
@ayencoscolfield3312
@ayencoscolfield3312 2 жыл бұрын
Nice one nana another top delivery from you as always, please would love to see you do videos on how to ensure security of containerized apps in kubernetes and how to optimized kubernetes cluster operations, thanks please keep up the good work
@way2science767
@way2science767 2 жыл бұрын
Your videos really help! Thanks Nana
@rezakaramad
@rezakaramad Жыл бұрын
Just as a short feedback: really enjoyed, handy, well done! (like always)
@manish436
@manish436 2 жыл бұрын
Thank you Nana that was really very helpful.
@ashishkhkh
@ashishkhkh 2 жыл бұрын
This is the video I was looking for to create secret in Openshift
@sptrivedi1989
@sptrivedi1989 2 жыл бұрын
Thanks a lot for sharing your valuable knowledge 🙏
@kamalzakaria6374
@kamalzakaria6374 2 жыл бұрын
i love your tutorials!
@promisepreston
@promisepreston 3 жыл бұрын
Thank you for this amazing video
@v-bro6954
@v-bro6954 Жыл бұрын
Thank you very much )). Very clear
@dhavalshah222
@dhavalshah222 3 жыл бұрын
your videos are awesome...!!!! keep doing the good work .......please add some more videos on kubernetes
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thanks Dhaval :) I will continue creating videos on K8s. Next one will be about Kubernetes Operators :)
@tannercampbell
@tannercampbell 2 жыл бұрын
This was great help!
@Amapramaadhy
@Amapramaadhy 3 жыл бұрын
Amazing content as always. How do you deal with the case that the ECR logging typically expires after N hours. What’s the recommended practice in that case. Run a cron to update the configmap?
@swathi8114
@swathi8114 Жыл бұрын
Thanks for a great video nice explain thankyou for this vedio
@rameshpattipaka9901
@rameshpattipaka9901 3 жыл бұрын
Thanks.. Clear explanation
@sonuraam
@sonuraam 3 жыл бұрын
Hi Nana,your videos are great and easy to follow. Is there any video on how to deploy mongoDB statefulset ?
@natheesh
@natheesh 2 жыл бұрын
Love you Nana :)
@aalang
@aalang 2 жыл бұрын
Big fan of your channel and I recommend it to everyone. Your instructions for this are good, but how does this all change when not using Docker for the runtime (the supported containerd for example)? I've been having a heck of a time trying to find comparable instructions for ECR and containerd.
@hamidja1537
@hamidja1537 Жыл бұрын
Thanks for sharing
@mammothas
@mammothas 3 жыл бұрын
You know that you are the light in the dark!
@LieberLois
@LieberLois 4 жыл бұрын
Damn your videos are just ... sooo good! One question: how detailed would you recommend software developers to learn this? Im very very interested in DevOps but for me personally i dont get to use it as much as i would love to. And when I do, i just look the necessary stuff up over night! Any recommendations? I love Kubernetes, but for personal projects, its way too much ... always using compose ._.
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Hi Luis. Thank you 🙏 to your question: K8s has 2 parts. one is k8s administration, like setting up the cluster, setting up storage, maintaining the cluster etc and second is the the actual usage, like deploying applications inside the cluster. So as a developer, you actually only need to know the second, how to deploy the applications inside the prepared cluster. For quick setup, you can always use managed k8s service from cloud providers. Does this answer your question?
@bence6978
@bence6978 3 жыл бұрын
this is way more complex that I tought
@mohammedsuhailbasha4860
@mohammedsuhailbasha4860 4 жыл бұрын
Very nice explaination thank you so much.please make and upload videos on statefulsets, service discovery and pod security policy.
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Hi Mohammed, statefulsets will come next on Saturday, so stay tuned :) Also thanks for the other suggestions!
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
And btw I'm hosting a LIVE webinar on how to Deploy Elasticsearch StatefulSet and Kibana with Helm on a cloud platform, if you're interested: bit.ly/2TWbxU0
@kieran7741
@kieran7741 4 жыл бұрын
Brilliant content 👌🏻
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Thank you Kieran! :)
@shridharshah2243
@shridharshah2243 3 жыл бұрын
The dockerconfigjson expires every 12 hours, how should we make changes in the secrets so that the we can create deployment without making any changes?
@eleonoramendy
@eleonoramendy 3 жыл бұрын
Thank you.
@nishant7005
@nishant7005 3 жыл бұрын
instead of pull, can we make a push? basically automatic deployment on code push. is it good practice? if yes, then how to trigger k8 for pull? My guess: runner script should login in k8 and perform apply command. Nana, what you think?
@ademahmudf
@ademahmudf 4 жыл бұрын
Hi Nana, I really like your videos, thanks for making it. I have a question, in some tutorials, a new service account is always created for each deployment, why should that be? and what service account for in that case ? thank you :)
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Service Account is like a user in k8s. For example, when you deploy a Prometheus stack, you will see service account/s get created. The reason is so that you have a prometheus "user" with permission to manage and change only prometheus stack applications. Is it understandable?
@abduchadili5691
@abduchadili5691 3 жыл бұрын
What about local docker registry on your local machine. I mean if you spin up a registry:2 container for example that will act as your private local registry. The same steps apply? Thanks
@adamdost7573
@adamdost7573 3 жыл бұрын
Nice subscribed
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
👍
@hcervantes
@hcervantes Жыл бұрын
Thanks for the tutorial. I have a local private Docker repo that is not running on https. How can I make it work for http Docker? Kube automatically looks for https.
@chandnigoyal6188
@chandnigoyal6188 4 жыл бұрын
Hi Nana I need your help in helm charts. In file job.yaml, the first line is {{- $root := . -}}. The := is assignment operator but what does . - after assignment operator means? and whats its use in image: {{ $root.Values.repository }}/nginx:{{ $root.Values.tag }}. Why we taking $root variable?
@MuhammedDahab
@MuhammedDahab 4 жыл бұрын
thank ms Nana for the great videos , I have a question , did you say that you 'll make a videos in AWS ?! , it gonna be awesome ,I can't wait , thank you
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Yes I will cover AWS for sure in the future, stay tuned :)
@MuhammedDahab
@MuhammedDahab 3 жыл бұрын
@@TechWorldwithNana wow that's a great news to hear about it , thank you ♥♥
@brucejheison
@brucejheison 3 жыл бұрын
@@TechWorldwithNana how about azure ?
@wenjinsitu3822
@wenjinsitu3822 Жыл бұрын
can you just provide one docker credential in the secret and apply it to multiple clusters (EKS) and regions? Is there rate limit for docker login as well?
@rukhem
@rukhem 11 ай бұрын
Thanks
@fathimat9675
@fathimat9675 10 ай бұрын
Hi, what if i modify the image and pushed into container registry again with the same tag,after that if i need to deploy that image to the cluster what needs to do
@gsk719111
@gsk719111 4 жыл бұрын
Hi Nana, I have a application which is provided by my client and that has to go through K8S using Helm Upgrade and install command . but i am facing some issues. can you show us one demo with Helm 2 or 3 for deploying any private application into K8S , first i want to do it by manually using helm and after wards we want to go through gitlab registry. so if possible show us how to do it from gitlab also.
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Great suggestion! I think it's an interesting use case. I'm preparing helm demo, so will use your case as one of the examples! Thanks!
@ashok1929
@ashok1929 4 жыл бұрын
Hey Nana, I've been watching your videos on kubernetes and those are very informative and understandable ones. Actually i am learning kubernetes to integrate spark on kubernetes. I found few articles on the internet but those weren't that helpful and full of errors. Could you please prepare a demo regarding how to deploy spark image on kubernetes? Its a humble request.. Thank you. Love from india 🇮🇳❤️❤️🙂
@TechWorldwithNana
@TechWorldwithNana 4 жыл бұрын
Thank you Ashok, glad you think so! Also thanks for your suggestion, can't promise but took a note :)
@vinodhreddy6227
@vinodhreddy6227 4 жыл бұрын
I have a issue... I have three Ubuntu servers and I have 12 microservices. One server I created 4 services. One server one compose I configured four services.. I run I'm able register eureka all servixes... Zull gateway I can able to access fst servers but remaining I'm not able to access based on serviceId... Can I tell me where I done mistake
@atulchahande4966
@atulchahande4966 3 жыл бұрын
how to configure certificates in minikube x509: certificate signed by unknown authority
@user-zq4hn4gv8t
@user-zq4hn4gv8t Ай бұрын
I did same with you but it didn’t work well :( Secrets and pods are in the same namespace and I wrote imagePullSecrets as well. And each node ( master, worker nodes ) can pull and push images from private registry. But it didn’t work well when i tried to make k8s components like pods Any ideas ?
@Prashant-ig1ny
@Prashant-ig1ny 2 жыл бұрын
I am getting an error in k8s cluster saying the "Container image "image/name:v1" already present on machine. How can I delete that image ?
@akshayawate7239
@akshayawate7239 3 жыл бұрын
Please can you make videos on harbor?
@bhupathivarma9170
@bhupathivarma9170 3 жыл бұрын
Please make video to upgrade certificate in k8s cluster
@paolopolendey146
@paolopolendey146 3 жыл бұрын
Hello. How will I make Kubernetes automatically pull an image from the private repository if there has been a new image available? 😊 thanks in advance.
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Hi Paolo. In Pod configuration you can add an attribute called: "ImagePullPolicy: Always" This will make k8s/docker pull the image every time the pod restarts, no matter whether the tag is "latest" or fixated. Does this answer your question?
@paolopolendey146
@paolopolendey146 3 жыл бұрын
@@TechWorldwithNana - actually i needed to automate deleting of pod each time a new image is available to initiate a pull from the private docker repository. Is there such a way? Thank you!!
@paolopolendey146
@paolopolendey146 3 жыл бұрын
@@TechWorldwithNana got my answer now. Just need to put in the deploy job :) thanks so much for taking time to look into my inquiry!
@ecesagar
@ecesagar 2 жыл бұрын
Hello @nana, can i download a images from one private docker registry as tar bundle and push it to another private registry with rest api or curl ? can you pls support here
@mariochristopher2870
@mariochristopher2870 3 жыл бұрын
Hi Nana, Excellent tutorials. Thank you. I've created a Private Registry for my local development using Docker's Image : "docker run -d -p 5000:5000 --restart=always --name registry registry:2" I did not create TLS or UserName/Pwdd for this. After creating an Image, I am able to push/pull from this Registry using cmd-line. However, when trying using a Deployment.yaml into minikube, the Pods are not getting created. and I get this error: Failed to pull image "": rpc error: code = Unknown desc = Error response from daemon: Get /v2/: http: server gave HTTP response to HTTPS client Do I have to create TLC and Username/Pwd for this to work ? Thanks.
@mnbvcxzzxcvbnm
@mnbvcxzzxcvbnm 3 жыл бұрын
Can we assign one secret for pulling images in all namesapces ?
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
You will have to create the same secret in each namespace, because secret is only visible for pods in the same namespace.
@lowtech1479
@lowtech1479 3 жыл бұрын
Is this somehow the command is changed. I couldn't find the "get-login" from ecr command, just get-login-password.
@gsk719111
@gsk719111 4 жыл бұрын
Can you show me how to pull from gitlab ?
@SamiKhammar
@SamiKhammar 3 жыл бұрын
i did exactly the same and i'm getting this error when i describe the pod: Failed to pull image "registry.gitlab.com/###/###:master": rpc error: code = Unknown desc = Error response from daemon: Get registry.gitlab.com/......" denied: access forbidden i created a GitLab "Deploy token" then created a Secret using your 2nd method (one line way.) , when i use same token in simple Minkube's docker login , i m able to pull the image normally. but when i use kubectl, it's not able to pull it and getting "access forbidden" error. Ps: everything in same namespace
@1computer
@1computer 3 жыл бұрын
And with Podman?
@wisnusetiawan4830
@wisnusetiawan4830 Жыл бұрын
repository does not exist or may require 'docker login': denied: Your authorization token has expired. Reauthenticate and try again.
@razahuss339
@razahuss339 2 жыл бұрын
Does the login password have a TTL?
@kedarnathbelavanaki4160
@kedarnathbelavanaki4160 3 жыл бұрын
Hello Nana, How Kubernetes pull the images from private local docker registry. Could please comment on the same how can we achieve this using private local docker registry in Kubernetes cluster. Link for setting up private registry: docs.docker.com/registry/ NOTE: Not on Mimikube
@jeromequentin777
@jeromequentin777 4 жыл бұрын
Little bit confusing Nana..
@dp01
@dp01 2 жыл бұрын
I am stucked at minute 7:26 when you run the docker login command from within Minikube (after you do minikube ssh). I am not using an AWS registry but rather a Nexus OSS in my host machine on port 8082. When I run the docker login command from within minikube as follows: docker login host.minikube.internal:8082 hit enter and in the prompt for user name and password I enter those I get the following error: Error response from daemon: Get "host.minikube.internal:8082/v2/": http server gave http response to HTTPS client. I have tried starting my minikube with (and different version of that with in front): minikube start --driver=docker --insecure-registry=host.minikube.internal:8082 and I still get the same error. It is really frustrating. Anyone know how do I get passed that?
Kubernetes StatefulSet simply explained | Deployment vs StatefulSet
16:00
TechWorld with Nana
Рет қаралды 221 М.
КАКОЙ ВАШ ЛЮБИМЫЙ ЦВЕТ?😍 #game #shorts
00:17
New Gadgets! Bycycle 4.0 🚲 #shorts
00:14
BongBee Family
Рет қаралды 9 МЛН
[ Kube 69 ] Using Private Docker Registry in Kubernetes
30:58
Just me and Opensource
Рет қаралды 29 М.
Kubernetes Crash Course for Absolute Beginners [NEW]
1:12:04
TechWorld with Nana
Рет қаралды 2,5 МЛН
Docker Crash Course for Absolute Beginners [NEW]
1:07:39
TechWorld with Nana
Рет қаралды 1,4 МЛН
Most Common Kubernetes Deployment Strategies (Examples & Code)
20:06
How to use  NGINX Ingress with Kubernetes in 2023
38:32
That DevOps Guy
Рет қаралды 63 М.
КАКОЙ ВАШ ЛЮБИМЫЙ ЦВЕТ?😍 #game #shorts
00:17