text: (window.webpackJsonp=window.webpackJsonp||[]).push([[82],{BAC9:function(e,t,a){e.exports={bxTextTruncateEnd:"EditLink-module--bx--text-truncate--end--2pqje",bxTextTruncateFront:"EditLink-module--bx--text-truncate--front--3_lIE",link:"EditLink-module--link--1qzW3",row:"EditLink-module--row--1B9Gk"}},I8xM:function(e,t,a){e.exports={bxTextTruncateEnd:"PageTabs-module--bx--text-truncate--end--267NA",bxTextTruncateFront:"PageTabs-module--bx--text-truncate--front--3xEQF",tabsContainer:"PageTabs-module--tabs-container--8N4k0",list:"PageTabs-module--list--3eFQc",listItem:"PageTabs-module--list-item--nUmtD",link:"PageTabs-module--link--1mDJ1",selectedItem:"PageTabs-module--selected-item--YPVr3"}},QH2O:function(e,t,a){e.exports={bxTextTruncateEnd:"PageHeader-module--bx--text-truncate--end--mZWeX",bxTextTruncateFront:"PageHeader-module--bx--text-truncate--front--3zvrI",pageHeader:"PageHeader-module--page-header--3hIan",darkMode:"PageHeader-module--dark-mode--hBrwL",withTabs:"PageHeader-module--with-tabs--3nKxA",text:"PageHeader-module--text--o9LFq"}},XbGe:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),i=a("NmYn"),o=a.n(i),c=a("Wbzz"),l=a("Xrax"),b=a("k4MR"),s=a("TSYQ"),p=a.n(s),m=a("QH2O"),d=a.n(m),u=a("qKvR"),g=function(e){var t,a=e.title,n=e.theme,r=e.tabs,i=void 0===r?[]:r;return Object(u.b)("div",{className:p()(d.a.pageHeader,(t={},t[d.a.withTabs]=i.length,t[d.a.darkMode]="dark"===n,t))},Object(u.b)("div",{className:"bx--grid"},Object(u.b)("div",{className:"bx--row"},Object(u.b)("div",{className:"bx--col-lg-12"},Object(u.b)("h1",{id:"page-title",className:d.a.text},a)))))},O=a("BAC9"),h=function(e){var t=e.relativePagePath,a=e.repository,n=Object(c.useStaticQuery)("1364590287").site.siteMetadata.repository,r=a||n,i=r.baseUrl,o=r.subDirectory,l=i+"/edit/"+r.branch+o+"/src/pages"+t;return i?Object(u.b)("div",{className:"bx--row "+O.row},Object(u.b)("div",{className:"bx--col"},Object(u.b)("a",{className:O.link,href:l},"Edit this page on GitHub"))):null},j=a("dI71"),N=a("I8xM"),f=function(e){function t(){return e.apply(this,arguments)||this}return Object(j.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.tabs,a=e.slug,n=a.split("/").filter(Boolean).slice(-1)[0],r=t.map((function(e){var t,r=o()(e,{lower:!0,strict:!0}),i=r===n,l=new RegExp(n+"/?(#.*)?$"),b=a.replace(l,r);return Object(u.b)("li",{key:e,className:p()((t={},t[N.selectedItem]=i,t),N.listItem)},Object(u.b)(c.Link,{className:N.link,to:""+b},e))}));return Object(u.b)("div",{className:N.tabsContainer},Object(u.b)("div",{className:"bx--grid"},Object(u.b)("div",{className:"bx--row"},Object(u.b)("div",{className:"bx--col-lg-12 bx--col-no-gutter"},Object(u.b)("nav",null,Object(u.b)("ul",{className:N.list},r))))))},t}(r.a.Component),v=a("MjG9"),x=a("CzIb");t.a=function(e){var t=e.pageContext,a=e.children,n=e.location,r=e.Title,i=t.frontmatter,s=void 0===i?{}:i,p=t.relativePagePath,m=t.titleType,d=s.tabs,O=s.title,j=s.theme,N=s.description,y=s.keywords,C=Object(x.a)().interiorTheme,T=Object(c.useStaticQuery)("223705900").site.pathPrefix,w=T?n.pathname.replace(T,""):n.pathname,k=d?w.split("/").filter(Boolean).slice(-1)[0]||o()(d[0],{lower:!0}):"",A=j||C;return Object(u.b)(b.a,{tabs:d,homepage:!1,theme:A,pageTitle:O,pageDescription:N,pageKeywords:y,titleType:m},Object(u.b)(g,{title:r?Object(u.b)(r,null):O,label:"label",tabs:d,theme:A}),d&&Object(u.b)(f,{slug:w,tabs:d,currentTab:k}),Object(u.b)(v.a,{padded:!0},a,Object(u.b)(h,{relativePagePath:p})),Object(u.b)(l.a,null))}},mNDL:function(e,t,a){"use strict";a.r(t),a.d(t,"_frontmatter",(function(){return b})),a.d(t,"default",(function(){return d}));var n,r=a("wx14"),i=a("zLVn"),o=(a("q1tI"),a("7ljp")),c=a("XbGe"),l=a("T0C+"),b=(a("qKvR"),{}),s=(n="PageDescription",function(e){return console.warn("Component "+n+" was not imported, exported, or provided by MDXProvider as global scope"),Object(o.b)("div",e)}),p={_frontmatter:b},m=c.a;function d(e){var t=e.components,a=Object(i.a)(e,["components"]);return Object(o.b)(m,Object(r.a)({},p,a,{components:t,mdxType:"MDXLayout"}),Object(o.b)(s,{mdxType:"PageDescription"},Object(o.b)("p",null,Object(o.b)("em",{parentName:"p"},"This is a work in progress, come back for updates.")),Object(o.b)("p",null,"Steps to install the ",Object(o.b)(l.a,{name:"shortName",mdxType:"Globals"})," in an existing OpenShift cluster using a declarative approach with ArgoCD.")),Object(o.b)("h2",null,"Pre-requisites"),Object(o.b)("p",null,"The following is required before proceeding to the next section."),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Provision an OpenShift cluster."),Object(o.b)("li",{parentName:"ul"},"Install the ",Object(o.b)("inlineCode",{parentName:"li"},"oc")," and ",Object(o.b)("inlineCode",{parentName:"li"},"git")," cli."),Object(o.b)("li",{parentName:"ul"},"Install the ",Object(o.b)("a",{parentName:"li",href:"https://cloudnativetoolkit.dev/getting-started/cli"},"Cloud Native Toolkit CLI"),".")),Object(o.b)("hr",null),Object(o.b)("h2",null,"Installation"),Object(o.b)("ol",null,Object(o.b)("li",{parentName:"ol"},Object(o.b)("p",{parentName:"li"},"Fork the ",Object(o.b)("a",{parentName:"p",href:"https://github.com/cloud-native-toolkit/multi-tenancy-gitops"},"multi-tenancy-gitops")," repository and clone your fork."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-shell",metastring:"script",script:!0},"git clone git@github.com:{gitorg}/multi-tenancy-gitops.git\n\ncd multi-tenancy-gitops\n"))),Object(o.b)("li",{parentName:"ol"},Object(o.b)("p",{parentName:"li"},"Update the cloned repository with your GitHub Organization."))),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Search and replace all instances of ",Object(o.b)("inlineCode",{parentName:"li"},"github.com/cloud-native-toolkit/multi-tenancy-gitops.git")," with ",Object(o.b)("inlineCode",{parentName:"li"},"github.com/{gitorg}/multi-tenancy-gitops.git"),"."),Object(o.b)("li",{parentName:"ul"},"Commit and push your changes to your fork.",Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre"},'git commit -m "Update github organization"\ngit push origin master\n')))),Object(o.b)("ol",{start:3},Object(o.b)("li",{parentName:"ol"},"The gitops repository is structured into different layers (ie. ",Object(o.b)("inlineCode",{parentName:"li"},"1-apps"),", ",Object(o.b)("inlineCode",{parentName:"li"},"2-services"),", ",Object(o.b)("inlineCode",{parentName:"li"},"3-infra"),").  Each layer is structured in a similar pattern consisting of the following:")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"The ",Object(o.b)("inlineCode",{parentName:"p"},"argocd")," folder contains a set of ArgoCD Application YAMLs.")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"The set of folder(s) in each layer contains the resource YAMLs which will be deployed."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre"},"tree . -L 2\n.\n├── 0-bootstrap\n│   └── argocd\n├── 1-apps\n│   ├── argocd\n│   └── instances\n├── 2-services\n│   ├── argocd\n│   ├── instances\n│   └── operators\n├── 3-infra\n│   ├── argocd\n│   ├── clusterrole\n│   ├── consolelink\n│   ├── consolenotification\n│   └── namespaces\n├── 4-rhacm\n│   └── argocd\n├── README.md\n└── bootstrap.yaml\n"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"Each ",Object(o.b)("inlineCode",{parentName:"p"},"argocd")," folder contains an ",Object(o.b)("inlineCode",{parentName:"p"},"active")," and ",Object(o.b)("inlineCode",{parentName:"p"},"inactive")," sub-folder.  For each layer, select the ArgoCD Appliation YAMLs to deploy and move them into the ",Object(o.b)("inlineCode",{parentName:"p"},"active")," folder."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre"},"1-apps/argocd/\n├── active\n└── inactive\n\n2-services/argocd/\n├── active\n└── inactive\n\n3-infra/argocd/\n├── active\n└── inactive\n"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"Commit and push your changes to your fork."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre"},'git commit -m "Update github organization"\ngit push origin master\n')))),Object(o.b)("ol",{start:4},Object(o.b)("li",{parentName:"ol"},"Install the Red Hat OpenShift GitOps operator using the commands below or directly from the OpenShift Web Console.  An instance of ArgoCD will automatically be created in the ",Object(o.b)("inlineCode",{parentName:"li"},"openshift-gitops")," namespace.",Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-shell",metastring:"script",script:!0},"oc apply -f 2-services/operators/openshift-gitops/ -n openshift-operators\n")))),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"Verify you can log on to the ArgoCD Web Console."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre"},"# ArgoCD Web Console URL\necho https://$(oc get route argocd-cluster-server -o jsonpath='{ .spec.host }' -n openshift-gitops)\n\n# Admin password\noc extract secret/argocd-cluster-cluster --to=- -n openshift-gitops\n")))),Object(o.b)("ol",{start:5},Object(o.b)("li",{parentName:"ol"},Object(o.b)("p",{parentName:"li"},"Review and apply the custom ClusterRole permissions to the ArgoCD Application Controller service account.  This is required for ArgoCD to create the required Kubernetes resources in target namespaces."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-shell",metastring:"script",script:!0},"oc apply -f 3-infra/clusterrole/\n"))),Object(o.b)("li",{parentName:"ol"},Object(o.b)("p",{parentName:"li"},"Create the bootstrap ArgoCD application."),Object(o.b)("p",{parentName:"li"}," The bootstrap application will create the parent ArgoCD Application for each layer (YAMLs are located in ",Object(o.b)("inlineCode",{parentName:"p"},"0-bootstrap")," folder).\nThe parent ArgoCD Applications will subsequently create the ArgoCD Applications in the ",Object(o.b)("inlineCode",{parentName:"p"},"/argocd/active")," directory."),Object(o.b)("p",{parentName:"li"}," Depending on what resources have been selected, it will take some time for the ArgoCD to deploy the resources."),Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-shell",metastring:"script",script:!0},"oc apply -f bootstrap.yaml -n openshift-gitops\n"))),Object(o.b)("li",{parentName:"ol"},Object(o.b)("p",{parentName:"li"},"From the OpenShift Web Console, verify the resources (ie, operators, namespaces, etc) have been successfully created and/or deployed."))))}d.isMDXComponent=!0}}]);
  //# sourceMappingURL=component---src-pages-learning-gitops-int-gitops-with-cloud-native-toolkit-mdx-56447212dc37c90912f2.js.map