From d6eefb53feec4a9b0a020622de64036f889d5d5c Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Mon, 29 Aug 2022 11:03:18 -0500 Subject: [PATCH 1/4] Add the Kubernetes Operator install instructions Signed-off-by: Naarcha-AWS --- _clients/k8s-operator.md | 145 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 _clients/k8s-operator.md diff --git a/_clients/k8s-operator.md b/_clients/k8s-operator.md new file mode 100644 index 0000000000..6d68b79e3d --- /dev/null +++ b/_clients/k8s-operator.md @@ -0,0 +1,145 @@ +--- +layout: default +title: OpenSearch Kubernetes Operator +nav_order: 210 +--- + +The OpenSearch Kubernetes (K8s) Operator is a open-source K8s operator that helps automate the deployment, provisioning, of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters which can be scaled up and down depending on your needs. + +## Installation + +There are two ways to get started with the Operator: + +- [Use a Helm chart](#use-a-helm-chartuse-a-helm) +- [Use a local installation](#use-a-local-installation) + +### Use a Helm chart + +If you use Helm to manage your K8s cluster, you can use the OpenSearch Kubernetes Operator's CNCF project stored in Artifact Hub, a web-based application for finding, installing, and publishing CNCF packages. + +To begin, log into your K8s cluster and Add the Helm repo from Artifact hub. + +``` +helm repo add opensearch-operator https://opster.github.io/opensearch-k8s-operator/ +``` + +Make sure that the repo is included in your K8s cluster. + +``` +helm repo list | grep opensearch +``` + +Both the `opensearch` and `opensearch-operator` repos appear on the list of repos. + + +Install the manager that operates all OpenSearch Kubernetes Opeartor's action. + +``` +helm install opensearch-operator opensearch-operator/opensearch-operator +``` + +After the install completes, the operator returns information on the deployment with the `STATUS: deployed`. You can then configure and start your [OpenSearch cluster](#deploy-a-new-opensearch-cluster). + +### Use a local installation + +If you want to create a new K8s cluster on your existing machine, use a local installation. + +If this your first time running K8s and you intend on running through these instructions on your laptop, make sure that you have the following installed: + +- [K8s](https://kubernetes.io/docs/tasks/tools/) +- [Docker](https://docs.docker.com/engine/install/) +- [minikube](https://minikube.sigs.k8s.io/docs/start/) + +Before running through the installation steps, make sure that you have a K8s environment running locally. When using minikube, open a new terminal window and enter `minikube start`. K8s will now use a containerized minikube cluster with a namespace called `default`. + +Then install the OpenSearch Kubernetes operating using the following steps: + +1. In your preferred directory, clone the [OpenSearch Kubernetes Operator repo](https://github.com/Opster/opensearch-k8s-operator). `cd` into the repo directory. +2. Go to the `opensearch-operator` folder. +3. Enter `make build manifests`. +4. Start a Kuberenetes cluster. When using minikube, open a new terminal window and enter `minikube start`. K8s will now use a containerized minikube cluster with a namespace called `default`. Make sure that `~/.kube/config` points to the cluster. + +```yml +apiVersion: v1 +clusters: +- cluster: + certificate-authority: /Users/naarcha/.minikube/ca.crt + extensions: + - extension: + last-update: Mon, 29 Aug 2022 10:11:47 CDT + provider: minikube.sigs.k8s.io + version: v1.26.1 + name: cluster_info + server: https://127.0.0.1:61661 + name: minikube +contexts: +- context: + cluster: minikube + extensions: + - extension: + last-update: Mon, 29 Aug 2022 10:11:47 CDT + provider: minikube.sigs.k8s.io + version: v1.26.1 + name: context_info + namespace: default + user: minikube + name: minikube +current-context: minikube +kind: Config +preferences: {} +users: +- name: minikube + user: + client-certificate: /Users/naarcha/.minikube/profiles/minikube/client.crt + client-key: /Users/naarcha/.minikube/profiles/minikube/client.key +``` + +5. Enter `make install` to create the CRD that runs in your K8s cluster. +6. Start the OpenSearch Kubernetes Operator. Enter `make run`. + +## Verify K8s deployment + +To ensure that K8s recognizes the OpenSearch Kubernetes Operator as a namespace, enter `k get ns | grep opensearch`. Both `opensearch` and `opensearch-operator-system` should appear as `Active`. + +With the operator active, use `k get pod -n opensearch-operator-system` to make that the operator's pods are running. + +``` +NAME READY STATUS RESTARTS AGE +opensearch-operator-controller-manager- 2/2 Running 0 25m +``` + +With our K8s cluster running, we can now run OpenSearch inside the cluster. + +## Deploy a new OpenSearch cluster + +From your cloned OpenSearch Kubernetes Operator repo, navigate to the `opensearch-operator/examples` directory. There you'll find the `opensearch-cluster.yaml` file which can be customized to the needs of your cluster, including the `clusterName` that acts as the namespace your new OpenSearch cluster will reside. + +With your cluster configured, run the `kubectl apply` command. + +``` +kubectl apply -f opensearch-cluster.yaml +``` + +The operator creates several pods, including a bootstrap pod, three OpenSearch cluster pods, and one Dashboards pod. To connect to your cluster, use the `port-forward` command. + +``` +kubectl port-forward svc/my-cluster-dashboards 5601 +``` + +Open http://localhost:5601 in your preferred browser and login with the default demo credentials `admin / admin`. You can also run curl commands against the OpenSearch REST API by forwarding to port 9200. + +``` +kubectl port-forward svc/my-cluster 9200 +``` + +In order to delete the OpenSearch cluster, delete the cluster resources. The following command deletes the cluster namespace and all its resources. + +``` +kubectl delete -f opensearch-cluster.yaml +``` + +## Next steps + +To learn more about how to customize your K8s OpenSearch cluster, including Data Persistence, auth methods, and scaling, see the [OpenSearch Operator User Guide](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/userguide/main.md). + +If you want to contribute to the development of the OpenSearch Kubernetes Operator, see the repo [design documents](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/designs/high-level.md). \ No newline at end of file From bc00ad16b700e1071607c3e225e2612b7e5e8a15 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Mon, 29 Aug 2022 11:08:53 -0500 Subject: [PATCH 2/4] Copy edits Signed-off-by: Naarcha-AWS --- _clients/k8s-operator.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_clients/k8s-operator.md b/_clients/k8s-operator.md index 6d68b79e3d..cb98764e1b 100644 --- a/_clients/k8s-operator.md +++ b/_clients/k8s-operator.md @@ -4,7 +4,7 @@ title: OpenSearch Kubernetes Operator nav_order: 210 --- -The OpenSearch Kubernetes (K8s) Operator is a open-source K8s operator that helps automate the deployment, provisioning, of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters which can be scaled up and down depending on your needs. +The OpenSearch Kubernetes (K8s) Operator is an open-source K8s operator that helps automate the deployment, provisioning, of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters which can be scaled up and down depending on your needs. ## Installation @@ -17,7 +17,7 @@ There are two ways to get started with the Operator: If you use Helm to manage your K8s cluster, you can use the OpenSearch Kubernetes Operator's CNCF project stored in Artifact Hub, a web-based application for finding, installing, and publishing CNCF packages. -To begin, log into your K8s cluster and Add the Helm repo from Artifact hub. +To begin, log into your K8s cluster and add the Helm repo from [Artifact Hub](https://opster.github.io/opensearch-k8s-operator/). ``` helm repo add opensearch-operator https://opster.github.io/opensearch-k8s-operator/ @@ -32,13 +32,13 @@ helm repo list | grep opensearch Both the `opensearch` and `opensearch-operator` repos appear on the list of repos. -Install the manager that operates all OpenSearch Kubernetes Opeartor's action. +Install the manager that operates all of the OpenSearch Kubernetes Opeartor's actions. ``` helm install opensearch-operator opensearch-operator/opensearch-operator ``` -After the install completes, the operator returns information on the deployment with the `STATUS: deployed`. You can then configure and start your [OpenSearch cluster](#deploy-a-new-opensearch-cluster). +After the install completes, the operator returns information on the deployment with the `STATUS: deployed`. Then you can configure and start your [OpenSearch cluster](#deploy-a-new-opensearch-cluster). ### Use a local installation @@ -57,7 +57,7 @@ Then install the OpenSearch Kubernetes operating using the following steps: 1. In your preferred directory, clone the [OpenSearch Kubernetes Operator repo](https://github.com/Opster/opensearch-k8s-operator). `cd` into the repo directory. 2. Go to the `opensearch-operator` folder. 3. Enter `make build manifests`. -4. Start a Kuberenetes cluster. When using minikube, open a new terminal window and enter `minikube start`. K8s will now use a containerized minikube cluster with a namespace called `default`. Make sure that `~/.kube/config` points to the cluster. +4. Start a Kubernetes cluster. When using minikube, open a new terminal window and enter `minikube start`. K8s will now use a containerized minikube cluster with a namespace called `default`. Make sure that `~/.kube/config` points to the cluster. ```yml apiVersion: v1 From 03e03f822179e9a820f9321db8792e9515649fcd Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Thu, 15 Sep 2022 10:43:12 -0500 Subject: [PATCH 3/4] Add doc review Signed-off-by: Naarcha-AWS --- _clients/k8s-operator.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_clients/k8s-operator.md b/_clients/k8s-operator.md index cb98764e1b..5694291b2a 100644 --- a/_clients/k8s-operator.md +++ b/_clients/k8s-operator.md @@ -4,7 +4,7 @@ title: OpenSearch Kubernetes Operator nav_order: 210 --- -The OpenSearch Kubernetes (K8s) Operator is an open-source K8s operator that helps automate the deployment, provisioning, of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters which can be scaled up and down depending on your needs. +The OpenSearch Kubernetes (K8s) Operator is an open-source K8s operator that helps automate the deployment and provisioning of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters which can be scaled up and down depending on your needs. ## Installation @@ -17,7 +17,7 @@ There are two ways to get started with the Operator: If you use Helm to manage your K8s cluster, you can use the OpenSearch Kubernetes Operator's CNCF project stored in Artifact Hub, a web-based application for finding, installing, and publishing CNCF packages. -To begin, log into your K8s cluster and add the Helm repo from [Artifact Hub](https://opster.github.io/opensearch-k8s-operator/). +To begin, log into your K8s cluster and add the Helm repository (repo) from [Artifact Hub](https://opster.github.io/opensearch-k8s-operator/). ``` helm repo add opensearch-operator https://opster.github.io/opensearch-k8s-operator/ @@ -32,7 +32,7 @@ helm repo list | grep opensearch Both the `opensearch` and `opensearch-operator` repos appear on the list of repos. -Install the manager that operates all of the OpenSearch Kubernetes Opeartor's actions. +Install the manager that operates all of the OpenSearch Kubernetes Operator's actions. ``` helm install opensearch-operator opensearch-operator/opensearch-operator @@ -44,7 +44,7 @@ After the install completes, the operator returns information on the deployment If you want to create a new K8s cluster on your existing machine, use a local installation. -If this your first time running K8s and you intend on running through these instructions on your laptop, make sure that you have the following installed: +If this your first time running K8s and you intend to run through these instructions on your laptop, make sure that you have the following installed: - [K8s](https://kubernetes.io/docs/tasks/tools/) - [Docker](https://docs.docker.com/engine/install/) @@ -101,7 +101,7 @@ users: To ensure that K8s recognizes the OpenSearch Kubernetes Operator as a namespace, enter `k get ns | grep opensearch`. Both `opensearch` and `opensearch-operator-system` should appear as `Active`. -With the operator active, use `k get pod -n opensearch-operator-system` to make that the operator's pods are running. +With the operator active, use `k get pod -n opensearch-operator-system` to make sure that the operator's pods are running. ``` NAME READY STATUS RESTARTS AGE @@ -126,7 +126,7 @@ The operator creates several pods, including a bootstrap pod, three OpenSearch c kubectl port-forward svc/my-cluster-dashboards 5601 ``` -Open http://localhost:5601 in your preferred browser and login with the default demo credentials `admin / admin`. You can also run curl commands against the OpenSearch REST API by forwarding to port 9200. +Open http://localhost:5601 in your preferred browser and log in with the default demo credentials `admin / admin`. You can also run curl commands against the OpenSearch REST API by forwarding to port 9200. ``` kubectl port-forward svc/my-cluster 9200 From 975c25bf50ed033c78444da4a570e241957a0f89 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS Date: Wed, 21 Sep 2022 12:09:35 -0700 Subject: [PATCH 4/4] Add editorial Signed-off-by: Naarcha-AWS --- _clients/k8s-operator.md | 45 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/_clients/k8s-operator.md b/_clients/k8s-operator.md index 5694291b2a..51b99f8103 100644 --- a/_clients/k8s-operator.md +++ b/_clients/k8s-operator.md @@ -4,32 +4,33 @@ title: OpenSearch Kubernetes Operator nav_order: 210 --- -The OpenSearch Kubernetes (K8s) Operator is an open-source K8s operator that helps automate the deployment and provisioning of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters which can be scaled up and down depending on your needs. +The OpenSearch Kubernetes Operator is an open-source kubernetes operator that helps automate the deployment and provisioning of OpenSearch and OpenSearch Dashboards in a containerized environment. The operator can manage multiple OpenSearch clusters that can be scaled up and down depending on your needs. + ## Installation -There are two ways to get started with the Operator: +There are two ways to get started with the operator: -- [Use a Helm chart](#use-a-helm-chartuse-a-helm) -- [Use a local installation](#use-a-local-installation) +- [Use a Helm chart](#use-a-helm-chartuse-a-helm). +- [Use a local installation](#use-a-local-installation). ### Use a Helm chart -If you use Helm to manage your K8s cluster, you can use the OpenSearch Kubernetes Operator's CNCF project stored in Artifact Hub, a web-based application for finding, installing, and publishing CNCF packages. +If you use Helm to manage your Kubernetes cluster, you can use the OpenSearch Kubernetes Operator's Cloud Native Computing Foundation (CNCF) project stored in Artifact Hub, a web-based application for finding, installing, and publishing CNCF packages. -To begin, log into your K8s cluster and add the Helm repository (repo) from [Artifact Hub](https://opster.github.io/opensearch-k8s-operator/). +To begin, log in to your Kubernetes cluster and add the Helm repository (repo) from [Artifact Hub](https://opster.github.io/opensearch-Kubernetes-operator/). ``` helm repo add opensearch-operator https://opster.github.io/opensearch-k8s-operator/ ``` -Make sure that the repo is included in your K8s cluster. +Make sure that the repo is included in your Kubernetes cluster. ``` helm repo list | grep opensearch ``` -Both the `opensearch` and `opensearch-operator` repos appear on the list of repos. +Both the `opensearch` and `opensearch-operator` repos appear in the list of repos. Install the manager that operates all of the OpenSearch Kubernetes Operator's actions. @@ -38,26 +39,26 @@ Install the manager that operates all of the OpenSearch Kubernetes Operator's ac helm install opensearch-operator opensearch-operator/opensearch-operator ``` -After the install completes, the operator returns information on the deployment with the `STATUS: deployed`. Then you can configure and start your [OpenSearch cluster](#deploy-a-new-opensearch-cluster). +After the installation completes, the operator returns information on the deployment with `STATUS: deployed`. Then you can configure and start your [OpenSearch cluster](#deploy-a-new-opensearch-cluster). ### Use a local installation -If you want to create a new K8s cluster on your existing machine, use a local installation. +If you want to create a new Kubernetes cluster on your existing machine, use a local installation. -If this your first time running K8s and you intend to run through these instructions on your laptop, make sure that you have the following installed: +If this is your first time running Kubernetes and you intend to run through these instructions on your laptop, make sure that you have the following installed: -- [K8s](https://kubernetes.io/docs/tasks/tools/) +- [Kubernetes](https://kubernetes.io/docs/tasks/tools/) - [Docker](https://docs.docker.com/engine/install/) - [minikube](https://minikube.sigs.k8s.io/docs/start/) -Before running through the installation steps, make sure that you have a K8s environment running locally. When using minikube, open a new terminal window and enter `minikube start`. K8s will now use a containerized minikube cluster with a namespace called `default`. +Before running through the installation steps, make sure that you have a Kubernetes environment running locally. When using minikube, open a new terminal window and enter `minikube start`. Kubernetes will now use a containerized minikube cluster with a namespace called `default`. -Then install the OpenSearch Kubernetes operating using the following steps: +Then install the OpenSearch Kubernetes Operator using the following steps: -1. In your preferred directory, clone the [OpenSearch Kubernetes Operator repo](https://github.com/Opster/opensearch-k8s-operator). `cd` into the repo directory. +1. In your preferred directory, clone the [OpenSearch Kubernetes Operator repo](https://github.com/Opster/opensearch-k8s-operator). Navigate into repo's directory using `cd`. 2. Go to the `opensearch-operator` folder. 3. Enter `make build manifests`. -4. Start a Kubernetes cluster. When using minikube, open a new terminal window and enter `minikube start`. K8s will now use a containerized minikube cluster with a namespace called `default`. Make sure that `~/.kube/config` points to the cluster. +4. Start a Kubernetes cluster. When using minikube, open a new terminal window and enter `minikube start`. Kubernetes will now use a containerized minikube cluster with a namespace called `default`. Make sure that `~/.kube/config` points to the cluster. ```yml apiVersion: v1 @@ -94,12 +95,12 @@ users: client-key: /Users/naarcha/.minikube/profiles/minikube/client.key ``` -5. Enter `make install` to create the CRD that runs in your K8s cluster. +5. Enter `make install` to create the CustomResourceDefinition that runs in your Kubernetes cluster. 6. Start the OpenSearch Kubernetes Operator. Enter `make run`. -## Verify K8s deployment +## Verify Kubernetes deployment -To ensure that K8s recognizes the OpenSearch Kubernetes Operator as a namespace, enter `k get ns | grep opensearch`. Both `opensearch` and `opensearch-operator-system` should appear as `Active`. +To ensure that Kubernetes recognizes the OpenSearch Kubernetes Operator as a namespace, enter `k get ns | grep opensearch`. Both `opensearch` and `opensearch-operator-system` should appear as `Active`. With the operator active, use `k get pod -n opensearch-operator-system` to make sure that the operator's pods are running. @@ -108,11 +109,11 @@ NAME READY STATUS RESTARTS AG opensearch-operator-controller-manager- 2/2 Running 0 25m ``` -With our K8s cluster running, we can now run OpenSearch inside the cluster. +With the Kubernetes cluster running, you can now run OpenSearch inside the cluster. ## Deploy a new OpenSearch cluster -From your cloned OpenSearch Kubernetes Operator repo, navigate to the `opensearch-operator/examples` directory. There you'll find the `opensearch-cluster.yaml` file which can be customized to the needs of your cluster, including the `clusterName` that acts as the namespace your new OpenSearch cluster will reside. +From your cloned OpenSearch Kubernetes Operator repo, navigate to the `opensearch-operator/examples` directory. There you'll find the `opensearch-cluster.yaml` file, which can be customized to the needs of your cluster, including the `clusterName` that acts as the namespace in which your new OpenSearch cluster will reside. With your cluster configured, run the `kubectl apply` command. @@ -140,6 +141,6 @@ kubectl delete -f opensearch-cluster.yaml ## Next steps -To learn more about how to customize your K8s OpenSearch cluster, including Data Persistence, auth methods, and scaling, see the [OpenSearch Operator User Guide](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/userguide/main.md). +To learn more about how to customize your Kubernetes OpenSearch cluster, including data persistence, authentication methods, and scaling, see the [OpenSearch Kubernetes Operator User Guide](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/userguide/main.md). If you want to contribute to the development of the OpenSearch Kubernetes Operator, see the repo [design documents](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/designs/high-level.md). \ No newline at end of file