-
Notifications
You must be signed in to change notification settings - Fork 14
add kamaji flavor #280
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
Open
mac641
wants to merge
10
commits into
master
Choose a base branch
from
kamaji
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+944
−1
Open
add kamaji flavor #280
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
024734b
feat: add kamaji flavor
mac641 60e96d7
refactor(kamaji): move kamaji management control-plane creation to ca…
mac641 e4e4282
Merge branch 'master' into kamaji
mac641 9ef1ed1
fix(kamaji): typos
mac641 8af8772
fix(kamaji): fix helm chart values and typos
mac641 16b0370
fix(kamaji): add missing clastix helm_repository
mac641 1ac9fe3
docs: add kamaji overview
ma-hartma 8485838
docs(kamaji): add reference to capi-lab
mac641 bffc985
add own topology for kamaji and install metallb with ip address pool
ma-hartma fb9ac42
fix(kamaji): add creation of kamaji tenant control plane kubernetes n…
mac641 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| kamaji_enabled: "{{ lookup('env', 'KAMAJI_ENABLED') | default('', false) }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # flavor for mini-lab kamaji with cluster-api-provider-metal-stack | ||
| name: mini-lab | ||
| prefix: "" | ||
|
|
||
| mgmt: | ||
| network: mini_lab_ext | ||
|
|
||
| topology: | ||
| defaults: | ||
| kind: linux | ||
| nodes: | ||
| # make metal-control-plane accessible via mini_lab_ext | ||
| metal-control-plane-control-plane: | ||
| kind: ext-container | ||
| exec: | ||
| - ip route add 203.0.113.128/25 via 203.0.113.128 dev eth0 | ||
| exit: | ||
| image: quay.io/frrouting/frr:10.3.0 | ||
| network-mode: none | ||
| binds: | ||
| - files/exit/daemons:/etc/frr/daemons | ||
| - files/exit/frr.conf:/etc/frr/frr.conf | ||
| - files/exit/vtysh.conf:/etc/frr/vtysh.conf | ||
| - files/exit/network.sh:/root/network.sh | ||
| exec: | ||
| - sh /root/network.sh | ||
| external_service: | ||
| image: docker.io/library/nginx:alpine-slim | ||
| network-mode: none | ||
| binds: | ||
| - files/external_service/network.sh:/root/network.sh | ||
| exec: | ||
| - sh /root/network.sh | ||
| mini_lab_ext: | ||
| kind: bridge | ||
| leaf01: | ||
| group: leaves | ||
| image: ${MINI_LAB_SONIC_IMAGE} | ||
| binds: | ||
| - files/ssh/id_rsa.pub:/authorized_keys | ||
| env: | ||
| QEMU_MEMORY: 4096 | ||
| leaf02: | ||
| group: leaves | ||
| image: ${MINI_LAB_SONIC_IMAGE} | ||
| binds: | ||
| - files/ssh/id_rsa.pub:/authorized_keys | ||
| env: | ||
| QEMU_MEMORY: 4096 | ||
| machine01: | ||
| group: machines | ||
| image: ${MINI_LAB_VM_IMAGE} | ||
| env: | ||
| UUID: 00000000-0000-0000-0000-000000000001 | ||
| machine02: | ||
| group: machines | ||
| image: ${MINI_LAB_VM_IMAGE} | ||
| env: | ||
| UUID: 00000000-0000-0000-0000-000000000002 | ||
| links: | ||
| - endpoints: ["exit:mini_lab_ext", "mini_lab_ext:exit"] | ||
| mtu: 9000 | ||
| - endpoints: ["external_service:mini_lab_ext", "mini_lab_ext:external_service"] | ||
| mtu: 9000 | ||
| - endpoints: ["leaf01:Ethernet0", "machine01:lan0"] | ||
| - endpoints: ["leaf02:Ethernet0", "machine01:lan1"] | ||
| - endpoints: ["leaf01:Ethernet1", "machine02:lan0"] | ||
| - endpoints: ["leaf02:Ethernet1", "machine02:lan1"] | ||
| - endpoints: ["leaf01:Ethernet120", "exit:eth1"] | ||
| - endpoints: ["leaf02:Ethernet120", "exit:eth2"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| - name: Add jetstack repo | ||
| kubernetes.core.helm_repository: | ||
| name: jetstack | ||
| repo_url: https://charts.jetstack.io | ||
|
|
||
| - name: Add metallb repo | ||
| kubernetes.core.helm_repository: | ||
| name: metallb | ||
| repo_url: https://metallb.github.io/metallb | ||
|
|
||
| - 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: cert-manager | ||
| release_namespace: cert-manager | ||
| create_namespace: true | ||
| wait: true | ||
| set_values: | ||
| - value: installCRDs=true | ||
|
|
||
| # <ai> | ||
| # Claude Opus 4.6 was used to generate the following Ansible tasks based on the provided code snippets and context of | ||
| # the Getting Started guide for Kamaji with kind: https://kamaji.clastix.io/getting-started/kamaji-kind/ | ||
| # They are intended to install metallb with an address pool that matches the kind network. | ||
| - name: Deploy metallb | ||
| kubernetes.core.helm: | ||
| chart_ref: metallb/metallb | ||
| name: metallb | ||
| release_namespace: metallb-system | ||
| create_namespace: true | ||
| wait: true | ||
|
|
||
| - name: Read cluster nodes | ||
| kubernetes.core.k8s_info: | ||
| api_version: v1 | ||
| kind: Node | ||
| register: cluster_nodes | ||
|
|
||
| - name: Find node InternalIP | ||
| ansible.builtin.set_fact: | ||
| kind_node_ip: '{{ item.address }}' | ||
| loop: '{{ cluster_nodes.resources[0].status.addresses }}' | ||
| when: item.type == 'InternalIP' | ||
|
|
||
| - name: Derive MetalLB network prefix | ||
| ansible.builtin.set_fact: | ||
| metallb_kind_net_prefix: "{{ kind_node_ip | regex_replace('^([0-9]+\\.[0-9]+)\\..*$', '\\1') }}" | ||
|
|
||
| - name: Debug MetalLB network prefix | ||
| ansible.builtin.debug: | ||
| msg: 'kind_node_ip={{ kind_node_ip }} metallb_kind_net_prefix={{ metallb_kind_net_prefix }}' | ||
|
|
||
| - name: Apply MetalLB IP address pool | ||
| kubernetes.core.k8s: | ||
| state: present | ||
| template: metallb-kind-ip-pool.yaml | ||
| # </ai> | ||
|
|
||
| - 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 | ||
| - value: resources=null | ||
|
|
||
| - name: Create kamaji tenant cluster namespace | ||
| kubernetes.core.k8s: | ||
| name: kamaji-tenants | ||
| api_version: v1 | ||
| kind: Namespace | ||
| state: present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| apiVersion: metallb.io/v1beta1 | ||
| kind: IPAddressPool | ||
| metadata: | ||
| name: kind-ip-pool | ||
| namespace: metallb-system | ||
| spec: | ||
| addresses: | ||
| - {{ metallb_kind_net_prefix }}.255.200-{{ metallb_kind_net_prefix }}.255.250 | ||
| --- | ||
| apiVersion: metallb.io/v1beta1 | ||
| kind: L2Advertisement | ||
| metadata: | ||
| name: empty | ||
| namespace: metallb-system |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.