-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tls overlay #80
Add tls overlay #80
Conversation
I just tried deploying the bundle with the TLS overlay after the Catalogue issue has been closed, and I can conferm that specific problem is solved; Catalogue is now |
Everything eventually settles to active idle, which is good. As per the other test conditions:
|
Following up on my previous comment:
|
update for posterity: apparently fixed in edge |
for my own future benefit:
|
result of my day of sweat:
|
Deployed just now,
And noticed a few issues with the scrape targets:
|
Heads up, @PietroPasotti: I added another relation to the tls overlay between traefik and a new charm, "external-ca". That's how it should be. |
seems to go away after adding the https redirect block to traefik config and restarting a couple of times |
results from testing with traefik's [fix-tls branch](https://github.com/canonical/traefik-k8s-o perator/pull/245#event-10405698061):
after copying over the cert as described in traefik's pr description: |
Yeah, IP for SAN doesn't work yet, I suspect because of canonical/tls-certificates-interface#71. |
*"run external-ca/0 get-ca-certificate --format=json --no-color".split() | ||
) | ||
cert = json.loads(stdout)["external-ca/0"]["results"]["ca-certificate"] | ||
cert_path.write_text(cert) |
Check failure
Code scanning / CodeQL
Clear-text storage of sensitive information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After deploying the bundle as indicated in the testing instructions, I have the following:
$ jst
Model Controller Cloud/Region Version SLA Timestamp
cos-lite microk8s microk8s/localhost 3.1.5 unsupported 15:36:51-03:00
App Version Status Scale Charm Channel Rev Address Exposed Message
alertmanager 0.25.0 active 2 alertmanager-k8s edge 92 10.152.183.146 no
avalanche active 2 avalanche-k8s edge 35 10.152.183.89 no
ca active 1 self-signed-certificates edge 37 10.152.183.75 no
catalogue active 1 catalogue-k8s edge 27 10.152.183.204 no
external-ca active 1 self-signed-certificates edge 37 10.152.183.217 no
grafana 9.2.1 active 1 grafana-k8s edge 92 10.152.183.218 no
loki 2.7.4 active 1 loki-k8s edge 99 10.152.183.38 no
prometheus 2.46.0 active 1 prometheus-k8s edge 150 10.152.183.123 no
traefik 2.10.4 active 1 traefik-k8s edge 157 192.168.1.250 no
Unit Workload Agent Address Ports Message
alertmanager/0 active idle 10.1.38.87
alertmanager/1* active idle 10.1.38.98
avalanche/0 active idle 10.1.38.76
avalanche/1* active idle 10.1.38.122
ca/0* active idle 10.1.38.78
catalogue/0* active idle 10.1.38.80
external-ca/0* active idle 10.1.38.102
grafana/0* active idle 10.1.38.109
loki/0* active idle 10.1.38.71
prometheus/0* active idle 10.1.38.70
traefik/0* active idle 10.1.38.73
Relation provider Requirer Interface Type Message
alertmanager:alerting loki:alertmanager alertmanager_dispatch regular
alertmanager:alerting prometheus:alertmanager alertmanager_dispatch regular
alertmanager:grafana-dashboard grafana:grafana-dashboard grafana_dashboard regular
alertmanager:grafana-source grafana:grafana-source grafana_datasource regular
alertmanager:replicas alertmanager:replicas alertmanager_replica peer
alertmanager:self-metrics-endpoint prometheus:metrics-endpoint prometheus_scrape regular
avalanche:metrics-endpoint prometheus:metrics-endpoint prometheus_scrape regular
avalanche:replicas avalanche:replicas avalanche_replica peer
ca:certificates alertmanager:certificates tls-certificates regular
ca:certificates catalogue:certificates tls-certificates regular
ca:certificates grafana:certificates tls-certificates regular
ca:certificates loki:certificates tls-certificates regular
ca:certificates prometheus:certificates tls-certificates regular
ca:send-ca-cert traefik:receive-ca-cert certificate_transfer regular
catalogue:catalogue alertmanager:catalogue catalogue regular
catalogue:catalogue grafana:catalogue catalogue regular
catalogue:catalogue prometheus:catalogue catalogue regular
catalogue:replicas catalogue:replicas catalogue_replica peer
external-ca:certificates traefik:certificates tls-certificates regular
grafana:grafana grafana:grafana grafana_peers peer
grafana:metrics-endpoint prometheus:metrics-endpoint prometheus_scrape regular
grafana:replicas grafana:replicas grafana_replicas peer
loki:grafana-dashboard grafana:grafana-dashboard grafana_dashboard regular
loki:grafana-source grafana:grafana-source grafana_datasource regular
loki:metrics-endpoint prometheus:metrics-endpoint prometheus_scrape regular
loki:replicas loki:replicas loki_replica peer
prometheus:grafana-dashboard grafana:grafana-dashboard grafana_dashboard regular
prometheus:grafana-source grafana:grafana-source grafana_datasource regular
prometheus:prometheus-peers prometheus:prometheus-peers prometheus_peers peer
traefik:ingress alertmanager:ingress ingress regular
traefik:ingress catalogue:ingress ingress regular
traefik:ingress-per-unit loki:ingress ingress_per_unit regular
traefik:ingress-per-unit prometheus:ingress ingress_per_unit regular
traefik:metrics-endpoint prometheus:metrics-endpoint prometheus_scrape regular
traefik:peers traefik:peers traefik_peers peer
traefik:traefik-route grafana:ingress traefik_route regular
Then:
Attempt to manually curl each cos component: juju show-unit catalogue/0 | grep url.
╭─ubuntu@charm-dev-juju-31 ~/repos/cos-lite-bundle ‹feature/tls-overlay●› [microk8s:cos-lite]
╰─$ for i in $(juju show-unit catalogue/0 | grep url: | awk '{print $2}'); do echo $i; done
https://192.168.1.250/cos-lite-catalogue
https://192.168.1.250/cos-lite-grafana
https://192.168.1.250/cos-lite-prometheus-0
http://192.168.1.250/cos-lite-alertmanager
╭─ubuntu@charm-dev-juju-31 ~/repos/cos-lite-bundle ‹feature/tls-overlay●› [microk8s:cos-lite]
╰─$ for i in $(juju show-unit catalogue/0 | grep url: | awk '{print $2}'); do echo "-->" $i: `curl -o /dev/null -sk -w '%{http_code}' $i`; done
--> https://192.168.1.250/cos-lite-catalogue: 502
--> https://192.168.1.250/cos-lite-grafana: 302
--> https://192.168.1.250/cos-lite-prometheus-0: 302
--> https://192.168.1.250/cos-lite-alertmanager: 200
- Catalogue URL is not working
- Alertmanager is using HTTP instead of HTTPS
- Grafana and Prometheus works OK
Make sure all scrape targets are healthy: curl -k https://10.43.8.206/bndl-prometheus-0/api/v1/targets | jq | grep -E "scrapeUrl|health".
Everything is OK:
$ curl -sk https://192.168.1.250/cos-lite-prometheus-0/api/v1/targets | jq | grep -E "scrapeUrl|health"
"scrapeUrl": "https://alertmanager-1.alertmanager-endpoints.cos-lite.svc.cluster.local:9093/metrics",
"health": "up",
"scrapeUrl": "http://10.1.38.76:9001/metrics",
"health": "up",
"scrapeUrl": "http://10.1.38.122:9001/metrics",
"health": "up",
"scrapeUrl": "https://grafana-0.grafana-endpoints.cos-lite.svc.cluster.local:3000/metrics",
"health": "up",
"scrapeUrl": "https://loki-0.loki-endpoints.cos-lite.svc.cluster.local:3100/metrics",
"health": "up",
"scrapeUrl": "http://traefik-0.traefik-endpoints.cos-lite.svc.cluster.local:8082/metrics",
"health": "up",
"scrapeUrl": "https://prometheus-0.prometheus-endpoints.cos-lite.svc.cluster.local:9090/metrics",
"health": "up",
Make sure the watchdog alert from avalanche is firing:
- In prometheus: curl /api/v1/alerts.
- In alertmanager: curl /api/v2/alerts.
Alerts are firing:
Make sure grafana has all the dashboards.
Dashboards in Grafana:
Confirmed findings by @Abuelodelanada:
|
@sed-i Manually tested again. Everything works OK!! |
This PR adds a TLS overlay.
Fixes #78.
Depends on:
mutual_tls
misnomer) traefik-k8s-operator#204stripPrefix
grafana-k8s-operator#257Testing
First, deploy the testing overlay:
We do not have the
receive-ca-cert
relation yet in cos charms, so the external ca would need to be copied in manually:Then:
curl
each cos component:juju show-unit catalogue/0 | grep url
.curl -k https://10.43.8.206/bndl-prometheus-0/api/v1/targets | jq | grep -E "scrapeUrl|health"
.curl <prometheus>/api/v1/alerts
.curl <alertmanager>/api/v2/alerts
.