-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sync workshop and gitops content Signed-off-by: Carlos Santana <[email protected]> * remove submodule Signed-off-by: Carlos Santana <[email protected]> * fix spell check Signed-off-by: Carlos Santana <[email protected]> * add EOL build.sh Signed-off-by: Carlos Santana <[email protected]> * add redirect for argocd docs Signed-off-by: Carlos Santana <[email protected]>
- Loading branch information
Carlos Santana
authored
May 26, 2021
1 parent
e283db1
commit dded3e3
Showing
34 changed files
with
606 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
|
||
cspell docs/**/*.md | ||
mkdocs build | ||
cspell docs/**/**/*.md | ||
mkdocs build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
# Install App Connect on an existing cluster using GitOps | ||
|
||
_This is a work in progress, come back for updates._ | ||
|
||
Steps to install App Connect in an existing cluster using ArgoCD. | ||
|
||
## Pre-requisites | ||
The following is required before proceeding to the next section. | ||
|
||
- Provision an OpenShift cluster. | ||
- IBM Cloud Pak Entitlement Key | ||
|
||
|
||
## Installation | ||
1. Fork the [multi-tenancy-gitops](https://github.com/cloud-native-toolkit/multi-tenancy-gitops) repository and clone your fork. | ||
```bash | ||
git clone [email protected]:{gitid}/multi-tenancy-gitops.git | ||
``` | ||
|
||
1. Install the Red Hat OpenShift GitOps operator. | ||
```bash | ||
cd multi-tenancy-gitops | ||
oc apply -f 2-services/operators/openshift-gitops/ | ||
``` | ||
|
||
1. Update your repository to reference your forked repository. Search and replace `cloud-native-toolkit` GithUb Org references with your {gitid}. | ||
|
||
1. Create the bootstrap ArgoCD application. | ||
```bash | ||
oc apply -f bootstrap.yaml -n openshift-gitops | ||
``` | ||
|
||
1. Generate an encrypted Secret containing the IBM Entitlement Key using Sealed Secret Operator. | ||
- Install [kubeseal](https://github.com/bitnami-labs/sealed-secrets/blob/main/README.md) CLI. | ||
- Encrypt IBM Entitlement Key Secret. | ||
```bash | ||
NAMESPACE=tools | ||
IBM_ENTITLEMENT_KEY=<Entitlement Key> | ||
# Create Secret YAML containing Entitlement Key | ||
oc create secret docker-registry ibm-entitlement-key \ | ||
--docker-username=cp \ | ||
--docker-server=cp.icr.io \ | ||
--docker-password=${IBM_ENTITLEMENT_KEY} \ | ||
--namespace=${NAMESPACE} \ | ||
--dry-run=true -o yaml > delete-ibm-entitled-key-secret.yaml | ||
# Encrypt the secret using kubeseal and private key from the cluster | ||
kubeseal -n ${NAMESPACE} --controller-name=sealedsecretcontroller-sealed-secrets --controller-namespace=sealed-secrets -o yaml < delete-ibm-entitled-key-secret.yaml > ibm-entitled-key-secret.yaml | ||
``` | ||
|
||
1. Apply the yaml manually or add to your gitops git repo to be deploy via ArgoCD. | ||
```bash | ||
oc apply -f enc-ibm-entitled-key-secret.yaml | ||
``` | ||
|
||
1. Verify the infrastructure and cluster wide resources under the `3-infra` folder are created successfully. | ||
```bash | ||
3-infra/ | ||
├── argocd-apps | ||
│ ├── consolelink.yaml | ||
│ ├── consolenotification.yaml | ||
│ ├── namespace-ci.yaml | ||
│ ├── namespace-dev.yaml | ||
│ ├── namespace-istio-system.yaml | ||
│ ├── namespace-openldap.yaml | ||
│ ├── namespace-qa.yaml | ||
│ ├── namespace-sealed-secrets.yaml | ||
│ ├── namespace-staging.yaml | ||
│ └── namespace-tools.yaml | ||
├── consolelink | ||
│ └── consolelink.yaml | ||
├── consolenotification | ||
│ └── consolenotification.yaml | ||
└── namespaces | ||
├── ci | ||
│ ├── namespace.yaml | ||
│ └── rolebinding.yaml | ||
├── dev | ||
│ └── namespace.yaml | ||
├── istio-system | ||
│ └── namespace.yaml | ||
├── openldap | ||
│ └── namespace.yaml | ||
├── qa | ||
│ └── namespace.yaml | ||
├── sealed-secrets | ||
│ ├── namespace.yaml | ||
│ └── operatorgroup.yaml | ||
├── staging | ||
│ └── namespace.yaml | ||
└── tools | ||
├── namespace.yaml | ||
└── operatorgroup.yaml | ||
``` | ||
{.center} | ||
|
||
1. Verify the operators and instances of custom resource definitions under the `2-services` folder are created successfully. | ||
```bash | ||
2-services/ | ||
├── active | ||
│ ├── instances | ||
│ │ └── argocd | ||
│ └── operators | ||
│ └── argocd | ||
└── inactive | ||
├── instances | ||
│ ├── argocd | ||
│ │ ├── artifactory.yaml | ||
│ │ ├── cert-manager-instance.yaml | ||
│ │ ├── cntk-pipeline-tasks.yaml | ||
│ │ ├── developer-dashboard.yaml | ||
│ │ ├── ibm-mq-prod-instance.yaml | ||
│ │ ├── ibm-mq-staging-instance.yaml | ||
│ │ ├── ibm-platform-navigator-instance.yaml | ||
│ │ ├── openldap.yaml | ||
│ │ ├── pact-broker.yaml | ||
│ │ ├── sealed-secrets-instance.yaml | ||
│ │ ├── sonarqube.yaml | ||
│ │ └── swaggereditor.yaml | ||
│ ├── artifactory | ||
│ │ ├── Chart.yaml | ||
│ │ └── values.yaml | ||
│ ├── cert-manager | ||
│ │ └── instance.yaml | ||
│ ├── cloud-native-toolkit | ||
│ │ └── release-v2.6.10.yaml | ||
│ ├── dev | ||
│ ├── developer-dashboard | ||
│ │ ├── Chart.yaml | ||
│ │ └── values.yaml | ||
│ ├── ibm-platform-navigator | ||
│ │ └── ibm-platform-navigator.yaml | ||
│ ├── openldap | ||
│ │ ├── Chart.yaml | ||
│ │ └── values.yaml | ||
│ ├── pact-broker | ||
│ │ ├── Chart.yaml | ||
│ │ └── values.yaml | ||
│ ├── prod | ||
│ ├── sealed-secrets | ||
│ │ └── instance.yaml | ||
│ ├── sonarqube | ||
│ │ ├── Chart.yaml | ||
│ │ └── values.yaml | ||
│ ├── staging | ||
│ └── swaggereditor | ||
│ ├── Chart.yaml | ||
│ └── values.yaml | ||
└── operators | ||
├── argocd | ||
│ ├── cert-manager.yaml | ||
│ ├── ibm-catalogs.yaml | ||
│ ├── ibm-cp4i-operators.yaml | ||
│ ├── ibm-foundations.yaml | ||
│ ├── ibm-platform-navigator.yaml | ||
│ ├── jaeger.yaml | ||
│ ├── openshift-pipelines.yaml | ||
│ └── sealed-secrets.yaml | ||
├── cert-manager | ||
│ └── operator.yaml | ||
├── ibm-catalogs | ||
│ ├── Chart.yaml | ||
│ └── values.yaml | ||
├── ibm-cp4i-operators | ||
│ ├── Chart.yaml | ||
│ └── values.yaml | ||
├── ibm-foundation | ||
│ ├── Chart.yaml | ||
│ └── values.yaml | ||
├── ibm-platform-navigator | ||
│ ├── Chart.yaml | ||
│ └── values.yaml | ||
├── jaeger | ||
│ ├── Chart.yaml | ||
│ └── values.yaml | ||
├── openshift-pipelines | ||
│ └── operator.yaml | ||
└── sealed-secrets | ||
├── Chart.yaml | ||
└── values.yaml | ||
``` | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Install the Cloud Native Toolkit on an existing cluster using GitOps | ||
|
||
_This is a work in progress, come back for updates._ | ||
|
||
Steps to install the Cloud Native Toolkit in an existing OpenShift cluster using a declarative approach with ArgoCD. | ||
|
||
|
||
|
||
## Pre-requisites | ||
The following is required before proceeding to the next section. | ||
|
||
- Provision an OpenShift cluster. | ||
- Install the `oc` and `git` cli. | ||
- Install the [Cloud Native Toolkit CLI](http://localhost:8000/learning/dev-setup.html#install-the-cloud-native-toolkit-command-line-interface-cli). | ||
|
||
|
||
## Installation | ||
1. Fork the [multi-tenancy-gitops](https://github.com/cloud-native-toolkit/multi-tenancy-gitops) repository and clone your fork. | ||
```bash | ||
git clone [email protected]:{gitorg}/multi-tenancy-gitops.git | ||
|
||
cd multi-tenancy-gitops | ||
``` | ||
|
||
1. Update the cloned repository with your GitHub Organization. | ||
- Search and replace all instances of `github.com/cloud-native-toolkit/multi-tenancy-gitops.git` with `github.com/{gitorg}/multi-tenancy-gitops.git`. | ||
- Commit and push your changes to your fork. | ||
```bash | ||
git commit -m "Update github organization" | ||
git push origin master | ||
``` | ||
|
||
3. The gitops repository is structured into different layers (ie. `1-apps`, `2-services`, `3-infra`). Each layer is structured in a similar pattern consisting of the following: | ||
- The `argocd` folder contains a set of ArgoCD Application YAMLs. | ||
- The set of folder(s) in each layer contains the resource YAMLs which will be deployed. | ||
```bash | ||
tree . -L 2 | ||
. | ||
├── 0-bootstrap | ||
│ └── argocd | ||
├── 1-apps | ||
│ ├── argocd | ||
│ └── instances | ||
├── 2-services | ||
│ ├── argocd | ||
│ ├── instances | ||
│ └── operators | ||
├── 3-infra | ||
│ ├── argocd | ||
│ ├── clusterrole | ||
│ ├── consolelink | ||
│ ├── consolenotification | ||
│ └── namespaces | ||
├── 4-rhacm | ||
│ └── argocd | ||
├── README.md | ||
└── bootstrap.yaml | ||
``` | ||
- Each `argocd` folder contains an `active` and `inactive` sub-folder. For each layer, select the ArgoCD Appliation YAMLs to deploy and move them into the `active` folder. | ||
```bash | ||
1-apps/argocd/ | ||
├── active | ||
└── inactive | ||
2-services/argocd/ | ||
├── active | ||
└── inactive | ||
3-infra/argocd/ | ||
├── active | ||
└── inactive | ||
``` | ||
- Commit and push your changes to your fork. | ||
```bash | ||
git commit -m "Update github organization" | ||
git push origin master | ||
``` | ||
|
||
1. 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 `openshift-gitops` namespace. | ||
```bash | ||
oc apply -f 2-services/operators/openshift-gitops/ -n openshift-operators | ||
``` | ||
- Verify you can log on to the ArgoCD Web Console. | ||
``` | ||
# ArgoCD Web Console URL | ||
echo https://$(oc get route argocd-cluster-server -o jsonpath='{ .spec.host }' -n openshift-gitops) | ||
# Admin password | ||
oc extract secret/argocd-cluster-cluster --to=- -n openshift-gitops | ||
``` | ||
|
||
1. 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. | ||
```bash | ||
oc apply -f 3-infra/clusterrole/ | ||
``` | ||
|
||
1. Create the bootstrap ArgoCD application. | ||
The bootstrap application will create the parent ArgoCD Application for each layer (YAMLs are located in `0-bootstrap` folder). | ||
The parent ArgoCD Applications will subsequently create the ArgoCD Applications in the `/argocd/active` directory. | ||
|
||
Depending on what resources have been selected, it will take some time for the ArgoCD to deploy the resources. | ||
```bash | ||
oc apply -f bootstrap.yaml -n openshift-gitops | ||
``` | ||
|
||
1. From the OpenShift Web Console, verify the resources (ie, operators, namespaces, etc) have been successfully created and/or deployed. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.