diff --git a/config/samples/e2e/bases/loadbalancer-public/kustomization.yaml b/config/samples/e2e/bases/loadbalancer-public/kustomization.yaml new file mode 100644 index 000000000..59868fe0c --- /dev/null +++ b/config/samples/e2e/bases/loadbalancer-public/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- network.yaml +- machine1.yaml +- machine2.yaml +- loadbalancer.yaml \ No newline at end of file diff --git a/config/samples/e2e/bases/loadbalancer-public/loadbalancer.yaml b/config/samples/e2e/bases/loadbalancer-public/loadbalancer.yaml new file mode 100644 index 000000000..825d68910 --- /dev/null +++ b/config/samples/e2e/bases/loadbalancer-public/loadbalancer.yaml @@ -0,0 +1,14 @@ +apiVersion: networking.ironcore.dev/v1alpha1 +kind: LoadBalancer +metadata: + name: loadbalancer-sample +spec: + type: Public + ipFamilies: [IPv4] + networkRef: + name: network-sample + networkInterfaceSelector: + matchLabels: + app: web + ports: + - port: 80 \ No newline at end of file diff --git a/config/samples/e2e/bases/loadbalancer-public/machine1.yaml b/config/samples/e2e/bases/loadbalancer-public/machine1.yaml new file mode 100644 index 000000000..07ea78f2f --- /dev/null +++ b/config/samples/e2e/bases/loadbalancer-public/machine1.yaml @@ -0,0 +1,40 @@ +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: + metadata: + labels: + app: web + spec: + ipFamilies: + - IPv4 + ips: + - value: 10.0.0.1 + networkRef: + name: network-sample + virtualIP: + ephemeral: + virtualIPTemplate: + spec: + type: Public + ipFamily: IPv4 + volumes: + - name: root-disk-1 + 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/loadbalancer-public/machine2.yaml b/config/samples/e2e/bases/loadbalancer-public/machine2.yaml new file mode 100644 index 000000000..978953496 --- /dev/null +++ b/config/samples/e2e/bases/loadbalancer-public/machine2.yaml @@ -0,0 +1,40 @@ +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: + metadata: + labels: + app: web + spec: + ipFamilies: + - IPv4 + ips: + - value: 10.0.0.2 + networkRef: + name: network-sample + virtualIP: + ephemeral: + virtualIPTemplate: + spec: + type: Public + ipFamily: IPv4 + volumes: + - name: root-disk-1 + 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/loadbalancer-public/network.yaml b/config/samples/e2e/bases/loadbalancer-public/network.yaml new file mode 100644 index 000000000..99268931d --- /dev/null +++ b/config/samples/e2e/bases/loadbalancer-public/network.yaml @@ -0,0 +1,4 @@ +apiVersion: networking.ironcore.dev/v1alpha1 +kind: Network +metadata: + name: network-sample diff --git a/config/samples/e2e/loadbalancer-public/README.md b/config/samples/e2e/loadbalancer-public/README.md new file mode 100644 index 000000000..09773da5a --- /dev/null +++ b/config/samples/e2e/loadbalancer-public/README.md @@ -0,0 +1,52 @@ +# `LoadBalancer` of `type: Public` + +This example deploys a `LoadBalancer` of `type: Public` by selecting two target `NetworkInterface`s via a `networkInterfaceSelector` `metav1.LabelSelector`. These two `NetworkInterface`s are referencing to same `Network` and will be attached to two different `Machine`s. + +The following artifacts will be deployed in your namespace: +- IronCore `LoadBalancer` +- IronCore `Network`, `NetworkInterface`s and `VirtualIP`s +- IronCore `Machine`s +- IronCore `Volume`s +- 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 `loadbalancer-public` 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-1 + 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/loadbalancer-public/kustomization.yaml b/config/samples/e2e/loadbalancer-public/kustomization.yaml new file mode 100644 index 000000000..1345a9953 --- /dev/null +++ b/config/samples/e2e/loadbalancer-public/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: test + +resources: +- ../bases/ignition +- ../bases/loadbalancer-public