-
Notifications
You must be signed in to change notification settings - Fork 58
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
Use pulumi.com labeling scheme #829
Conversation
"app.kubernetes.io/name": "pulumi", | ||
"app.kubernetes.io/component": "workspace", | ||
"app.kubernetes.io/instance": w.Name, | ||
"app.kubernetes.io/managed-by": "pulumi-kubernetes-operator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a rationale for removing the well known app.kubernetes.io/managed-by
label? This makes it obvious to other tools what is managing these child objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hesitant to use a subset of app labels, seemed a bit weird. The definition (ref) of the app.kubernetes.io/managed-by
label is:
The tool being used to manage the operation of an application.
To me, it identifies the tool that is servicing the application at large. All these app labels seem to express a relationship to an application. The app concept may exist at a higher level, e.g. an ArgoCD Application. Since PKO doesn't know the application to which the workload is associated, it should not apply this label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since PKO doesn't know the application to which the workload is associated, it should not apply this label.
I disagree. The objects we are creating here (Workspace, Statefulset) are all created by our own PKO and should also be managed by PKO. These objects are what enables PKO to work right now. What happens if another controller/tool takes over control of these objects? We'd likely get into a controller fight here. Though practically, these labels are most generally used for metrics, so having the app.kubernetes.io/managed-by
would allow users to find metrics for PKO created/managed objects in their current dashboards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could also use the pulumi.com labels to identity these pods.
If you were to deploy an EKS cluster with various addons, I would guess that you would not see app.kubernetes.io/managed-by
on the majority of the objects. It just isn't as common as you're suggesting.
At least it could be considered a separate enhancement?
f2dba4b
to
7c68cd1
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #829 +/- ##
==========================================
+ Coverage 52.18% 52.25% +0.06%
==========================================
Files 32 32
Lines 4501 4507 +6
==========================================
+ Hits 2349 2355 +6
Misses 1959 1959
Partials 193 193 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I disagree with removing app.kubernetes.io/managed-by
, I won't block given the timeline for v2 release. We can discuss this offline.
Proposed changes
This PR switches over to a different labeling strategy for:
The rationale here is to avoid using the app.kubernetes.io labels because they have various meanings, the user might also be using them, and may trigger unwanted behavior like object tracking in argocd. PKO uses labels for a functional purpose, e.g. in the selectors.
Regarding the specific labels, this PR seeks to relate the labels the apigroup that is using them. The workspace controller uses labels in the
auto.pulumi.com
API group. The stack controller uses labels in thepulumi.com
API group.Workspace
Before:
After:
Note that this change causes replacement of the statefulset, due to some recovery logic that we have in the workspace controller.
Update
Labels weren't previously applied.
After:
Service
Before:
After:
Similar changes for the StatefulSet, for the Pod, and for the Secret made by each Update.
Related issues (optional)
Closes #819