Skip to content

Commit

Permalink
add vault relation
Browse files Browse the repository at this point in the history
  • Loading branch information
kelkawi-a committed Jun 7, 2024
1 parent 508eb77 commit 3d9e5d7
Show file tree
Hide file tree
Showing 22 changed files with 1,338 additions and 163 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ jobs:
- integration-charm
- integration-scaling
- integration-upgrades
- integration-vault
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
juju-channel: 3.2/stable
juju-channel: 3.1/stable
provider: microk8s
microk8s-addons: "ingress storage dns rbac registry"
channel: 1.25-strict/stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_and_publish_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
with:
integration-test-provider: microk8s
integration-test-provider-channel: 1.25-strict/stable
integration-test-juju-channel: 3.2/stable
integration-test-juju-channel: 3.1/stable
integration-test-modules: '["test_charm"]'
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ juju scale-application temporal-worker-k8s <num_of_replicas_required_replicas>
The Temporal worker operator has a built-in Sentry interceptor which can be used
to intercept and capture errors from the Temporal SDK. To enable it, run the
following command:
following commands:
```bash
juju config temporal-worker-k8s sentry-dsn=<YOUR_SENTRY_DSN>
Expand All @@ -116,8 +116,8 @@ juju config temporal-worker-k8s sentry-environment="staging"

The Temporal worker operator charm can be related to the
[Canonical Observability Stack](https://charmhub.io/topics/canonical-observability-stack)
in order to collect logs and telemetry.
To deploy cos-lite and expose its endpoints as offers, follow these steps:
in order to collect logs and telemetry. To deploy cos-lite and expose its
endpoints as offers, follow these steps:

```bash
# Deploy the cos-lite bundle:
Expand All @@ -137,14 +137,25 @@ juju relate temporal-worker-k8s admin/cos.loki
juju relate temporal-worker-k8s admin/cos.prometheus
```


```bash
# Access grafana with username "admin" and password:
juju run grafana/0 -m cos get-admin-password --wait 1m
# Grafana is listening on port 3000 of the app ip address.
# Dashboard can be accessed under "Temporal Worker SDK Metrics", make sure to select the juju model which contains your Temporal worker operator charm.
```

## Vault

The Temporal worker operator charm can be related to the
[Vault operator charm](https://charmhub.io/vault-k8s) to securely store
credentials that can be accessed by workflows. To enable this, run the following
commands:

```bash
juju deploy vault-k8s --channel edge
juju relate temporal-worker-k8s vault-k8s
```

## Contributing

This charm is still in active development. Please see the
Expand Down
10 changes: 5 additions & 5 deletions lib/charms/prometheus_k8s/v0/prometheus_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __init__(self, *args):
- `scrape_timeout`
- `proxy_url`
- `relabel_configs`
- `metrics_relabel_configs`
- `metric_relabel_configs`
- `sample_limit`
- `label_limit`
- `label_name_length_limit`
Expand Down Expand Up @@ -362,7 +362,7 @@ def _on_scrape_targets_changed(self, event):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 45
LIBPATCH = 47

PYDEPS = ["cosl"]

Expand All @@ -377,7 +377,7 @@ def _on_scrape_targets_changed(self, event):
"scrape_timeout",
"proxy_url",
"relabel_configs",
"metrics_relabel_configs",
"metric_relabel_configs",
"sample_limit",
"label_limit",
"label_name_length_limit",
Expand Down Expand Up @@ -521,8 +521,8 @@ def expand_wildcard_targets_into_individual_jobs(
# for such a target. Therefore labeling with Juju topology, excluding the
# unit name.
non_wildcard_static_config["labels"] = {
**non_wildcard_static_config.get("labels", {}),
**topology.label_matcher_dict,
**non_wildcard_static_config.get("labels", {}),
}

non_wildcard_static_configs.append(non_wildcard_static_config)
Expand All @@ -547,9 +547,9 @@ def expand_wildcard_targets_into_individual_jobs(
if topology:
# Add topology labels
modified_static_config["labels"] = {
**modified_static_config.get("labels", {}),
**topology.label_matcher_dict,
**{"juju_unit": unit_name},
**modified_static_config.get("labels", {}),
}

# Instance relabeling for topology should be last in order.
Expand Down
Loading

0 comments on commit 3d9e5d7

Please sign in to comment.