From c12b1c4baf33bcccc2c64e972ceed6396d3c6b04 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Thu, 28 Mar 2024 14:38:55 +0000 Subject: [PATCH 01/14] First draft --- pages/k8s/how-to-cos-lite.md | 128 +++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 pages/k8s/how-to-cos-lite.md diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md new file mode 100644 index 00000000..25aa90ad --- /dev/null +++ b/pages/k8s/how-to-cos-lite.md @@ -0,0 +1,128 @@ +--- +wrapper_template: "templates/docs/markdown.html" +markdown_includes: + nav: "kubernetes/docs/shared/_side-navigation.md" +context: + title: "Integrating COS Lite with Charmed Kubernetes" + description: Integrating COS Lite with Charmed Kubernetes +keywords: Cloud, cluster, observability +tags: [observability, operating] +sidebar: k8smain-sidebar +permalink: explain-cos-lite.html +layout: [base, ubuntu-com] +toc: False +--- + +First, initialize a controller on your preferred cloud platform (vSphere, AWS, +Azure) using Juju. Run the following command, ensuring to replace placeholder +values with your specifics: + +``` +juju bootstrap --credential $XYZ \ + --debug \ + --model-default automatically-retry-hooks=false \ + --model-default 'logging-config==DEBUG' \ + --bootstrap-image="juju-ci-root/templates/jammy-test-template" \ + --bootstrap-series=jammy \ + --bootstrap-constraints "arch=amd64" \ + aws tutorial-controller +``` + +Next, create a microk8s model to act as a deployment cloud for cos-lite: + +``` +juju add-model --config logging-config='=DEBUG' \ + microk8s-ubuntu aws +``` + +Deploy Ubuntu on the microk8s-ubuntu model with the following specifications: + +``` +juju deploy ubuntu --series=focal --constraints="mem=16G cores=8 root-disk=50G" +``` + +To deploy microk8s on ubuntu, access the unit ubuntu using `juju ssh ubuntu/0` +and follow the configuration steps available at: + +After configuring microk8s, export its kubeconfig file to your current directory: + +``` +juju ssh ubuntu/0 -- microk8s config > microk8s-config.yaml +``` + +Now, register microk8s as a Juju cloud: + +``` +KUBECONFIG=microk8s-config.yaml juju add-k8s microk8s +``` + +Create a new model for cos-lite on this cloud and deploy cos-lite: + +``` +juju add-model cos-lite microk8s +juju deploy cos-lite +``` + +Offer cos-lite's endpoints for integration across models: + +``` +juju offer grafana:grafana-dashboard +juju offer prometheus:receive-remote-write +``` + +Check the status of these offerings with juju status --relations to see +both grafana and prometheus listed. +This process bootstrapped a controller, created two models (one for Ubuntu +with microk8s deployed, and another for cos-lite), and set up cos-lite's +endpoints for cross-model integration. +Next, proceed to deploy charmed Kubernetes and link it with cos-lite +for a comprehensive cloud-native environment. + +Create a model for charmed kubernetes: + +``` +juju add-model --config logging-config='=DEBUG' charmed-k8s aws +``` + +Deploy charmed kubernetes: + +``` +juju deploy charmed-kubernetes +``` + +Consume cos-lite endpoints: + +``` +juju consume cos-lite.grafana +juju consume cos-lite.prometheus +``` + +Deploy the grafana-agent: + +``` +Juju deploy grafana-agent +``` + +Relate grafana-agent to k8s and kubernetes-control-plane and kubernetes-worker: + +``` +juju integrate grafana-agent:cos-agent k8s:cos-agent +juju integrate grafana-agent:cos-agent kubernetes-control-plane:cos-agent +juju integrate grafana-agent:cos-agent kubernetes-worker:cos-agent +``` + +Relate grafana-agent to the cos-lite offerings: + +``` +juju integrate grafana-agent grafana +juju integrate grafana-agent prometheus +``` + +Get the credentials and login url for grafana: + +``` +juju run grafana/0 get-admin-password -m cos-lite + +admin-password: b9OhxF5ndUDO +url: http://10.246.154.87/cos-lite-grafana +``` From 37d51b79f6769c34bd28f290a60884f06163d1aa Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Thu, 28 Mar 2024 14:42:30 +0000 Subject: [PATCH 02/14] Add metadata --- _data/sidebars/k8smain-sidebar.yml | 5 +++++ pages/k8s/how-to-cos-lite.md | 11 +++++++++++ pages/k8s/shared/_side-navigation.md | 1 + 3 files changed, 17 insertions(+) diff --git a/_data/sidebars/k8smain-sidebar.yml b/_data/sidebars/k8smain-sidebar.yml index 1dddcd7e..4c05763e 100644 --- a/_data/sidebars/k8smain-sidebar.yml +++ b/_data/sidebars/k8smain-sidebar.yml @@ -54,6 +54,11 @@ entries: output: web, pdf type: page + - title: ...observe your cluster + url: /how-to-cos-lite + output: web, pdf + type: page + - title: ...contribute to this project url: /how-to-contribute output: web, pdf diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index 25aa90ad..e898092e 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -126,3 +126,14 @@ juju run grafana/0 get-admin-password -m cos-lite admin-password: b9OhxF5ndUDO url: http://10.246.154.87/cos-lite-grafana ``` + + +
+
+

We appreciate your feedback on the documentation. You can + edit this page + or + file a bug here.

+

See the guide to contributing or discuss these docs in our public Mattermost channel.

+
+
diff --git a/pages/k8s/shared/_side-navigation.md b/pages/k8s/shared/_side-navigation.md index d023ea87..3e5aed50 100644 --- a/pages/k8s/shared/_side-navigation.md +++ b/pages/k8s/shared/_side-navigation.md @@ -10,6 +10,7 @@ - […operate Kubernetes](/kubernetes/docs/how-to-operate) - […achieve High Availability](/kubernetes/docs/how-to-ha) - […secure your cluster](/kubernetes/docs/how-to-security) +- […observe your cluster](/kubernetes/docs/how-to-cos-lite) - […contribute to this project](/kubernetes/docs/how-to-contribute) ## Explanation From ca12147581c65e9b0ae217c444b540b256d975e4 Mon Sep 17 00:00:00 2001 From: eaudetcobello <155978570+eaudetcobello@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:45:17 -0400 Subject: [PATCH 03/14] Update how-to-cos-lite.md --- pages/k8s/how-to-cos-lite.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index e898092e..41b65373 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -75,8 +75,7 @@ both grafana and prometheus listed. This process bootstrapped a controller, created two models (one for Ubuntu with microk8s deployed, and another for cos-lite), and set up cos-lite's endpoints for cross-model integration. -Next, proceed to deploy charmed Kubernetes and link it with cos-lite -for a comprehensive cloud-native environment. +Next, proceed to deploy charmed Kubernetes and link it with cos-lite. Create a model for charmed kubernetes: From bd5798da2e87c93130bea1cf7e88bf49dc823c23 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Thu, 28 Mar 2024 14:46:37 +0000 Subject: [PATCH 04/14] Update metadata --- pages/k8s/how-to-cos-lite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index 41b65373..bd449406 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -8,7 +8,7 @@ context: keywords: Cloud, cluster, observability tags: [observability, operating] sidebar: k8smain-sidebar -permalink: explain-cos-lite.html +permalink: how-to-cos-lite.html layout: [base, ubuntu-com] toc: False --- From 54a1952a8cb04908beff2d6698e7c799eaeed106 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Tue, 2 Apr 2024 17:18:56 +0000 Subject: [PATCH 05/14] Review comments --- _data/sidebars/k8smain-sidebar.yml | 5 --- pages/k8s/how-to-cos-lite.md | 65 +++++++++++++++--------------- pages/k8s/how-to-operate.md | 2 +- 3 files changed, 34 insertions(+), 38 deletions(-) diff --git a/_data/sidebars/k8smain-sidebar.yml b/_data/sidebars/k8smain-sidebar.yml index 4c05763e..1dddcd7e 100644 --- a/_data/sidebars/k8smain-sidebar.yml +++ b/_data/sidebars/k8smain-sidebar.yml @@ -54,11 +54,6 @@ entries: output: web, pdf type: page - - title: ...observe your cluster - url: /how-to-cos-lite - output: web, pdf - type: page - - title: ...contribute to this project url: /how-to-contribute output: web, pdf diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index bd449406..58c956a0 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -13,22 +13,22 @@ layout: [base, ubuntu-com] toc: False --- -First, initialize a controller on your preferred cloud platform (vSphere, AWS, -Azure) using Juju. Run the following command, ensuring to replace placeholder -values with your specifics: +**Charmed Kubernetes** includes the standard Kubernetes dashboard for +monitoring your cluster. However, it is often advisable to have a monitoring +solution which will run whether the cluster itself is running or not. It may +also be useful to integrate monitoring into existing setups. -``` -juju bootstrap --credential $XYZ \ - --debug \ - --model-default automatically-retry-hooks=false \ - --model-default 'logging-config==DEBUG' \ - --bootstrap-image="juju-ci-root/templates/jammy-test-template" \ - --bootstrap-series=jammy \ - --bootstrap-constraints "arch=amd64" \ - aws tutorial-controller -``` +To make monitoring your cluster a delightful experience, Canonical provides +first-class integration between charmed-kubernetes and COS Lite. This guide +will help you integrate a COS Lite deployment with a charmed-kubernetes deployment. + +This document assumes you have a controller with an installation of +charmed-kubernetes. If this is not your case, refer to +["how-to-install"].() -Next, create a microk8s model to act as a deployment cloud for cos-lite: +## Preparing a platform for COS Lite + +First, create a microk8s model to act as a deployment cloud for cos-lite: ``` juju add-model --config logging-config='=DEBUG' \ @@ -38,25 +38,29 @@ juju add-model --config logging-config='=DEBUG' \ Deploy Ubuntu on the microk8s-ubuntu model with the following specifications: ``` -juju deploy ubuntu --series=focal --constraints="mem=16G cores=8 root-disk=50G" +juju deploy ubuntu microk8s --series=focal --constraints="mem=16G cores=8 root-disk=50G" ``` -To deploy microk8s on ubuntu, access the unit ubuntu using `juju ssh ubuntu/0` +The above command deploys the ubuntu charm as an application called microk8s. + +To deploy microk8s on ubuntu, access the unit ubuntu using `juju ssh microk8s/0` and follow the configuration steps available at: After configuring microk8s, export its kubeconfig file to your current directory: ``` -juju ssh ubuntu/0 -- microk8s config > microk8s-config.yaml +juju ssh microk8s/0 -- microk8s config > microk8s-config.yaml ``` -Now, register microk8s as a Juju cloud: +Now, register microk8s as a Juju cloud (see "[juju +add-k8s"](https://juju.is/docs/juju/juju-add-k8s) for details on the add-k8s +command): ``` KUBECONFIG=microk8s-config.yaml juju add-k8s microk8s ``` -Create a new model for cos-lite on this cloud and deploy cos-lite: +Create a new model for cos-lite on the microk8s cloud and deploy the cos-lite charm: ``` juju add-model cos-lite microk8s @@ -72,22 +76,19 @@ juju offer prometheus:receive-remote-write Check the status of these offerings with juju status --relations to see both grafana and prometheus listed. -This process bootstrapped a controller, created two models (one for Ubuntu -with microk8s deployed, and another for cos-lite), and set up cos-lite's -endpoints for cross-model integration. -Next, proceed to deploy charmed Kubernetes and link it with cos-lite. -Create a model for charmed kubernetes: +So far, we've created a model that runs microk8s on Ubuntu, and added that +model as a Kubernetes cloud to Juju. We then used this cloud as a substrate +for the cos-lite deployment. We therefore have 2 models on the same controller. -``` -juju add-model --config logging-config='=DEBUG' charmed-k8s aws -``` -Deploy charmed kubernetes: +This process created two models (one for Ubuntu with microk8s deployed, and +another for cos-lite), and set up cos-lite's endpoints for cross-model +integration. Next, proceed to integrate charmed-kubernetes with COS Lite. -``` -juju deploy charmed-kubernetes -``` +Switch to your charmed-kubernetes model: + +`juju switch ` Consume cos-lite endpoints: @@ -102,7 +103,7 @@ Deploy the grafana-agent: Juju deploy grafana-agent ``` -Relate grafana-agent to k8s and kubernetes-control-plane and kubernetes-worker: +Relate grafana-agent to k8s, kubernetes-control-plane and kubernetes-worker: ``` juju integrate grafana-agent:cos-agent k8s:cos-agent diff --git a/pages/k8s/how-to-operate.md b/pages/k8s/how-to-operate.md index 64ce73e0..84f9f905 100644 --- a/pages/k8s/how-to-operate.md +++ b/pages/k8s/how-to-operate.md @@ -35,7 +35,7 @@ can be added to your cluster, or further configuration made to the default setup which are covered in these guides: - [Configure and use CDK addons](/kubernetes/docs/cdk-addons) -- [Monitor with Grafana/Prometheus](/kubernetes/docs/monitoring) +- [Monitor with COS Lite](/kubernetes/docs/how-to-cos-lite) - [Use K8s Operator Charms](/kubernetes/docs/operator-charms) - [Schedule containers with Volcano](/kubernetes/docs/volcano) - [Use the cluster autoscaler](/kubernetes/docs/autoscaler) From 750bec2f237bf6113ccf0e6d3f2fc8e1081d5fe4 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Tue, 2 Apr 2024 17:28:28 +0000 Subject: [PATCH 06/14] Formatting --- pages/k8s/how-to-cos-lite.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index 58c956a0..f803fd80 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -60,6 +60,8 @@ command): KUBECONFIG=microk8s-config.yaml juju add-k8s microk8s ``` +## Deploying COS Lite on the microk8s cloud + Create a new model for cos-lite on the microk8s cloud and deploy the cos-lite charm: ``` @@ -74,12 +76,12 @@ juju offer grafana:grafana-dashboard juju offer prometheus:receive-remote-write ``` -Check the status of these offerings with juju status --relations to see +Check the status of these offerings with `juju status --relations` to see both grafana and prometheus listed. So far, we've created a model that runs microk8s on Ubuntu, and added that model as a Kubernetes cloud to Juju. We then used this cloud as a substrate -for the cos-lite deployment. We therefore have 2 models on the same controller. +for the COS Lite deployment. We therefore have 2 models on the same controller. This process created two models (one for Ubuntu with microk8s deployed, and From 76fa5bb4a6b139703d67586b9befaac1b2e22037 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Tue, 2 Apr 2024 17:29:49 +0000 Subject: [PATCH 07/14] administrivia --- pages/k8s/how-to-cos-lite.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index f803fd80..ad891b75 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -83,7 +83,6 @@ So far, we've created a model that runs microk8s on Ubuntu, and added that model as a Kubernetes cloud to Juju. We then used this cloud as a substrate for the COS Lite deployment. We therefore have 2 models on the same controller. - This process created two models (one for Ubuntu with microk8s deployed, and another for cos-lite), and set up cos-lite's endpoints for cross-model integration. Next, proceed to integrate charmed-kubernetes with COS Lite. @@ -92,7 +91,7 @@ Switch to your charmed-kubernetes model: `juju switch ` -Consume cos-lite endpoints: +Consume COS Lite endpoints: ``` juju consume cos-lite.grafana From e9090e4046de36199c3cd236e66a2c226573284a Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Tue, 2 Apr 2024 17:37:21 +0000 Subject: [PATCH 08/14] Add text --- pages/k8s/how-to-cos-lite.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index ad891b75..a2715db4 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -87,11 +87,13 @@ This process created two models (one for Ubuntu with microk8s deployed, and another for cos-lite), and set up cos-lite's endpoints for cross-model integration. Next, proceed to integrate charmed-kubernetes with COS Lite. +## Integrating COS Lite with Charmed Kubernetes + Switch to your charmed-kubernetes model: `juju switch ` -Consume COS Lite endpoints: +Consume the COS Lite endpoints: ``` juju consume cos-lite.grafana @@ -128,6 +130,14 @@ admin-password: b9OhxF5ndUDO url: http://10.246.154.87/cos-lite-grafana ``` +The username for this credential is `admin`. + +Congratulations! You now have access to a complete observability stack when you +visit the url and enter the credentials. + +Once you feel ready to dive deeper into your shiny new observability platform, +you can head over to the [COS Lite documentation](https://charmhub.io/topics/canonical-observability-stack). +
From 83a0ca11cd1de1e99732d7156e86b32b85227068 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Tue, 2 Apr 2024 17:44:14 +0000 Subject: [PATCH 09/14] Stuff --- pages/k8s/how-to-cos-lite.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index a2715db4..8b410b9b 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -24,27 +24,26 @@ will help you integrate a COS Lite deployment with a charmed-kubernetes deployme This document assumes you have a controller with an installation of charmed-kubernetes. If this is not your case, refer to -["how-to-install"].() +["how-to-install"](). ## Preparing a platform for COS Lite -First, create a microk8s model to act as a deployment cloud for cos-lite: +First, create a microk8s model to act as a deployment cloud for COS Lite: ``` juju add-model --config logging-config='=DEBUG' \ microk8s-ubuntu aws ``` -Deploy Ubuntu on the microk8s-ubuntu model with the following specifications: +Deploy the Ubuntu charm as an application called microk8s: ``` juju deploy ubuntu microk8s --series=focal --constraints="mem=16G cores=8 root-disk=50G" ``` -The above command deploys the ubuntu charm as an application called microk8s. - -To deploy microk8s on ubuntu, access the unit ubuntu using `juju ssh microk8s/0` -and follow the configuration steps available at: +To actually deploy microk8s on Ubuntu, access the unit ubuntu using `juju ssh +microk8s/0` and follow the configuration steps available at: [Install +Microk8s]() After configuring microk8s, export its kubeconfig file to your current directory: @@ -84,7 +83,7 @@ model as a Kubernetes cloud to Juju. We then used this cloud as a substrate for the COS Lite deployment. We therefore have 2 models on the same controller. This process created two models (one for Ubuntu with microk8s deployed, and -another for cos-lite), and set up cos-lite's endpoints for cross-model +another for COS Lite), and set up COS Lite's endpoints for cross-model integration. Next, proceed to integrate charmed-kubernetes with COS Lite. ## Integrating COS Lite with Charmed Kubernetes From b506537557741ebeaf57ce1d484770f5cb3fface Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 3 Apr 2024 19:12:00 +0000 Subject: [PATCH 10/14] Touchups --- pages/k8s/how-to-cos-lite.md | 50 +++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index 8b410b9b..a66c053e 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -19,49 +19,49 @@ solution which will run whether the cluster itself is running or not. It may also be useful to integrate monitoring into existing setups. To make monitoring your cluster a delightful experience, Canonical provides -first-class integration between charmed-kubernetes and COS Lite. This guide -will help you integrate a COS Lite deployment with a charmed-kubernetes deployment. +first-class integration between Charmed Kubernetes and COS Lite. This guide +will help you integrate a COS Lite deployment with a Charmed Kubernetes deployment. This document assumes you have a controller with an installation of -charmed-kubernetes. If this is not your case, refer to -["how-to-install"](). +Charmed Kubernetes. If this is not your case, refer to +["how-to-install"][how-to-install]. ## Preparing a platform for COS Lite -First, create a microk8s model to act as a deployment cloud for COS Lite: +First, create a Microk8s model to act as a deployment cloud for COS Lite: ``` juju add-model --config logging-config='=DEBUG' \ microk8s-ubuntu aws ``` -Deploy the Ubuntu charm as an application called microk8s: +Deploy the Ubuntu charm as an application called "microk8s": ``` juju deploy ubuntu microk8s --series=focal --constraints="mem=16G cores=8 root-disk=50G" ``` -To actually deploy microk8s on Ubuntu, access the unit ubuntu using `juju ssh +To actually deploy Microk8s on Ubuntu, access the Microk8s unit using `juju ssh microk8s/0` and follow the configuration steps available at: [Install -Microk8s]() +Microk8s][how-to-install]. -After configuring microk8s, export its kubeconfig file to your current directory: +After configuring Microk8s, export its kubeconfig file to your current directory: ``` juju ssh microk8s/0 -- microk8s config > microk8s-config.yaml ``` -Now, register microk8s as a Juju cloud (see "[juju -add-k8s"](https://juju.is/docs/juju/juju-add-k8s) for details on the add-k8s +Now, register Microk8s as a Juju cloud (see ["juju +add-k8s"][add-k8s] for details on the add-k8s command): ``` KUBECONFIG=microk8s-config.yaml juju add-k8s microk8s ``` -## Deploying COS Lite on the microk8s cloud +## Deploying COS Lite on the Microk8s cloud -Create a new model for cos-lite on the microk8s cloud and deploy the cos-lite charm: +Create a new model for cos-lite on the Microk8s cloud and deploy the cos-lite charm: ``` juju add-model cos-lite microk8s @@ -78,11 +78,11 @@ juju offer prometheus:receive-remote-write Check the status of these offerings with `juju status --relations` to see both grafana and prometheus listed. -So far, we've created a model that runs microk8s on Ubuntu, and added that +So far, we've created a model that runs Microk8s on Ubuntu, and added that model as a Kubernetes cloud to Juju. We then used this cloud as a substrate for the COS Lite deployment. We therefore have 2 models on the same controller. -This process created two models (one for Ubuntu with microk8s deployed, and +This process created two models (one for Ubuntu with Microk8s deployed, and another for COS Lite), and set up COS Lite's endpoints for cross-model integration. Next, proceed to integrate charmed-kubernetes with COS Lite. @@ -105,7 +105,7 @@ Deploy the grafana-agent: Juju deploy grafana-agent ``` -Relate grafana-agent to k8s, kubernetes-control-plane and kubernetes-worker: +Relate `grafana-agent` to `k8s`, `kubernetes-control-plane` and `kubernetes-worker`: ``` juju integrate grafana-agent:cos-agent k8s:cos-agent @@ -113,18 +113,22 @@ juju integrate grafana-agent:cos-agent kubernetes-control-plane:cos-agent juju integrate grafana-agent:cos-agent kubernetes-worker:cos-agent ``` -Relate grafana-agent to the cos-lite offerings: +Relate `grafana-agent` to the COS Lite offered interfaces: ``` juju integrate grafana-agent grafana juju integrate grafana-agent prometheus ``` -Get the credentials and login url for grafana: +Get the credentials and login URL for Grafana: ``` juju run grafana/0 get-admin-password -m cos-lite +``` + +The above command will output: +``` admin-password: b9OhxF5ndUDO url: http://10.246.154.87/cos-lite-grafana ``` @@ -132,10 +136,16 @@ url: http://10.246.154.87/cos-lite-grafana The username for this credential is `admin`. Congratulations! You now have access to a complete observability stack when you -visit the url and enter the credentials. +visit the URL and enter the credentials. Once you feel ready to dive deeper into your shiny new observability platform, -you can head over to the [COS Lite documentation](https://charmhub.io/topics/canonical-observability-stack). +you can head over to the [COS Lite documentation][cos-lite-docs]. + + + +[how-to-install]: /kubernetes/docs/how-to-install +[add-k8s]: https://juju.is/docs/juju/juju-add-k8s +[cos-lite-docs]: https://charmhub.io/topics/canonical-observability-stack
From 82b847a8519afc73950f27da2b17b65eab08de9f Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 3 Apr 2024 19:37:12 +0000 Subject: [PATCH 11/14] Wording --- pages/k8s/how-to-cos-lite.md | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index a66c053e..50c45d08 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -35,23 +35,23 @@ juju add-model --config logging-config='=DEBUG' \ microk8s-ubuntu aws ``` -Deploy the Ubuntu charm as an application called "microk8s": +Use the Ubuntu charm to deploy an application named “microk8s”: ``` -juju deploy ubuntu microk8s --series=focal --constraints="mem=16G cores=8 root-disk=50G" +juju deploy ubuntu microk8s --series=focal --constraints="mem=8G cores=4 root-disk=30G" ``` -To actually deploy Microk8s on Ubuntu, access the Microk8s unit using `juju ssh -microk8s/0` and follow the configuration steps available at: [Install -Microk8s][how-to-install]. +Deploy Microk8s on Ubuntu by accessing the unit you created at the last step +with `juju ssh microk8s/0`, then follow the [Install Microk8s][how-to-install] +guide for configuration. -After configuring Microk8s, export its kubeconfig file to your current directory: +Export the Microk8s kubeconfig file to your directory after configuration: ``` juju ssh microk8s/0 -- microk8s config > microk8s-config.yaml ``` -Now, register Microk8s as a Juju cloud (see ["juju +Register Microk8s as a Juju cloud using add-k8s (see ["juju add-k8s"][add-k8s] for details on the add-k8s command): @@ -61,36 +61,34 @@ KUBECONFIG=microk8s-config.yaml juju add-k8s microk8s ## Deploying COS Lite on the Microk8s cloud -Create a new model for cos-lite on the Microk8s cloud and deploy the cos-lite charm: +On the Microk8s cloud, create a new model and deploy the cos-lite charm: ``` juju add-model cos-lite microk8s juju deploy cos-lite ``` -Offer cos-lite's endpoints for integration across models: +Make cos-lite’s endpoints available for cross-model integration: ``` juju offer grafana:grafana-dashboard juju offer prometheus:receive-remote-write ``` -Check the status of these offerings with `juju status --relations` to see -both grafana and prometheus listed. +Use juju status --relations to verify that both grafana and prometheus +offerings are listed. -So far, we've created a model that runs Microk8s on Ubuntu, and added that -model as a Kubernetes cloud to Juju. We then used this cloud as a substrate -for the COS Lite deployment. We therefore have 2 models on the same controller. - -This process created two models (one for Ubuntu with Microk8s deployed, and -another for COS Lite), and set up COS Lite's endpoints for cross-model -integration. Next, proceed to integrate charmed-kubernetes with COS Lite. +At this point, you’ve established a Microk8s model on Ubuntu and incorporated +it into Juju as a Kubernetes cloud. You then used this cloud as a substrate for +the COS Lite deployment. You therefore have 2 models on the same controller. ## Integrating COS Lite with Charmed Kubernetes Switch to your charmed-kubernetes model: -`juju switch ` +``` +juju switch +``` Consume the COS Lite endpoints: @@ -135,8 +133,8 @@ url: http://10.246.154.87/cos-lite-grafana The username for this credential is `admin`. -Congratulations! You now have access to a complete observability stack when you -visit the URL and enter the credentials. +You’ve successfully gained access to a comprehensive observability stack. Visit +the URL and use the credentials to log in. Once you feel ready to dive deeper into your shiny new observability platform, you can head over to the [COS Lite documentation][cos-lite-docs]. From 3a513c9745f4b7eba60c59b3f966bc9c7ec37dca Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 3 Apr 2024 20:04:52 +0000 Subject: [PATCH 12/14] Review comments --- pages/k8s/how-to-cos-lite.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index 50c45d08..ca993ba7 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -19,8 +19,9 @@ solution which will run whether the cluster itself is running or not. It may also be useful to integrate monitoring into existing setups. To make monitoring your cluster a delightful experience, Canonical provides -first-class integration between Charmed Kubernetes and COS Lite. This guide -will help you integrate a COS Lite deployment with a Charmed Kubernetes deployment. +first-class integration between Charmed Kubernetes and COS Lite (Canonical +Observability Stack). This guide will help you integrate a COS Lite +deployment with a Charmed Kubernetes deployment. This document assumes you have a controller with an installation of Charmed Kubernetes. If this is not your case, refer to @@ -35,6 +36,11 @@ juju add-model --config logging-config='=DEBUG' \ microk8s-ubuntu aws ``` +We also set the logging level to DEBUG so that helpful debug information is +shown when you use `juju debug-log` (see [juju debug-log][juju-debug-log]). + +Note: If you are unfamiliar with Juju models, the documentation can be found [here][juju-models]. + Use the Ubuntu charm to deploy an application named “microk8s”: ``` @@ -144,6 +150,8 @@ you can head over to the [COS Lite documentation][cos-lite-docs]. [how-to-install]: /kubernetes/docs/how-to-install [add-k8s]: https://juju.is/docs/juju/juju-add-k8s [cos-lite-docs]: https://charmhub.io/topics/canonical-observability-stack +[juju-models]: https://juju.is/docs/juju/model +[juju-debug-log]: https://juju.is/docs/juju/juju-debug-log
From b3a508da05f2b5795c17e9c06a839501c886f75b Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 3 Apr 2024 20:07:33 +0000 Subject: [PATCH 13/14] More review comments --- pages/k8s/how-to-cos-lite.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index ca993ba7..05e82416 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -74,7 +74,7 @@ juju add-model cos-lite microk8s juju deploy cos-lite ``` -Make cos-lite’s endpoints available for cross-model integration: +Make cos-lite’s endpoints available for [cross-model integration][cross-model-integration]: ``` juju offer grafana:grafana-dashboard @@ -90,7 +90,8 @@ the COS Lite deployment. You therefore have 2 models on the same controller. ## Integrating COS Lite with Charmed Kubernetes -Switch to your charmed-kubernetes model: +Switch to your charmed-kubernetes model (if you forgot the name of your model, +you can run `juju models` to see a list of available models): ``` juju switch @@ -152,6 +153,7 @@ you can head over to the [COS Lite documentation][cos-lite-docs]. [cos-lite-docs]: https://charmhub.io/topics/canonical-observability-stack [juju-models]: https://juju.is/docs/juju/model [juju-debug-log]: https://juju.is/docs/juju/juju-debug-log +[cross-model-integration]: https://juju.is/docs/juju/relation#heading--cross-model
From ce094c88df247387d25c30f0ec37859fb27819f9 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 3 Apr 2024 20:14:14 +0000 Subject: [PATCH 14/14] Touchups --- pages/k8s/how-to-cos-lite.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pages/k8s/how-to-cos-lite.md b/pages/k8s/how-to-cos-lite.md index 05e82416..e0bcab75 100644 --- a/pages/k8s/how-to-cos-lite.md +++ b/pages/k8s/how-to-cos-lite.md @@ -25,15 +25,14 @@ deployment with a Charmed Kubernetes deployment. This document assumes you have a controller with an installation of Charmed Kubernetes. If this is not your case, refer to -["how-to-install"][how-to-install]. +["Installing Charmed Kubernetes"][how-to-install]. ## Preparing a platform for COS Lite First, create a Microk8s model to act as a deployment cloud for COS Lite: ``` -juju add-model --config logging-config='=DEBUG' \ - microk8s-ubuntu aws +juju add-model --config logging-config='=DEBUG' microk8s-ubuntu aws ``` We also set the logging level to DEBUG so that helpful debug information is @@ -48,10 +47,10 @@ juju deploy ubuntu microk8s --series=focal --constraints="mem=8G cores=4 root-di ``` Deploy Microk8s on Ubuntu by accessing the unit you created at the last step -with `juju ssh microk8s/0`, then follow the [Install Microk8s][how-to-install] +with `juju ssh microk8s/0` and following the [Install Microk8s][how-to-install] guide for configuration. -Export the Microk8s kubeconfig file to your directory after configuration: +Export the Microk8s kubeconfig file to your current directory after configuration: ``` juju ssh microk8s/0 -- microk8s config > microk8s-config.yaml