---
title: Charmhub | Deploy Hockeypuck K8S Charm using Charmhub - The Open Operator Collection
description: Deploy the latest version of Hockeypuck K8S Charm as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started
---

# Hockeypuck K8S Charm

[Canonical IS DevOps](https://charmhub.io/publisher/canonical-is-devops "View all packages from Canonical IS DevOps")

* [Canonical IS DevOps](https://charmhub.io/publisher/canonical-is-devops "View all packages from Canonical IS DevOps")

Platform:

2.2/stable 20

```
juju deploy hockeypuck-k8s --channel 2.2/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Contacts

##### Maintainers

+ [Launchpad Team](https://launchpad.net/~canonical-is-devops)

* [Submit a bug](https://github.com/canonical/hockeypuck-k8s-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Deploy the Hockeypuck charm for the first time

## [What you’ll do](https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started#p-37639-what-youll-do)

* Deploy the [Hockeypuck charm](https://charmhub.io/hockeypuck-k8s)
* Access the Hockeypuck web UI

By the end of this tutorial, you’ll have a working Hockeypuck server running on a Kubernetes cluster managed by Juju.

### [What you’ll need](https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started#p-37639-what-youll-need)

* A machine with amd64 architecture.
* Juju 3.x installed.
* Juju MicroK8s controller created and active named `microk8s`, with the [MetalLB addon](https://microk8s.io/docs/addon-metallb) enabled (required for Traefik ingress to work).

All the requirements can be met using the [Multipass charm-dev blueprint](https://documentation.ubuntu.com/juju/3.6/howto/manage-your-deployment/manage-your-deployment-environment/#set-things-up). Use the Multipass VM shell to run all commands in this tutorial.

For more information about how to install Juju, see [Get started with Juju](https://documentation.ubuntu.com/juju/3.6/tutorial/).

### [Set up a tutorial model](https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started#p-37639-set-up-a-tutorial-model)

To easily clean up the resources and to separate your workload from the contents of this tutorial,
set up a new Juju model in the `microk8s` controller with the following command.

```
juju switch microk8s
juju add-model hockeypuck-tutorial
```

### [Deploy the hockeypuck-k8s charm](https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started#p-37639-deploy-the-hockeypuck-k8s-charm)

Deploy the Hockeypuck charm and PostgreSQL charm, and integrate them.

```
juju deploy hockeypuck-k8s --channel=2.2/edge --config metrics-port=9626 --config app-port=11371
juju deploy postgresql-k8s --channel 14/stable --trust
juju integrate hockeypuck-k8s postgresql-k8s
```

Wait for the charm to be active:

```
juju wait-for application hockeypuck-k8s
```

The Hockeypuck application supports only a single unit. Adding more units through the `--num-units`
flag will result in the application entering a blocked state. To achieve redundancy,
deploy multiple independent instances of Hockeypuck and [configure peering](https://charmhub.io/hockeypuck-k8s/docs/how-to-reconcile-between-two-keyservers) between them.

### [Expose Hockeypuck webserver through ingress](https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started#p-37639-expose-hockeypuck-webserver-through-ingress)

Deploy the Traefik charm and integrate it with the Hockeypuck charm:

```
juju deploy traefik-k8s --channel=latest/edge --trust
juju integrate hockeypuck-k8s:ingress traefik-k8s
```

The Traefik charm must be deployed on the same Kubernetes cluster as Hockeypuck charm.

You can check the status with:

```
juju status --relations
```

After a few minutes, the deployment will be finished and all the units should be in
the active status.

Run the following command to retrieve the URL for the Hockeypuck UI:

```
juju run traefik-k8s/0 show-proxied-endpoints --format=yaml
```

The output will be something similar to:

```
Running operation 1 with 1 task
  - task 2 on unit-traefik-k8s-0

Waiting for task 2...
traefik-k8s/0:
  id: "2"
  results:
    proxied-endpoints: '{"traefik-k8s": {"url": "http://10.12.97.102"}, "hockeypuck-k8s":
      {"url": "http://10.12.97.102/hockeypuck-tutorial-hockeypuck-k8s"}}'
    return-code: 0
  status: completed
  timing:
    completed: 2024-09-27 15:09:36 +0200 CEST
    enqueued: 2024-09-27 15:09:35 +0200 CEST
    started: 2024-09-27 15:09:35 +0200 CEST
  unit: traefik-k8s/0
```

In this example, the URL to use in your browser will be `http://10.12.97.102/hockeypuck-tutorial-hockeypuck-k8s`.
The exact IP address may differ depending on your environment. You can now access your Hockeypuck server UI at this URL.

### [Cleaning up the environment](https://charmhub.io/hockeypuck-k8s/docs/tutorial-getting-started#p-37639-cleaning-up-the-environment)

Congratulations! You have successfully finished the Hockeypuck charm tutorial. You can now remove the
model environment that you’ve created using the following command.

```
juju destroy-model hockeypuck-tutorial --destroy-storage
```

---
