Skip to content
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

Introduce a reclaim policy for ephemerally created Virtual IP resources #1115

Open
balpert89 opened this issue Sep 6, 2024 · 1 comment
Open
Assignees
Labels
api-change enhancement New feature or request

Comments

@balpert89
Copy link
Contributor

balpert89 commented Sep 6, 2024

Summary

Similar to #1114 the same Reclaim Policy should be available for Virtual IP resources.

Basic example

apiVersion: compute.ironcore.dev/v1alpha1
kind: Machine
metadata:
  name: machine
spec:
  networkInterfaces:
  - ephemeral:
      networkInterfaceTemplate:
        metadata:
          creationTimestamp: null
        spec:
          ipFamilies:
          - IPv4
          ips:
          - ephemeral:
              prefixTemplate:
                metadata:
                  creationTimestamp: null
                spec:
                  ipFamily: IPv4
                  parentRef:
                    name: prefix
                  prefixLength: 32
          networkRef:
            name: network
          virtualIP:
             ephemeral:
               virtualIPTemplate:
                 metadata:
                   creationTimestamp: null
                 spec:
                   reclaimPolicy: Retain # this is the new field defining the "Retain" strategy for the corresponding `virtualIP` resource
                   ipFamily: IPv4
                   type: Public
    name: primary

Edit: updated the .spec.virtualIP structure to be in line with #1114

This instructs the controller to not remove the Virtual IP resource. When the managing Machine / NetworkInterface resource is deleted, the OwnerReference as well as the .spec.targetRef should be cleared.

Motivation

Resource saving for consuming teams, such as VPN configuration.

@balpert89 balpert89 added enhancement New feature or request api-change labels Sep 6, 2024
@Rohit-0505 Rohit-0505 self-assigned this Nov 7, 2024
@Rohit-0505
Copy link
Contributor

@balpert89, @afritzler, the example for enforcing ReclaimPolicy on ephemerally created VirtualIPs should indeed follow a similar approach to how ephemeral volumes handle reclaim policies in #1114
Here’s a revised example demonstrating how to structure this logic, please confirm if this looks good?

apiVersion: compute.ironcore.dev/v1alpha1
kind: Machine
metadata:
  name: machine
spec:
  networkInterfaces:
  - ephemeral:
      networkInterfaceTemplate:
        metadata:
          creationTimestamp: null
        spec:
          ipFamilies:
          - IPv4
          ips:
          - ephemeral:
              prefixTemplate:
                metadata:
                  creationTimestamp: null
                spec:
                  ipFamily: IPv4
                  parentRef:
                    name: prefix
                  prefixLength: 32
          networkRef:
            name: network
          virtualIP:
             ephemeral:
               virtualIPTemplate:
                 metadata:
                   creationTimestamp: null
                 spec:
                   reclaimPolicy: Retain # this is the new field defining the "Retain" strategy for the corresponding `virtualIP` resource
                   ipFamily: IPv4
                   type: Public
    name: primary

@ushabelgur ushabelgur added this to Core Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

2 participants