diff --git a/Makefile b/Makefile index 055a79e4..c7f4f094 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,9 @@ MINI_LAB_SONIC_IMAGE=r.metal-stack.io/vrnetlab/dell_sonic:$(MINI_LAB_DELL_SONIC_ else ifeq ($(MINI_LAB_FLAVOR),capms) LAB_TOPOLOGY=mini-lab.capms.yaml MINI_LAB_SONIC_IMAGE=r.metal-stack.io/vrnetlab/dell_sonic:$(MINI_LAB_DELL_SONIC_VERSION) +else ifeq ($(MINI_LAB_FLAVOR),kamaji) +LAB_TOPOLOGY=mini-lab.sonic.yaml +KAMAJI_ENABLED=true else ifeq ($(MINI_LAB_FLAVOR),gardener) GARDENER_ENABLED=true # usually gardener restricts the maximum version for k8s: diff --git a/README.md b/README.md index 057191fd..bab8c337 100644 --- a/README.md +++ b/README.md @@ -190,11 +190,12 @@ make power-- ## Flavors -There are four flavors of the mini-lab environment: +There are five flavors of the mini-lab environment: - `sonic`: runs two Community SONiC switches - `dell_sonic`: runs two Enterprise SONiC switches with a [locally built vrnetlab image](https://github.com/srl-labs/vrnetlab/tree/master/dell/dell_sonic) - `capms`: runs the `dell_sonic` flavor but with four instead of two machines (this is used for [cluster-provider-metal-stack](https://github.com/metal-stack/cluster-api-provider-metal-stack) in order to have dedicated hosts for control plane / worker / firewall) +- `kamaji`: runs the `sonic` flavor. The working example is available at the [cluster-provider-metal-stack](https://github.com/metal-stack/cluster-api-provider-metal-stack)'s `capi-lab`. - `gardener`: runs the `sonic` flavor and installs the [Gardener](https://gardener.cloud) in the mini-lab In order to start specific flavor, you can define the flavor as follows: diff --git a/compose.yaml b/compose.yaml index 8c2aa709..eb2967ef 100644 --- a/compose.yaml +++ b/compose.yaml @@ -21,6 +21,7 @@ services: - DOCKER_HUB_USER=${DOCKER_HUB_USER} - DOCKER_HUB_TOKEN=${DOCKER_HUB_TOKEN} - GARDENER_ENABLED=${GARDENER_ENABLED:-} + - KAMAJI_ENABLED=${KAMAJI_ENABLED:-} - MONITORING_ENABLED=${MONITORING_ENABLED:-} network_mode: host working_dir: /mini-lab diff --git a/deploy_control_plane.yaml b/deploy_control_plane.yaml index 6fe5a2b4..9fa47a36 100644 --- a/deploy_control_plane.yaml +++ b/deploy_control_plane.yaml @@ -41,3 +41,7 @@ - name: deploy gardener import_playbook: deploy_gardener.yaml when: gardener_enabled + +- name: deploy kamaji + import_playbook: deploy_kamaji.yaml + when: kamaji_enabled diff --git a/deploy_kamaji.yaml b/deploy_kamaji.yaml new file mode 100644 index 00000000..7d1f0488 --- /dev/null +++ b/deploy_kamaji.yaml @@ -0,0 +1,13 @@ +--- +- name: deploy kamaji + hosts: control-plane + connection: local + gather_facts: false + + roles: + - name: ansible-common + tags: always + - name: kamaji + tags: kamaji + # vars: + # metal_control_plane_host_provider: metal diff --git a/docs/overview-kamaji.drawio.svg b/docs/overview-kamaji.drawio.svg new file mode 100644 index 00000000..f6e083c1 --- /dev/null +++ b/docs/overview-kamaji.drawio.svg @@ -0,0 +1,751 @@ + + + + + + + + + + + + + + + + + +
+
+
+ + linux-desktop + +
+
+
+
+ + linux-desktop + +
+
+
+ + + + + + + + + + + + + +
+
+
+ + + containerlab + + +
+
+
+
+ + containerlab + +
+
+
+ + + + + + + + + +
+
+
+ + + kind-cluster + + +
+
+
+
+ + kind-cluster + +
+
+
+ + + + + + + + + + +
+
+
+ metal-stack +
+
+
+
+ + metal-stack + +
+
+
+ + + + + + + + + + + + + + + + +
+
+
+ partition +
+
+
+
+ + partition + +
+
+
+ + + + + + + + + + +
+
+
+ + machine02/ + +
+ + firewall + +
+
+
+
+
+ + machine02/... + +
+
+
+ + + + + + + +
+
+
+ tenantnetwork +
+
+
+
+ + tenantnetwork + +
+
+
+ + + + + + + + + + + + + + +
+
+
+ leaf02 +
+
+
+
+ + leaf02 + +
+
+
+ + + + + + + +
+
+
+ metal-core +
+
+
+
+ + metal-core + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ masterdata-api +
+
+
+
+ + masterdata-api + +
+
+
+ + + + + + + auditing + + + + + + + + + + + + + +
+
+
+ metal-db +
+
+
+
+ + metal-db + +
+
+
+ + + + + + + + + + +
+
+
+ ipam-db +
+
+
+
+ + ipam-db + +
+
+
+ + + + + + + +
+
+
+ ipam +
+
+
+
+ + ipam + +
+
+
+ + + + + + + +
+
+
+ nsqd +
+
+
+
+ + nsqd + +
+
+
+ + + + + + + +
+
+
+ metal-api +
+
+
+
+ + metal-api + +
+
+
+ + + + + + + + + + + + + +
+
+
+ masterdata-db +
+
+
+
+ + masterdata-... + +
+
+
+ + + + + + + + +
+
+
+ capi-lab +
+
+
+
+ + capi-lab + +
+
+
+ + + + + + + +
+
+
+ docker network 172.17.0.1/16 +
+
+
+
+ + docker network 172.17.0.1/16 + +
+
+
+ + + + + + + +
+
+
+ Ingress-Controller (NGINX) +
+
+
+
+ + Ingress-Controller (... + +
+
+
+ + + + + + + + + + +
+
+
+ machine01 +
+
+
+
+ + machine01 + +
+
+
+ + + + + + + +
+
+
+ exit +
+
+
+
+ + exit + +
+
+
+ + + + + + + + + + + +
+
+
+ leaf01 +
+
+
+
+ + leaf01 + +
+
+
+ + + + + + + + + + +
+
+
+ metal-core +
+
+
+
+ + metal-core + +
+
+
+ + + + + + + + + + +
+
+
+ veth link +
+
+
+
+ + veth link + +
+
+
+ + + + + + + + + + +
+
+
+ Kamaji Management Cluster +
+
+
+
+ + Kamaji Management Cluster + +
+
+
+ + + + + + + + + + + + + +
+
+
+ tenant control plane A +
+
+
+
+ + tenant control plane A + +
+
+
+ + + + + + + + + + Multi-Tenant + + + Datastore + + + + + + + + + + + + + + + + + +
+
+
+ tenant control plane B +
+
+
+
+ + tenant control plane B + +
+
+
+ + + + + + + +
+
+
+ CAPMS (ClusterAPI Provider) +
+
+
+
+ + CAPMS (ClusterAPI Provider) + +
+
+
+ + + +
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file diff --git a/inventories/group_vars/control-plane/kamaji.yaml b/inventories/group_vars/control-plane/kamaji.yaml new file mode 100644 index 00000000..0e4c6f4d --- /dev/null +++ b/inventories/group_vars/control-plane/kamaji.yaml @@ -0,0 +1,2 @@ +--- +kamaji_enabled: "{{ lookup('env', 'KAMAJI_ENABLED') | default('', false) }}" diff --git a/roles/kamaji/tasks/main.yaml b/roles/kamaji/tasks/main.yaml new file mode 100644 index 00000000..edf6fda0 --- /dev/null +++ b/roles/kamaji/tasks/main.yaml @@ -0,0 +1,31 @@ +--- +- name: Add jetstack repo + kubernetes.core.helm_repository: + name: jetstack + repo_url: https://charts.jetstack.io + +- name: Add clastix repo + kubernetes.core.helm_repository: + name: clastix + repo_url: https://clastix.github.io/charts + +- name: Deploy cert manager + kubernetes.core.helm: + chart_ref: jetstack/cert-manager + name: kamaji-cert-manager + release_namespace: kamaji-cert-manager + create_namespace: true + wait: true + set_values: + - value: installCRDs=true + +- name: Deploy kamaji + kubernetes.core.helm: + chart_ref: clastix/kamaji + chart_version: 0.0.0+latest + name: kamaji + release_namespace: kamaji-system + create_namespace: true + wait: true + set_values: + - value: image.tag=latest