diff --git a/config/samples/e2e/bases/machine-with-ephemeral-resources/kustomization.yaml b/config/samples/e2e/bases/machine-with-ephemeral-resources/kustomization.yaml new file mode 100644 index 000000000..0cde81bb3 --- /dev/null +++ b/config/samples/e2e/bases/machine-with-ephemeral-resources/kustomization.yaml @@ -0,0 +1,3 @@ +resources: +- network.yaml +- machine.yaml \ No newline at end of file diff --git a/config/samples/e2e/bases/machine-with-ephemeral-resources/machine.yaml b/config/samples/e2e/bases/machine-with-ephemeral-resources/machine.yaml new file mode 100644 index 000000000..4e4914b3d --- /dev/null +++ b/config/samples/e2e/bases/machine-with-ephemeral-resources/machine.yaml @@ -0,0 +1,37 @@ +apiVersion: compute.ironcore.dev/v1alpha1 +kind: Machine +metadata: + name: machine-sample +spec: + machineClassRef: + name: machineclass-sample + ignitionRef: + name: ignition + key: ignition.yaml + networkInterfaces: + - name: primary + ephemeral: + networkInterfaceTemplate: + spec: + ipFamilies: + - IPv4 + ips: + - value: 10.0.0.12 + networkRef: + name: network-sample + 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 \ No newline at end of file diff --git a/config/samples/e2e/bases/machine-with-ephemeral-resources/network.yaml b/config/samples/e2e/bases/machine-with-ephemeral-resources/network.yaml new file mode 100644 index 000000000..873bbe36b --- /dev/null +++ b/config/samples/e2e/bases/machine-with-ephemeral-resources/network.yaml @@ -0,0 +1,4 @@ +apiVersion: networking.ironcore.dev/v1alpha1 +kind: Network +metadata: + name: network-sample \ No newline at end of file diff --git a/config/samples/e2e/bases/nonephemeral-machine/kustomization.yaml b/config/samples/e2e/bases/machine-with-nonephemeral-resources/kustomization.yaml similarity index 100% rename from config/samples/e2e/bases/nonephemeral-machine/kustomization.yaml rename to config/samples/e2e/bases/machine-with-nonephemeral-resources/kustomization.yaml diff --git a/config/samples/e2e/bases/nonephemeral-machine/machine.yaml b/config/samples/e2e/bases/machine-with-nonephemeral-resources/machine.yaml similarity index 100% rename from config/samples/e2e/bases/nonephemeral-machine/machine.yaml rename to config/samples/e2e/bases/machine-with-nonephemeral-resources/machine.yaml diff --git a/config/samples/e2e/bases/nonephemeral-machine/network.yaml b/config/samples/e2e/bases/machine-with-nonephemeral-resources/network.yaml similarity index 100% rename from config/samples/e2e/bases/nonephemeral-machine/network.yaml rename to config/samples/e2e/bases/machine-with-nonephemeral-resources/network.yaml diff --git a/config/samples/e2e/bases/nonephemeral-machine/networkinterface.yaml b/config/samples/e2e/bases/machine-with-nonephemeral-resources/networkinterface.yaml similarity index 100% rename from config/samples/e2e/bases/nonephemeral-machine/networkinterface.yaml rename to config/samples/e2e/bases/machine-with-nonephemeral-resources/networkinterface.yaml diff --git a/config/samples/e2e/bases/nonephemeral-machine/virtualIP.yaml b/config/samples/e2e/bases/machine-with-nonephemeral-resources/virtualIP.yaml similarity index 100% rename from config/samples/e2e/bases/nonephemeral-machine/virtualIP.yaml rename to config/samples/e2e/bases/machine-with-nonephemeral-resources/virtualIP.yaml diff --git a/config/samples/e2e/bases/nonephemeral-machine/volume.yaml b/config/samples/e2e/bases/machine-with-nonephemeral-resources/volume.yaml similarity index 100% rename from config/samples/e2e/bases/nonephemeral-machine/volume.yaml rename to config/samples/e2e/bases/machine-with-nonephemeral-resources/volume.yaml diff --git a/config/samples/e2e/machine-with-ephemeral-resources/README.md b/config/samples/e2e/machine-with-ephemeral-resources/README.md new file mode 100644 index 000000000..99b6ea112 --- /dev/null +++ b/config/samples/e2e/machine-with-ephemeral-resources/README.md @@ -0,0 +1,50 @@ +# Machine with ephemeral resources + +This example deploys a `Machine` with `ephemeral` `volume` and `networkinterface`. +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 `machine-with-ephemeral-resources` 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 ./`) diff --git a/config/samples/e2e/machine-with-non-ephemeral-resource/kustomization.yaml b/config/samples/e2e/machine-with-ephemeral-resources/kustomization.yaml similarity index 72% rename from config/samples/e2e/machine-with-non-ephemeral-resource/kustomization.yaml rename to config/samples/e2e/machine-with-ephemeral-resources/kustomization.yaml index 629742fe7..1a3ab1534 100644 --- a/config/samples/e2e/machine-with-non-ephemeral-resource/kustomization.yaml +++ b/config/samples/e2e/machine-with-ephemeral-resources/kustomization.yaml @@ -5,4 +5,4 @@ namespace: test resources: - ../bases/ignition -- ../bases/nonephemeral-machine +- ../bases/machine-with-ephemeral-resources \ No newline at end of file diff --git a/config/samples/e2e/machine-with-non-ephemeral-resource/README.md b/config/samples/e2e/machine-with-non-ephemeral-resources/README.md similarity index 73% rename from config/samples/e2e/machine-with-non-ephemeral-resource/README.md rename to config/samples/e2e/machine-with-non-ephemeral-resources/README.md index a2b8e3f66..85463e53f 100644 --- a/config/samples/e2e/machine-with-non-ephemeral-resource/README.md +++ b/config/samples/e2e/machine-with-non-ephemeral-resources/README.md @@ -1,4 +1,4 @@ -# `Machine` non ephemeral resources +# `Machine` with non ephemeral resources This example deploys a `Machine` with `non-ephemeral` `volume` and `networkinterface`. The following artifacts will be deployed in your namespace: @@ -15,7 +15,7 @@ The following artifacts will be deployed in your namespace: 1. Adapt the `namespace` in `kustomization.yaml` 2. Replace `your-user`, `your-pw-hash` and `your-ssh-key` in the `ignition/ignition.yaml` 3. Run `ignition/regenerate-ignition.sh` -4. Create the below `patch-machineclassref.yaml` in `machine-with-non-ephemeral-resource` folder with the desired `machineClassRef` and `machinePoolRef` as per your environment +4. Create the below `patch-machine.yaml` in `machine-with-non-ephemeral-resources` folder with the desired `machineClassRef` and `machinePoolRef` as per your environment ``` apiVersion: compute.ironcore.dev/v1alpha1 @@ -29,7 +29,7 @@ spec: name: new-machinePool ``` -5. Create the below`patch-volume.yaml`in `machine-with-non-ephemeral-resource` folder with the desired `volumeClassRef`and `volumePoolRef` as per your environment +5. Create the below`patch-volume.yaml`in `machine-with-non-ephemeral-resources` folder with the desired `volumeClassRef`and `volumePoolRef` as per your environment ``` apiVersion: storage.ironcore.dev/v1alpha1 @@ -38,7 +38,7 @@ metadata: name: volume-sample spec: volumeClassRef: - name: new-volumeClass The new name of the volume class reference + name: new-volumeClass image: new-image:rootfs volumePoolRef: name: new-volumePool @@ -46,8 +46,7 @@ spec: 6. Update the `kustomization.yaml` with below content ``` patches: -- path: patch-machineclassref.yaml +- path: patch-machine.yaml - path: patch-volume.yaml ``` - 7. Run (`kubectl apply -k ./`) \ No newline at end of file diff --git a/config/samples/e2e/machine-with-non-ephemeral-resources/kustomization.yaml b/config/samples/e2e/machine-with-non-ephemeral-resources/kustomization.yaml new file mode 100644 index 000000000..4b9eb7643 --- /dev/null +++ b/config/samples/e2e/machine-with-non-ephemeral-resources/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: test + +resources: +- ../bases/ignition +- ../bases/machine-with-nonephemeral-resources \ No newline at end of file