From 366e6e4a3ab913ac42c7669a10f9b743a397977c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:19:17 +0200 Subject: [PATCH 1/4] chore(deps): update dependency pydantic to v2.9.1 (#286) * chore(deps): update dependency pydantic to v2.9.1 * Pin pg charm revision * Pin pg charm revision --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: arturo-seijas <102022572+arturo-seijas@users.noreply.github.com> Co-authored-by: Arturo Seijas --- requirements.txt | 2 +- tests/integration/conftest.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c5ea65c2..3fd589bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ ops==2.16.1 -pydantic==2.9.0 +pydantic==2.9.1 diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 42271fab..267e2f8d 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -152,6 +152,7 @@ async def app_fixture( "postgresql-k8s", channel="14/stable", series="jammy", + revision=300, trust=True, config={"profile": "testing"}, ) From b1319ec7935ff4d8a63e2d563f94ec301b0f018a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:50:46 +0200 Subject: [PATCH 2/4] chore(deps): update ubuntu:22.04 docker digest to 58b8789 (#288) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- discourse_rock/rockcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discourse_rock/rockcraft.yaml b/discourse_rock/rockcraft.yaml index f732a276..d6d5916f 100644 --- a/discourse_rock/rockcraft.yaml +++ b/discourse_rock/rockcraft.yaml @@ -5,7 +5,7 @@ name: discourse summary: Discourse rock description: Discourse OCI image for the Discourse charm base: ubuntu@22.04 -# renovate: base: ubuntu:22.04@sha256:adbb90115a21969d2fe6fa7f9af4253e16d45f8d4c1e930182610c4731962658 +# renovate: base: ubuntu:22.04@sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe run-user: _daemon_ # UID/GID 584792 license: Apache-2.0 version: "1.0" From 69de27cadd1b281e0f6ef81b5c0dc988345abafa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:19:52 +0200 Subject: [PATCH 3/4] chore(deps): update dependency pydantic to v2.9.2 (#289) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3fd589bd..20774a7c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ ops==2.16.1 -pydantic==2.9.1 +pydantic==2.9.2 From 4b7206ebd86a8352709189877cbb5c3d03a01fb8 Mon Sep 17 00:00:00 2001 From: Erin Conley Date: Wed, 18 Sep 2024 13:18:06 -0400 Subject: [PATCH 4/4] Update tutorial (#290) * ISD-2258: Update title Move away from "Getting started" and toward convention of "Deploy X charm for the first time" * ISD-2267: What you'll do & Requirements Reformatted the preexisting text into a "What you'll do" section Small changes to the Requirements section * Add headers that separate tutorial steps Moved "set up environment" into its own section * Update tutorial.md Changes for conciseness Add some code blocks Change `relate` to `integrate` * ISD-2282: Clean up environment section --------- Co-authored-by: arturo-seijas <102022572+arturo-seijas@users.noreply.github.com> --- docs/tutorial.md | 64 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/docs/tutorial.md b/docs/tutorial.md index f09b838a..664d49de 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -1,26 +1,34 @@ -# Getting started +# Deploy the Discourse charm for the first time -In this tutorial, we'll walk you through the process of deploying the Discourse charm, relating it to the nginx-ingress-integrator charm, the postgresql-k8s charm and the redis-k8s charm, and inspecting the kubernetes resources created. +## What you'll do -## Requirements +- Deploy the Discourse charm +- Integrate with nginx-ingress-integrator, postgresql-k8s and redis-k8s charms +- Inspect the Kubernetes resources created -You will need: +In this tutorial, we'll go through each step of the process to get a basic Discourse deployment. -* A laptop or desktop running Ubuntu (or you can use a VM). -* [Juju and Microk8s](https://juju.is/docs/olm/microk8s) installed. We’ll also want to make sure the ingress add-on is enabled, which we can do by running `microk8s enable ingress`. +## Requirements -## Deploy this charm +* A laptop or desktop running Ubuntu (or you can use a VM). +* Juju and [Microk8s](https://juju.is/docs/olm/microk8s) installed. We’ll also want to make sure the ingress add-on is enabled, which we can do by running `microk8s enable ingress`. -Discourse requires connections to PostgreSQL and Redis, so those will be deployed too and related to the Discourse charm. For more information, see the [Charm Architecture](https://charmhub.io/discourse-k8s/docs/charm-architecture). +## Steps -> NOTE: Discourse requires PostgreSQL extensions to be available in the relation. +### Set up environment -All the above charms will the deployed in a new model named `discourse`: +To easily clean up the resources and separate your workload from the contents of this tutorial, set up a new Juju model named `discourse`: ``` juju add-model discourse ``` +### Deploy the charms + +Discourse requires connections to PostgreSQL and Redis. For more information, see the [Charm Architecture](https://charmhub.io/discourse-k8s/docs/charm-architecture). + +> NOTE: Discourse requires PostgreSQL extensions to be available in the relation. + Deploy the charms: ``` juju deploy redis-k8s --channel latest/edge @@ -34,13 +42,15 @@ juju config postgresql-k8s plugin_hstore_enable=True juju config postgresql-k8s plugin_pg_trgm_enable=True ``` -Relate `redis-k8s` and `postgresql-k8s` to `discourse-k8s`: +### Integrate the charms + +Integrate `redis-k8s` and `postgresql-k8s` to `discourse-k8s`: ``` -juju relate redis-k8s discourse-k8s -juju relate discourse-k8s postgresql-k8s +juju integrate redis-k8s discourse-k8s +juju integrate discourse-k8s postgresql-k8s ``` -By running `juju status --relations` the current state of the deployment can be queried, with all the charms eventually reaching `Active`state: +By running `juju status --relations` the current state of the deployment can be queried: ``` Model Controller Cloud/Region Version SLA Timestamp discourse microk8s microk8s/localhost 3.1.7 unsupported 12:48:02+02:00 @@ -64,6 +74,7 @@ postgresql-k8s:upgrade postgresql-k8s:upgrade upgrade redis-k8s:redis discourse-k8s:redis redis regular redis-k8s:redis-peers redis-k8s:redis-peers redis-peers peer ``` +The deployment finishes when all the charms show `Active` states. Run `kubectl get pods -n discourse` to see the pods that are being created by the charms: ``` @@ -74,22 +85,37 @@ discourse-k8s-0 2/2 Running 0 5m1s postgresql-k8s-0 2/2 Running 0 5m9s ``` -In order to expose the charm, the Nginx Ingress Integrator is to be deployed alongside Discourse to provide ingress capabilities +### Provide ingress capabilities + +In order to expose the charm, the Nginx Ingress Integrator needs to be deployed and integrated with Discourse: ``` juju deploy nginx-ingress-integrator # If your cluster has RBAC enabled you'll be prompted to run the following: juju trust nginx-ingress-integrator --scope=cluster -juju relate discourse-k8s nginx-ingress-integrator +juju integrate discourse-k8s nginx-ingress-integrator ``` -To create an admin user, run: +### Create an admin user and log in + +To create an admin user, use the `create-user` action: ``` juju run discourse-k8s/0 create-user admin=true email=email@example.com ``` -The command will return the password of the created user. Discourse will be deployed with `discourse-k8s` as default hostname. In order to reach it, modify your `/etc/hosts` file so that it points to `127.0.0.1` +The command will return the password of the created user. Discourse will be deployed with `discourse-k8s` as default hostname. In order to reach it, modify your `/etc/hosts` file so that it points to `127.0.0.1`: -`echo 127.0.0.1 discourse-k8s >> /etc/hosts` +``` +echo 127.0.0.1 discourse-k8s >> /etc/hosts +``` After that, visit `http://discourse-k8s` to reach Discourse, using the credentials returned from the `create-user` action to login. + +### Clean up the environment + +Congratulations! You have successfully finished the Discourse tutorial. You can now remove the +model environment that you've created using the following command: + +``` +juju destroy-model discourse --destroy-storage +```