Skip to content

Commit

Permalink
Fix nodes count
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoflorido committed Mar 22, 2024
1 parent 208cbf6 commit c752b27
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 2 deletions.
30 changes: 30 additions & 0 deletions prev-lxd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
description: "LXD profile for Canonical Kubernetes"
config:
boot.autostart: "true"
linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw cgroup:rw
lxc.cgroup.devices.allow=a
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /sys/module/nf_conntrack/parameters/hashsize
type: disk
aadisable2:
path: /dev/kmsg
source: /dev/kmsg
type: unix-char
aadisable3:
path: /sys/fs/bpf
source: /sys/fs/bpf
type: disk
aadisable4:
path: /proc/sys/net/netfilter/nf_conntrack_max
source: /proc/sys/net/netfilter/nf_conntrack_max
type: disk
75 changes: 75 additions & 0 deletions test-ck-etcd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
default-base: [email protected]/stable
applications:
easyrsa:
charm: easyrsa
channel: stable
revision: 55
resources:
easyrsa: 2
num_units: 1
to:
- "0"
annotations:
bundleURL: /home/mateo/Workspace/Canonical/k8s-operator/.tox/integration/tmp/pytest/test-etcd-g8f10/bundles/test-bundle-etcd.yaml
constraints: arch=amd64
etcd:
charm: etcd
channel: stable
revision: 760
resources:
core: 0
etcd: 3
snapshot: 0
num_units: 1
to:
- "1"
annotations:
bundleURL: /home/mateo/Workspace/Canonical/k8s-operator/.tox/integration/tmp/pytest/test-etcd-g8f10/bundles/test-bundle-etcd.yaml
constraints: arch=amd64
storage:
data: loop,1024M
k8s:
charm: local:k8s-0
channel: stable
num_units: 3
to:
- "2"
- "4"
- "6"
options:
datastore: etcd
annotations:
bundleURL: /home/mateo/Workspace/Canonical/k8s-operator/.tox/integration/tmp/pytest/test-etcd-g8f10/bundles/test-bundle-etcd.yaml
constraints: arch=amd64
k8s-worker:
charm: local:k8s-worker-0
channel: stable
num_units: 2
to:
- "3"
- "5"
annotations:
bundleURL: /home/mateo/Workspace/Canonical/k8s-operator/.tox/integration/tmp/pytest/test-etcd-g8f10/bundles/test-bundle-etcd.yaml
constraints: arch=amd64
machines:
"0":
constraints: arch=amd64
"1":
constraints: arch=amd64
"2":
constraints: arch=amd64
"3":
constraints: arch=amd64
"4":
constraints: arch=amd64
"5":
constraints: arch=amd64
"6":
constraints: arch=amd64
relations:
- - k8s:k8s-cluster
- k8s-worker:cluster
- - etcd:certificates
- easyrsa:client
- - etcd:db
- k8s:etcd
2 changes: 1 addition & 1 deletion tests/integration/data/test-bundle-etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: integration-test-etcd
description: |-
Used to deploy or refresh within an integration test model
series: jammy
series: focal
applications:
easyrsa:
charm: easyrsa
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_etcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ async def ready_nodes(k8s, expected_count):
async def test_nodes_ready(kubernetes_cluster: model.Model):
"""Deploy the charm and wait for active/idle status."""
k8s = kubernetes_cluster.applications["k8s"]
expected_nodes = len(k8s.units)
worker = kubernetes_cluster.applications["k8s-worker"]
expected_nodes = len(k8s.units) + len(worker.units)
await ready_nodes(k8s.units[0], expected_nodes)

0 comments on commit c752b27

Please sign in to comment.