{"id":17436113,"url":"https://github.com/jnsgruk/hello-kubecon","last_synced_at":"2025-04-16T03:43:33.167Z","repository":{"id":42427389,"uuid":"360455789","full_name":"jnsgruk/hello-kubecon","owner":"jnsgruk","description":"A Charmed Operator demonstration for Operator Day 2021, hosted by Canonical","archived":false,"fork":false,"pushed_at":"2025-03-24T17:24:18.000Z","size":75,"stargazers_count":15,"open_issues_count":0,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T18:33:59.321Z","etag":null,"topics":["canonical","charm","charmed-operator","demo","juju","kubecon","kubernetes","operator-day","training"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jnsgruk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-22T09:00:47.000Z","updated_at":"2025-03-24T17:24:22.000Z","dependencies_parsed_at":"2024-10-19T08:53:27.364Z","dependency_job_id":"b7c6687e-4fba-4eef-a15d-d86e19ce460f","html_url":"https://github.com/jnsgruk/hello-kubecon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnsgruk%2Fhello-kubecon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnsgruk%2Fhello-kubecon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnsgruk%2Fhello-kubecon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnsgruk%2Fhello-kubecon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnsgruk","download_url":"https://codeload.github.com/jnsgruk/hello-kubecon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249191902,"owners_count":21227674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canonical","charm","charmed-operator","demo","juju","kubecon","kubernetes","operator-day","training"],"created_at":"2024-10-17T10:02:59.368Z","updated_at":"2025-04-16T03:43:33.160Z","avatar_url":"https://github.com/jnsgruk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eOperator Day 2021 Demo Charm\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"500px\" height=\"281px\" src=\"https://res.cloudinary.com/canonical/image/fetch/f_auto,q_auto,fl_sanitize,c_fill,w_720/https://ubuntu.com/wp-content/uploads/1957/Title-Cards-20.png\"/\u003e\n\u003cp\u003e\n  \n\u003ch2 align=\"center\"\u003eContents\u003c/h2\u003e\n\n\u003e [!WARNING]  \n\u003e This charm is now quite out of date. Feel free to follow the example from the YouTube video, but\n\u003e note that charming practices have evolved. For more information, see https://juju.is/docs/sdk,\n\u003e or get in touch with us on the [Ubuntu Matrix](https://ubuntu.com/community/communications/matrix)!\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"#quickstart\"\u003eQuickstart\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"#development-setup\"\u003eDevelopment Setup\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"#build\"\u003eBuild and Deploy Locally\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"#testing\"\u003eTesting\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"#help\"\u003eGet Help \u0026 Community\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"#more\"\u003eMore Information/Related\u003c/a\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\" id=\"overview\"\u003eOverview\u003c/h2\u003e\n\nThis [charm](https://charmhub.io/hello-kubecon) is a demonstration of a charm\nimplemeting the sidecar pattern used during\n[Operator Day 2021](https://www.linkedin.com/events/6788422954821656577/). You\ncan grab the slides from the demo [here](https://jnsgr.uk/demo-slides).\n\nThe charm is written using the\n[Charmed Operator Framework](https://github.com/canonical/operator).\nIt deploys [gosherve](https://github.com/jnsgruk/gosherve), relying upon the\ncharm container to populate a shared volume with a simple\n[landing-page](https://github.com/canonical-web-and-design/kubecon-2021/) style\nwebsite and configure the app before it is started.\n\nSlides for the demo [are available](https://jnsgr.uk/demo-slides) and there\nis a supporting [Github Gist](https://jnsgr.uk/demo-gist) that contains copy-and-\npastable content from the slide deck.\n\nThe finished charm is published [on Charmhub](https://charmhub.io/hello-kubecon).\n\nThe charm will:\n\n- Deploy a container running [gosherve](https://github.com/jnsgruk/gosherve)\n- Fetch a website [from Github](https://jnsgr.uk/demo-site-repo)\n- Place the downloaded file in a storage volume\n- Expose a `redirect-map` config item to configure\n  [gosherve](https://github.com/jnsgruk/gosherve) redirects\n- Expose a `pull-site` action to pull the latest version of the test site\n- Utilise an ingress relation using the\n  [`nginx-ingress-integrator`](https://charmhub.io/nginx-ingress-integrator) library\n\nEach branch of this repository represents a different stage from the demonstration:\n\n- [`1-specify-workload`](https://github.com/jnsgruk/hello-kubecon/tree/1-specify-workload)\n- [`2-handle-configuration`](https://github.com/jnsgruk/hello-kubecon/tree/2-handle-configuration)\n- [`3-storage`](https://github.com/jnsgruk/hello-kubecon/tree/3-storage)\n- [`4-action`](https://github.com/jnsgruk/hello-kubecon/tree/4-action)\n- [`5-ingress`](https://github.com/jnsgruk/hello-kubecon/tree/5-ingress)\n- [`master`](https://github.com/jnsgruk/hello-kubecon/)\n\n\u003ch2 align=\"center\" id=\"quickstart\"\u003eQuickstart\u003c/h2\u003e\n\nAssuming you already have Juju installed and bootstrapped on a cluster (if you\ndo not, see the next section):\n\n```bash\n# Create a juju model\n$ juju add-model dev\n# Deploy the charm\n$ juju deploy hello-kubecon\n# Deploy the ingress charm\n$ juju deploy traefik-k8s --trust\n$ juju config traefik-k8s external_hostname=juju.local\n$ juju config traefik-k8s routing_mode=subdomain\n# Relate our app to the ingress\n$ juju relate hello-kubecon traefik-k8s\n# Wait for the deployment to complete\n$ watch -n1 --color juju status --color\n# Add an entry to /etc/hosts\n$ echo \"\u003ctraefik-k8s-address\u003e dev-hello-kubecon.juju.local\" | sudo tee -a /etc/hosts\n```\n\nYou should be able to visit [http://dev-hello-kubecon.juju.local](http://dev-hello-kubecon.juju.local)\nin your browser.\n\n\u003ch2 align=\"center\" id=\"development-setup\"\u003eDevelopment Setup\u003c/h2\u003e\n\nTo set up a local test environment with [MicroK8s](https://microk8s.io):\n\n```bash\n# Install MicroK8s\n$ sudo snap install --classic microk8s\n# Wait for MicroK8s to be ready\n$ sudo microk8s status --wait-ready\n# Enable features required by Juju controller \u0026 charm\n$ sudo microk8s enable storage dns metallb\n# (Optional) Alias kubectl bundled with MicroK8s package\n$ sudo snap alias microk8s.kubectl kubectl\n# (Optional) Add current user to 'microk8s' group\n# This avoid needing to use 'sudo' with the 'microk8s' command\n$ sudo usermod -aG microk8s $(whoami)\n# Activate the new group (in the current shell only)\n# Log out and log back in to make the change system-wide\n$ newgrp microk8s\n# Install Charmcraft\n$ sudo snap install charmcraft\n# Install juju\n$ sudo snap install --classic juju\n# Bootstrap the Juju controller on MicroK8s\n$ juju bootstrap microk8s micro\n# Add a new model to Juju\n$ juju add-model dev\n```\n\n\u003ch2 align=\"center\" id=\"build\"\u003eBuild and Deploy Locally\u003c/h2\u003e\n\n```bash\n# Clone the charm code\n$ git clone https://github.com/jnsgruk/hello-kubecon \u0026\u0026 cd hello-kubecon\n# Build the charm package\n$ charmcraft pack\n# Create a juju model\n$ juju add-model dev\n# Deploy!\n$ juju deploy ./hello-kubecon_ubuntu-20.04-amd64.charm --resource gosherve-image=jnsgruk/gosherve:latest\n# Deploy the ingress charm\n$ juju deploy traefik-k8s --trust\n$ juju config traefik-k8s external_hostname=juju.local\n$ juju config traefik-k8s routing_mode=subdomain\n# Relate our app to the ingress\n$ juju relate hello-kubecon traefik-k8s\n# Wait for the deployment to complete\n$ watch -n1 --color juju status --color\n# Add an entry to /etc/hosts\n$ echo \"\u003ctraefik-k8s-address\u003e dev-hello-kubecon.juju.local\" | sudo tee -a /etc/hosts\n```\n\nYou should be able to visit [http://dev-hello-kubecon.juju.local](http://dev-hello-kubecon.juju.local)\nin your browser.\n\n\u003ch2 align=\"center\" id=\"testing\"\u003eTesting\u003c/h2\u003e\n\n```bash\n# Clone the charm code\n$ git clone https://github.com/jnsgruk/hello-kubecon \u0026\u0026 cd hello-kubecon\n# Install python3-virtualenv\n$ sudo apt update \u0026\u0026 sudo apt install -y python3-virtualenv\n# Create a virtualenv for the charm code\n$ virtualenv venv\n# Activate the venv\n$ source ./venv/bin/activate\n# Install dependencies\n$ pip install -r requirements-dev.txt\n# Run the tests\n$ ./run_tests\n```\n\n\u003ch2 align=\"center\" id=\"help\"\u003eGet Help \u0026 Community\u003c/h2\u003e\n\nIf you get stuck deploying this charm, or would like help with charming\ngenerally, come and join the charming community!\n\n- [Community Discourse](https://discourse.charmhub.io)\n- [Community Chat](https://chat.charmhub.io/charmhub/channels/creating-charmed-operators)\n\n\u003ch2 align=\"center\" id=\"more\"\u003eMore Information/Related\u003c/h2\u003e\n\nBelow are some links related to this demonstration:\n\n- [Charmed Operator Framework Documentation](https://juju.is/docs/sdk)\n- [Charmed Operator Framework Source](https://github.com/canonical/operator)\n- [Juju Documentation](https://juju.is/docs/olm)\n- [Charmhub](https://charmhub.io)\n- [Pebble](https://github.com/canonical/github)\n- [The Future of Charmed Operators on Kubernetes](https://discourse.charmhub.io/t/4361)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnsgruk%2Fhello-kubecon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnsgruk%2Fhello-kubecon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnsgruk%2Fhello-kubecon/lists"}