Skip to content

Commit

Permalink
refactoring with ephemeral objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ushabelgur committed Oct 22, 2024
1 parent a3cb6c0 commit b11ffd8
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 122 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
resources:
- network.yaml
- virtualIP.yaml
- virtualIP2.yaml
- networkinterface.yaml
- networkinterface2.yaml
- volume.yaml
- volume2.yaml
- machine.yaml
- machine1.yaml
- machine2.yaml
- loadbalancer.yaml
20 changes: 0 additions & 20 deletions config/samples/e2e/bases/loadbalancer-public/machine.yaml

This file was deleted.

40 changes: 40 additions & 0 deletions config/samples/e2e/bases/loadbalancer-public/machine1.yaml
Original file line number Diff line number Diff line change
@@ -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
38 changes: 29 additions & 9 deletions config/samples/e2e/bases/loadbalancer-public/machine2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,36 @@ metadata:
spec:
machineClassRef:
name: machineclass-sample
volumes:
- name: rootdisk # first disk is root disk
volumeRef:
name: volume-sample2
ignitionRef:
name: ignition
key: ignition.yaml
networkInterfaces:
- name: primary
networkInterfaceRef:
name: networkinterface-sample2


- 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
16 changes: 0 additions & 16 deletions config/samples/e2e/bases/loadbalancer-public/networkinterface.yaml

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions config/samples/e2e/bases/loadbalancer-public/virtualIP.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions config/samples/e2e/bases/loadbalancer-public/virtualIP2.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions config/samples/e2e/bases/loadbalancer-public/volume.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions config/samples/e2e/bases/loadbalancer-public/volume2.yaml

This file was deleted.

37 changes: 17 additions & 20 deletions config/samples/e2e/loadbalancer-public/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ The following artifacts will be deployed in your namespace:

## Usage
1. Adapt the `namespace` in `kustomization.yaml`
2. Replace `your-user`, `your-pw-hash` and `your-ssh-key` in the `ignition/ignition.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` and `machinePoolRef` as per your environment
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
Expand All @@ -26,30 +26,27 @@ metadata:
name: machine-sample
spec:
machineClassRef:
name: new-machineClass # The new name of the machine class reference
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. Create the below`patch-volume.yaml`in `loadbalancer-public` folder with the desired `volumeClassRef`and `volumePoolRef` as per your environment

```
apiVersion: storage.ironcore.dev/v1alpha1
kind: Volume
metadata:
name: volume-sample
spec:
volumeClassRef:
name: new-volumeClass # The new name of the volume class reference
image: new-image:rootfs
volumePoolRef:
name: new-volumePool
```
6. Update the `kustomization.yaml` with below content
5. Update the `kustomization.yaml` with below content
```
patches:
- path: patch-machine.yaml
- path: patch-volume.yaml
```

7. Run (`kubectl apply -k ./`)
6. Run (`kubectl apply -k ./`)

0 comments on commit b11ffd8

Please sign in to comment.