Skip to content

Commit

Permalink
Sync content v1 (#450)
Browse files Browse the repository at this point in the history
* 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
Show file tree
Hide file tree
Showing 34 changed files with 606 additions and 92 deletions.
4 changes: 2 additions & 2 deletions build.sh
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
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@
"Hadolint",
"aquasec",
"datacenter",
"Grafana"
"Grafana",
"userdemo",
"projectdemo",
"ROKS"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
Expand Down
184 changes: 184 additions & 0 deletions docs/adopting/use-cases/gitops/gitops-ace.md
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
```
![ArgoCD deployments of 3-infra](images/argocd-cntk-3-infra.png){.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
```
![ArgoCD deployments of 2-services](images/argocd-ace-2-services.png)
106 changes: 106 additions & 0 deletions docs/adopting/use-cases/gitops/gitops-toolkit.md
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.
8 changes: 4 additions & 4 deletions docs/learning/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This guide assumes that you have some basic knowledge of Kubernetes, Docker, and

## Cluster Command Line Tools

You will be using the command line for some of the tasks you will learn about as you work through the learning material.
You will be using the command line for some of the tasks you will learn about as you work through the learning material.

If you are using the Open Labs environment, then you can skip installing command line tools locally as the Open Labs environment provides a web-based command line.

Expand Down Expand Up @@ -66,9 +66,9 @@ The Personal Access Token only needs to be generated once because it is associat
- Navigate to [Developer Settings](https://github.com/settings/tokens){: target=_blank} and generate a new token; name it something like "CI pipeline"
- Select `public_repo` scope to enable git clone
- Select `write:repo_hook` scope so the pipeline can create a web hook

![Pipeline OAuth scopes](./images/pipeline-scopes.png)

- The GitHub UI will never again let you see this token, so be sure to save the token in your password manager or somewhere safe that you can access later on

### IBM Cloud account
Expand All @@ -93,7 +93,7 @@ The Cloud-Native Toolkit CLI needs to be installed in all development environmen
To install the Cloud-Native Toolkit CLI run the following command:

```shell
curl -sL shell.cloudnativetoolkit.dev | shell -
curl -sL shell.cloudnativetoolkit.dev | sh -
source ~/.bashrc || source ~/.zshrc
```

Expand Down
8 changes: 7 additions & 1 deletion docs/overview/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

<!--- cSpell:ignore pactbroker swaggereditor -->

<!---
<!---
Use Heading 2 style to introduce a new release, then jump to heading 4 for components - this keeps the Table of contents displayed on the page more navigable)
--->

## May 25, 2021

- The Workshop got updated with a new [Artificial Intelligence](https://cloudnativetoolkit.dev/workshop/ai)
- New experimental support to deploy via GitOps the [Cloud Native Toolkit](https://cloudnativetoolkit.dev/adopting/use-cases/gitops/gitops-toolkit.html) and [IBM Cloud Pak App Connect](https://cloudnativetoolkit.dev/adopting/use-cases/gitops/gitops-ace.html)


## Jan 28, 2021

[Cloud Native Toolkit Workshop](https://cloudnativetoolkit.dev/workshop) released. The workshop in a box environment is easy and quick to setup with hands on labs including videos.
Expand Down
Loading

0 comments on commit dded3e3

Please sign in to comment.