diff --git a/config/samples/e2e/bases/network-peering/kustomization.yaml b/config/samples/e2e/bases/network-peering/kustomization.yaml new file mode 100644 index 000000000..47dc9669f --- /dev/null +++ b/config/samples/e2e/bases/network-peering/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- network1.yaml +- network2.yaml +- machine1.yaml +- machine2.yaml \ No newline at end of file diff --git a/config/samples/e2e/bases/network-peering/machine1.yaml b/config/samples/e2e/bases/network-peering/machine1.yaml new file mode 100644 index 000000000..753292d72 --- /dev/null +++ b/config/samples/e2e/bases/network-peering/machine1.yaml @@ -0,0 +1,38 @@ +apiVersion: compute.ironcore.dev/v1alpha1 +kind: Machine +metadata: + name: machine-sample1 +spec: + machineClassRef: + name: machineclass-sample + ignitionRef: + name: ignition + key: ignition.yaml + networkInterfaces: + - name: primary + ephemeral: + networkInterfaceTemplate: + spec: + ipFamilies: + - IPv4 + ips: + - value: 10.0.0.1 + networkRef: + name: network-sample1 + virtualIP: + ephemeral: + virtualIPTemplate: + spec: + type: Public + ipFamily: IPv4 + volumes: + - name: root-disk + ephemeral: + volumeTemplate: + spec: + volumeClassRef: + name: volumeclass-sample + image: gardenlinux:rootfs-image + resources: + storage: 10Gi + diff --git a/config/samples/e2e/bases/network-peering/machine2.yaml b/config/samples/e2e/bases/network-peering/machine2.yaml new file mode 100644 index 000000000..b0e3adb63 --- /dev/null +++ b/config/samples/e2e/bases/network-peering/machine2.yaml @@ -0,0 +1,38 @@ +apiVersion: compute.ironcore.dev/v1alpha1 +kind: Machine +metadata: + name: machine-sample2 +spec: + machineClassRef: + name: machineclass-sample + ignitionRef: + name: ignition + key: ignition.yaml + networkInterfaces: + - name: primary + ephemeral: + networkInterfaceTemplate: + spec: + ipFamilies: + - IPv4 + ips: + - value: 10.0.0.2 + networkRef: + name: network-sample2 + virtualIP: + ephemeral: + virtualIPTemplate: + spec: + type: Public + ipFamily: IPv4 + volumes: + - name: root-disk + ephemeral: + volumeTemplate: + spec: + volumeClassRef: + name: volumeclass-sample + image: gardenlinux:rootfs-image + resources: + storage: 10Gi + diff --git a/config/samples/e2e/bases/network-peering/network1.yaml b/config/samples/e2e/bases/network-peering/network1.yaml new file mode 100644 index 000000000..829b9c85b --- /dev/null +++ b/config/samples/e2e/bases/network-peering/network1.yaml @@ -0,0 +1,9 @@ +apiVersion: networking.ironcore.dev/v1alpha1 +kind: Network +metadata: + name: network-sample1 +spec: + peerings: + - name: peering1 + networkRef: + name: network-sample2 diff --git a/config/samples/e2e/bases/network-peering/network2.yaml b/config/samples/e2e/bases/network-peering/network2.yaml new file mode 100644 index 000000000..b1308ae22 --- /dev/null +++ b/config/samples/e2e/bases/network-peering/network2.yaml @@ -0,0 +1,9 @@ +apiVersion: networking.ironcore.dev/v1alpha1 +kind: Network +metadata: + name: network-sample2 +spec: + peerings: + - name: peering2 + networkRef: + name: network-sample1 diff --git a/config/samples/e2e/network-peering/README.md b/config/samples/e2e/network-peering/README.md new file mode 100644 index 000000000..edee32d82 --- /dev/null +++ b/config/samples/e2e/network-peering/README.md @@ -0,0 +1,50 @@ +# Network Peering Sample deployement + +This example deploys two `Network`s peered with each other and these `Network`s are referenced in `Machine`s. +The following artifacts will be deployed in your namespace: +- IronCore `Network`, `NetworkInterface` and `VirtualIP` +- IronCore `Machine` +- IronCore `Volume` +- Secret containing the `ignition` + +## Prerequisites + +- [Butane](https://coreos.github.io/butane/) + +## Usage +1. Adapt the `namespace` in `kustomization.yaml` +2. Replace `your-user`, `your-pw-hash` and `your-ssh-key`s in the `ignition/ignition.yaml` +3. Run `ignition/regenerate-ignition.sh` +4. Create the below `patch-machine.yaml` in `network-peering` folder with the desired `machineClassRef`, `machinePoolRef`, `volumeClassRef`, `volumePoolRef`, `image` etc. as per your environment + +``` +apiVersion: compute.ironcore.dev/v1alpha1 +kind: Machine +metadata: + name: machine-sample +spec: + machineClassRef: + name: new-machineClass + machinePoolRef: + name: new-machinePool + volumes: + - name: root-disk + ephemeral: + volumeTemplate: + spec: + volumeClassRef: + name: new-volumeClass + volumePoolRef: + name: new-volumePool + image: gardenlinux:rootfs-dev-20231025 + resources: + storage: 15Gi +``` + +5. Update the `kustomization.yaml` with below content +``` +patches: +- path: patch-machine.yaml +``` + +6. Run (`kubectl apply -k ./`) \ No newline at end of file diff --git a/config/samples/e2e/network-peering/kustomization.yaml b/config/samples/e2e/network-peering/kustomization.yaml new file mode 100644 index 000000000..4ce782725 --- /dev/null +++ b/config/samples/e2e/network-peering/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: test + +resources: +- ../bases/ignition +- ../bases/network-peering