1"use strict";(self.webpackChunkkubevela_io=self.webpackChunkkubevela_io||[]).push([[3885],{7380:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"how-to/dashboard/config/image-registry","title":"Connect Image Registry","description":"Configure an image registry","source":"@site/versioned_docs/version-v1.9/how-to/dashboard/config/image-registry.md","sourceDirName":"how-to/dashboard/config","slug":"/how-to/dashboard/config/image-registry","permalink":"/docs/v1.9/how-to/dashboard/config/image-registry","draft":false,"unlisted":false,"editUrl":"https://github.com/kubevela/kubevela.io/edit/main/docs/how-to/dashboard/config/image-registry.md","tags":[],"version":"v1.9","lastUpdatedBy":"Vishal Kumar","lastUpdatedAt":1757565849000,"frontMatter":{"title":"Connect Image Registry","description":"Configure an image registry"},"sidebar":"docs","previous":{"title":"Connect Helm Repository","permalink":"/docs/v1.9/how-to/dashboard/config/helm-repo"},"next":{"title":"Read And Write Config In Pipeline","permalink":"/docs/v1.9/how-to/dashboard/config/read-write-config-in-pipeline"}}');var s=i(74848),n=i(28453);const o={title:"Connect Image Registry",description:"Configure an image registry"},a=void 0,c={},l=[{value:"Create an Image Registry config",id:"create-an-image-registry-config",level:2},{value:"Distribute the config",id:"distribute-the-config",level:2},{value:"How to use the image registry",id:"how-to-use-the-image-registry",level:2}];function d(e){const t={a:"a",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,n.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:"In this guide, we will introduce how to create a private image registry and how to create an application whose image locates in the registry."}),"\n",(0,s.jsxs)(t.p,{children:["Check the ",(0,s.jsx)(t.a,{href:"/docs/v1.9/how-to/dashboard/config/config-template",children:"config template"})," is exist with the following command:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"vela config-template list | grep image-registry\n"})}),"\n",(0,s.jsx)(t.h2,{id:"create-an-image-registry-config",children:"Create an Image Registry config"}),"\n",(0,s.jsx)(t.p,{children:"There are two ways to create the config. On the Configs page, you could create the configs that belong to the system scope. Then, the Image registry could be used for all projects. If you only want to use it for one project, let's create the config on the Project summary page."}),"\n",(0,s.jsxs)(t.p,{children:["On the ",(0,s.jsx)(t.code,{children:"Configs/ImageRegistry"})," page, let's create a private image registry with the following fields:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Registry"}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["Your image registry domain, such as ",(0,s.jsx)(t.code,{children:"index.docker.io"}),". Please make sure this domain could be accessed from all cluster nodes."]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Insecure"}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["If your registry server uses the self-signed certificate, you should enable this field. This only means KubeVela could trust your registry. You also need to make sure the ",(0,s.jsx)(t.code,{children:"dockerd"})," or ",(0,s.jsx)(t.code,{children:"containerd"})," in your cluster node trust this registry. refer to: ",(0,s.jsx)(t.a,{href:"https://docs.docker.com/registry/insecure/",children:"Test an insecure registry with docker"}),"."]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"UseHTTP"}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["If your registry with the HTTP protocol to provide the service, you should enable this field. You also need to make sure the ",(0,s.jsx)(t.code,{children:"dockerd"})," or ",(0,s.jsx)(t.code,{children:"containerd"})," in your cluster node trust this registry. refer to: ",(0,s.jsx)(t.a,{href:"https://docs.docker.com/registry/insecure/",children:"Test an insecure registry with docker"}),"."]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Auth"}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"If your registry needs authentication, you need must set the username and password. KubeVela will generate the secret and distribute it to all cluster
1s."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://kubevela.io/images/1.4/create-image-registry.jpg",alt:"config"})}),"\n",(0,s.jsx)(t.p,{children:"Also, we could create the image registry config via CLI:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"vela config create <Config Name> -t image-registry registry=<Registry Domain>\n"})}),"\n",(0,s.jsx)(t.p,{children:"List all Image registries:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"vela config list -t image-registry\n"})}),"\n",(0,s.jsx)(t.h2,{id:"distribute-the-config",children:"Distribute the config"}),"\n",(0,s.jsxs)(t.p,{children:["After creating a config, it only saves as a Secret in the system namespace in the hub cluster. But the application will generate the Workload resource that depends on this Secret which type is ",(0,s.jsx)(t.code,{children:"kubernetes.io/dockerconfigjson"}),". So, we should distribute the Secret to all namespaces that we could use and include managed clusters. The config distribution could help you."]}),"\n",(0,s.jsx)(t.p,{children:"Let's go to the project summary page for which you want to create the Application."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://kubevela.io/images/1.6/project-summary.jpg",alt:"project summary"})}),"\n",(0,s.jsxs)(t.p,{children:["Click the ",(0,s.jsx)(t.code,{children:"Distribute"})," button and select the targets that you want to distribute the config."]}),"\n",(0,s.jsx)(t.p,{children:"Also, you could distribute the config via CLI:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-bash",children:"vela config distribute <Config Name> --target <cluster/namespace>\n"})}),"\n",(0,s.jsx)(t.h2,{id:"how-to-use-the-image-registry",children:"How to use the image registry"}),"\n",(0,s.jsxs)(t.p,{children:["Let's follow the ",(0,s.jsx)(t.a,{href:"/docs/v1.9/tutorials/webservice",children:"Deploy Container Image"})," to create an application. After you input the image name, KubeVela will automatically identify the matched registries."]})]})}function h(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},28453:(e,t,i)=>{i.d(t,{R:()=>o,x:()=>a});var r=i(96540);const s={},n=r.createContext(s);function o(e){const t=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(n.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.