You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/proposal/controller-and-user-tags.md
+8-113Lines changed: 8 additions & 113 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,16 @@
2
2
3
3
4
4
## Motivation
5
+
PowerVS cluster creation supports both creating infrastructure and using existing resources required for cluster creation. If the infrastructure is created during cluster creation then this tagging will be applied and created infrastructure will also be deleted based on tagging.
5
6
PowerVS cluster reconciler sets controllercreated field whenever resource is created by controller, which was initially introduced to allow proper cleanup of newly created resource vs the use of existing resources.
6
7
7
8
Though its working as expected and fulfills the purpose, we see some drawbacks.
8
9
1. The field is initially set to true during the first reconciliation cycle when the resource is being created. In subsequent reconciliation loops, the field is not updated because the resource already exists in the cloud. This behavior introduces non-idempotency in the controller logic. As a result, if the initial reconciliation event is missed, the controller exhibits inconsistent behavior. Its against k8s principle of reconcilation of having level trigger rather than edge triggered.
9
10
2. The status is expected to be created from spec, considering the scenario of backup and recover. If we move the spec to fresh management cluster which is setting the status, the controller created will be set as false as the resource already exists in cloud but it was created during its previous concilation.
10
11
11
12
## Goal
12
-
1. This proposal aims to tag the PowerVS clusters and delete the resources created by controller based on tag.
13
-
2.User should be able to add tags to the resources if he wants.
13
+
1. This proposal aims to tag the PowerVS cluster's cloud resources and delete the resources created by controller based on tag.
14
+
2.Provide user ability to set custom tags to cloud resources.
14
15
15
16
## Proposal
16
17
This proposal presents adding two kinds of tags to the resources created by controller
@@ -19,7 +20,7 @@ This proposal presents adding two kinds of tags to the resources created by cont
19
20
20
21
21
22
### Controller tag
22
-
Add Controller tag `powervs.cluster.x-k8s.io-resource-owner:<cluster_name>`to handle deletion of PowerVS Cluster resources created by controller
23
+
A tag of format`powervs.cluster.x-k8s.io-resource-owner:<cluster_name>`will be added by the controller to newly created cloud resources marking the resource as created by controller. During deletion phase the system will look for the presence of the tag inorder to proceed with deletion or to keep as it is.
23
24
24
25
25
26
#### Following resources will be getting tagged
@@ -30,6 +31,7 @@ Add Controller tag `powervs.cluster.x-k8s.io-resource-owner:<cluster_name>` to h
// Network is the reference to the Network to use for this cluster.
58
-
// when the field is omitted, A DHCP service will be created in the Power VS workspace and its private network will be used.
59
-
// the DHCP service created network will have the following name format
60
-
// 1. in the case of DHCPServer.Name is not set the name will be DHCPSERVER<CLUSTER_NAME>_Private.
61
-
// 2. if DHCPServer.Name is set the name will be DHCPSERVER<DHCPServer.Name>_Private.
62
-
// when Network.ID is set, its expected that there exist a network in PowerVS workspace with id or else system will give error.
63
-
// when Network.Name is set, system will first check fornetwork with Namein PowerVS workspace, if not exist system will check DHCP network with given Network.name, if that also not exist, it will create a new DHCP service and name will be DHCPSERVER<Network.Name>_Private.
64
-
// Network.RegEx is not yet supported and system will ignore the value.
// when omitted system will dynamically create the service instance with name CLUSTER_NAME-serviceInstance.
84
-
// when ServiceInstance.ID is set, its expected that there exist a service instance in PowerVS workspace with id or else system will give error.
85
-
// when ServiceInstance.Name is set, system will first check forservice instance with Namein PowerVS workspace, if not exist system will create new instance.
86
-
// if there are more than one service instance exist with the ServiceInstance.Name in given Zone, installation fails with an error. Use ServiceInstance.ID in those situations to use the specific service instance.
87
-
// ServiceInstance.Regex is not yet supported not yet supported and system will ignore the value.
// Ignition defined options related to the bootstrapping systems where Ignition is used.
159
-
// +optional
160
-
Ignition *Ignition `json:"ignition,omitempty"`
53
+
UserTags []string `json:"tags,omitempty"`
54
+
161
55
}
162
56
163
57
```
164
58
165
59
166
60
### Cluster creation workflow
167
61
The controller will attach the tag to the resources after resources are created.
62
+
During cluster creation first we will check if User tags set or not, if it is set then those tags will be attached to the resources. After that Controller tag will be attached to all the resources created by conroller.
0 commit comments