Skip to content

Commit 099dd1f

Browse files
authored
feat(server-charm): support ingress interface and remove traefik_route (#1123)
* feat(server-charm): replace traefik route with ingress configurator * tests: update unit tests * test: integration test to validate ingress end to end * ci: modify server-tox to support bootstraping lxd * tests: update integration tests * review: add copilot suggestions * add coverage and add fix * fix juju cli * fix integration * collect juju logs as artifact * resolve merge conflicts
1 parent c702583 commit 099dd1f

15 files changed

Lines changed: 1441 additions & 912 deletions

File tree

.github/workflows/server-tox.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,18 @@ jobs:
106106
- name: Install concierge
107107
run: sudo snap install --classic concierge
108108
- name: Prepare Juju
109-
run: sudo concierge prepare --verbose --juju-channel=3/stable --charmcraft-channel=latest/stable -p microk8s
110-
- name: Enable MicroK8s ingress
111-
run: sudo microk8s enable ingress
109+
run: sudo concierge prepare --verbose
110+
- name: Export Juju controller names
111+
run: |
112+
K8S_CONTROLLER=$(juju controllers --format=json | jq -r '.controllers | to_entries[] | select(.value.cloud == "microk8s") | .key')
113+
LXD_CONTROLLER=$(juju controllers --format=json | jq -r '.controllers | to_entries[] | select(.value.cloud == "localhost") | .key')
114+
if [[ -z "$K8S_CONTROLLER" || -z "$LXD_CONTROLLER" ]]; then
115+
echo "Failed to detect Juju controllers (microk8s='$K8S_CONTROLLER', localhost='$LXD_CONTROLLER')"
116+
juju controllers
117+
exit 1
118+
fi
119+
echo "JUJU_K8S_CONTROLLER=$K8S_CONTROLLER" >> "$GITHUB_ENV"
120+
echo "JUJU_MACHINE_CONTROLLER=$LXD_CONTROLLER" >> "$GITHUB_ENV"
112121
- name: Pack charm
113122
run: charmcraft pack --verbose
114123
- name: Upload charm as an artifact
@@ -119,8 +128,12 @@ jobs:
119128
if-no-files-found: error
120129
retention-days: 2
121130
- name: Run charm integration tests
122-
run: uvx --with tox-uv tox -e integration -- --juju-dump-logs logs
123-
- name: Upload logs
131+
env:
132+
JUJU_K8S_CONTROLLER: ${{ env.JUJU_K8S_CONTROLLER }}
133+
JUJU_MACHINE_CONTROLLER: ${{ env.JUJU_MACHINE_CONTROLLER }}
134+
JUJU_DUMP_LOGS_DIR: logs
135+
run: uvx --with tox-uv tox -e integration
136+
- name: Upload Juju logs
124137
if: ${{ !cancelled() }}
125138
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
126139
with:

server/charm/charmcraft.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ requires:
3232
nginx-route:
3333
interface: nginx-route
3434
limit: 1
35-
traefik-route:
36-
interface: traefik_route
35+
ingress:
36+
interface: ingress
3737
limit: 1
3838

3939
provides:
@@ -57,8 +57,8 @@ charm-libs:
5757
version: "0"
5858
- lib: grafana_k8s.grafana_dashboard
5959
version: "0"
60-
- lib: traefik_k8s.traefik_route
61-
version: "0"
60+
- lib: traefik_k8s.ingress
61+
version: "2"
6262

6363
base: ubuntu@22.04
6464
platforms:

server/charm/concierge.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
juju:
2+
channel: 3/stable
3+
providers:
4+
microk8s:
5+
enable: true
6+
bootstrap: true
7+
addons:
8+
- hostpath-storage
9+
- dns
10+
- metallb:10.64.140.43-10.64.140.49
11+
- ingress
12+
lxd:
13+
enable: true
14+
bootstrap: true
15+
host:
16+
packages:
17+
- python3-pip
18+
- python3-venv
19+
snaps:
20+
astral-uv:
21+
channel: latest/stable
22+
charmcraft:
23+
channel: latest/stable
24+
jhack:
25+
channel: latest/edge
26+
connections:
27+
- jhack:dot-local-share-juju

0 commit comments

Comments
 (0)