Skip to content

Commit

Permalink
Add requested changes and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
valaparthvi committed Aug 12, 2021
1 parent 881fa89 commit cc4643d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 42 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
### Documentation

- Documents steps for component creation ([#4982](https://github.com/openshift/odo/pull/4982))
- Add Cluster setup documentation ([#4973](https://github.com/openshift/odo/pull/4973))

## 2.2.4

### Feature/Enhancements
Expand Down
63 changes: 35 additions & 28 deletions website/docs/getting-started/cluster-setup/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,70 @@ title: Kubernetes
sidebar_position: 1
---

# Setup a minikube cluster
*Note that this documentation is only useful in setting up a development environment; it is not recommended for a production environment.*
# Setup a Kubernetes cluster
*Note that this guide is only helpful in setting up a development environment; this setup is not recommended for a production environment.*

## Prerequisites
This guide assumes that you have [installed minikube](https://minikube.sigs.k8s.io/docs/start/) on your system.
* This guide assumes that you have a Kubernetes cluster setup, this could also be a [minikube](https://minikube.sigs.k8s.io/docs/start/) cluster.

If you are using a Kubernetes cluster other than minikube, this guide assumes that you have admin privileges to the cluster and are logged in with the admin user; Operator installation is only possible with an admin user.
* This guide also assumes that you have admin privileges to the cluster, since the operator installation is only possible with an admin user.

## Enable Ingress
To access an application externally, odo creates a URL; installing an ingress-controller helps in using this feature on a Kubernetes cluster.

To enable the Ingress feature on a Kubernetes cluster _other than minikube_, run the following command to install the default setup:
```shell
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.48.1/deploy/static/provider/cloud/deploy.yaml
```
To learn more about enabling this feature on your cluster, see the [Ingress prerequisites](https://kubernetes.io/docs/concepts/services-networking/ingress/#prerequisites) on the official kubernetes documentation.

**Minikube:** To install an ingress-controller on a minikube cluster, enable the **ingress** addon with the following command:
```shell
minikube addons enable ingress
````
To learn more about ingress addon, see the [official kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/).

## Install the Operator Lifecycle Manager(OLM)
The Operator Lifecycle Manager(OLM) is a component of the Operator Framework, an open source toolkit to manage Kubernetes native applications, called Operators, in a streamlined and scalable way.[(Source)](https://olm.operatorframework.io/)

To install operators, we will first need to install OLM [(Operator Lifecycle Manager)](https://olm.operatorframework.io/) addon to the minikube cluster.
Running the script below will take some time to install all the necessary namespaces and other resources.
What are Operators?
>The Operator pattern aims to capture the key aim of a human operator who is managing a service or set of services. Human operators who look after specific applications and services have deep knowledge of how the system ought to behave, how to deploy it, and how to react if there are problems.
>
>People who run workloads on Kubernetes often like to use automation to take care of repeatable tasks. The Operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.
> [(Source)](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/#motivation)

To install an operator, we will first need to install OLM [(Operator Lifecycle Manager)](https://olm.operatorframework.io/) on the cluster.
```shell
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.18.3/install.sh | bash -s v0.18.3
```
Running the script will take some time to install all the necessary resources.

To install OLM on a Kubernetes cluster setup other than minikube, please refer the [installation instructions on GitHub](https://github.com/operator-framework/operator-lifecycle-manager/#installation).
Note: Check the OLM [release page](https://github.com/operator-framework/operator-lifecycle-manager/releases/) to use the latest version.

## Install the Service Binding Operator
odo uses [Service Binding Operator](https://operatorhub.io/operator/service-binding-operator) to provide the `odo link` feature which helps connect an odo component to a service or another component.
odo uses [Service Binding Operator](https://operatorhub.io/operator/service-binding-operator) to provide the `odo link` feature which helps to connect an odo component to a service or another component.

Operators can be installed in a specific namespace or across the cluster(i.e. in all the namespaces). To install an operator, we need to make sure that the namespace contains `OperatorGroup` resource. Running the command below will create the necessary resource in `operators` namespace.
Operators can be installed in a specific namespace or across the cluster(i.e. in all the namespaces). To install an operator, we need to make sure that the namespace contains `OperatorGroup` resource.
```shell
kubectl create -f https://operatorhub.io/install/service-binding-operator.yaml
```
Running the command will create the necessary resource in `operators` namespace.

If you want to access this resource from other namespaces as well, add your target namespace to `.spec.targetNamespaces` list.

See [Verify the Operator installation](#verify-the-operator-installation) to ensure the operator is installed successfully.
See [Verify the Operator installation](#verify-the-operator-installation) to ensure that the operator was installed successfully.

## Install an Operator
1. Visit the [OperatorHub](https://operatorhub.io) website.
2. Search for an operator of your choice.
3. Navigate to its detail page.
4. Click on `Install`.
5. Follow the instruction in the installation popup.
6. [Verify the operator was installed successfully](#verify-the-operator-installation).
6. Wait for a few seconds for the operator to install.
7. [Verify the operator installation](#verify-the-operator-installation).

## Verify the Operator installation
Wait for a few seconds for the operator to install.
To verify that the operator is installed successfully and see the CRDs associated with it, run the following command.
Once the operator is successfully installed on the cluster, you can also use `odo` to verify the operator installation and see the CRDs associated with it; run the following command:
```shell
odo catalog list services
```
Expand All @@ -58,21 +80,6 @@ service-binding-operator.v0.9.1 ServiceBinding, ServiceBinding
```
If you do not see your installed operator in the list, follow the [troubleshooting guide](#troubleshoot-the-operator-installation) to find the issue and debug it.

## Enable Ingress addon
To access an application externally, odo creates a URL; addons such as ingress helps enable this feature on a Kubernetes cluster.

To enable the **ingress** addon on a minikube cluster, run the following command:
```shell
minikube addons enable ingress
```
To enable this feature on a Kubernetes cluster other than minikube, run the following command to install the default setup:
```shell
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.48.1/deploy/static/provider/cloud/deploy.yaml
```
To learn more about setting up ingress, see the [Ingress prerequisites](https://kubernetes.io/docs/concepts/services-networking/ingress/#prerequisites) on the official kubernetes documentation.

To learn more about ingress addon, see the [official kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/).

## Troubleshoot the Operator installation
There are two ways to confirm that the operator has been installed properly.
The examples you may see in this guide uses [Datadog Operator](https://operatorhub.io/operator/datadog-operator) and [Service Binding Operator](https://operatorhub.io/operator/service-binding-operator).
Expand Down
23 changes: 9 additions & 14 deletions website/docs/getting-started/cluster-setup/openshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ title: OpenShift
sidebar_position: 2
---

# Setup a CRC cluster
Please note that this documentation is only useful in setting up a development environment, it is not recommended for a production environment.
# Setup an OpenShift cluster
*Note that this guide is only helpful in setting up a development environment; this setup is not recommended for a production environment.*

This guide assumes that you have [installed and setup crc](https://crc.dev/crc/#installing-codeready-containers_gsg).

If you are using an OpenShift cluster other than crc, this guide assumes that you have admin privileges to the cluster and are logged in with the admin user; operator installation is only possible with an admin user.

**Agenda for this guide:**
* [Install the Service Binding Operator](#install-the-service-binding-operator)
* [Install an operator](#install-an-operator)
* [Verify the operator installation](#verify-the-operator-installation)
## Prerequisites
* This guide assumes that you have an OpenShift cluster setup, this could also be a [crc](https://crc.dev/crc/#installing-codeready-containers_gsg) cluster.
* This guide also assumes that you have admin privileges to the cluster, since Operator installation is only possible with an admin user.

## Install the Service Binding Operator
odo uses [Service Binding Operator](https://operatorhub.io/operator/service-binding-operator) to provide the `odo link` feature which helps connect an odo component to a service or another component.
Expand All @@ -29,20 +24,20 @@ odo uses [Service Binding Operator](https://operatorhub.io/operator/service-bind
9. Once the operator is installed, you should see **Installed operator - ready for use**, and a **View Operator** button appears on the page.
10. Click on the **View Operator** button; this should take you to Operators > Installed Operators > Operator details page, and you should be able to see details of your operator.

## Install an operator
## Install an Operator
1. Login to the OpenShift web console with admin, and navigate to Operators > OperatorHub.
2. Make sure that the Project is set to All Projects.
3. Search for an operator of your choice in the search box under `All Items`.
4. Click on the operator; this should open a side pane.
5. Click on the `Install` button on the side pane; this should open an `Install Operator` page.
6. Set the `Installation mode`, `Installed Namespace` and `Approval Strategy` as per your requirement.
7. Click on the `Install` button.
8. Wait until the operator is installed.
9. Once the operator is installed, you should see `Installed operator - ready for use`, and a `View Operator` button appears on the page.
8. Wait until the Operator is installed.
9. Once the Operator is installed, you should see `Installed operator - ready for use`, and a `View Operator` button appears on the page.
10. Click on the `View Operator` button; this should take you to Operators > Installed Operators > Operator details page, and you should be able to see details of your operator.

## Verify the operator installation
Once the operator is successfully installed on the crc/OpenShift cluster, you can also use `odo` to verify the operator installation and see the CRDs associated with it; run the following command:
Once the operator is successfully installed on the cluster, you can also use `odo` to verify the operator installation and see the CRDs associated with it; run the following command:
```shell
odo catalog list services
```
Expand Down

0 comments on commit cc4643d

Please sign in to comment.