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

Update labels to use kubernetes recommended labels #4722

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

therealdwright
Copy link
Contributor

What does this PR do?

Kubernetes have not used the app or k8s-app for some time
and have provided guidance on what the recommended labels are
for some time as seen in their docs.

This commit updates all manifests/docs to use this approach.

Why is it important?

Users who choose to adopt kubernetes label best practises will not have to fork elastic manifests and can instead rely on the upstream ones directly.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

Users will need to upgrade using kubectl replace as some of the labels are immutable

Copy link

cla-checker-service bot commented May 9, 2024

💚 CLA has been signed

Copy link
Contributor

mergify bot commented May 9, 2024

This pull request does not have a backport label. Could you fix it @therealdwright? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label May 9, 2024
@ycombinator ycombinator requested review from michalpristas and removed request for andrzej-stencel May 9, 2024 21:48
@therealdwright therealdwright force-pushed the update-app-labels branch 2 times, most recently from 0832609 to 711f3f1 Compare May 9, 2024 21:53
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label May 10, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@pierrehilbert pierrehilbert added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team label May 10, 2024
Copy link
Contributor

@gizas gizas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely need a changelog entry for this change, as this affects users.

@pierrehilbert
Copy link
Contributor

@therealdwright Thanks for your contribution and signing the CLA.
As @blakerouse mentioned, could you please add de changelog entry to let our users be aware of this change?

@therealdwright
Copy link
Contributor Author

could you please add de changelog entry to let our users be aware of this change?

I've pushed a change log entry as requested.

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changelog.

@blakerouse blakerouse enabled auto-merge (squash) May 13, 2024 14:15
auto-merge was automatically disabled May 15, 2024 01:54

Head branch was pushed to by a user without write access

@therealdwright
Copy link
Contributor Author

@blakerouse I have rebased on main as the SonarQube Code Analysis and buildkite/elastic-agent were stuck in waiting for status to be reported. LMK if this is something maintainers must manually trigger.

@blakerouse
Copy link
Contributor

@therealdwright Yes it requires an authorized user to approve and run the workflows. This ensures we can review the change before we allow it to run on an actual machine.

@blakerouse blakerouse enabled auto-merge (squash) May 15, 2024 18:29
@ycombinator
Copy link
Contributor

buildkite test this

1 similar comment
@ycombinator
Copy link
Contributor

buildkite test this

@ycombinator
Copy link
Contributor

@therealdwright
Copy link
Contributor Author

CI failures look relevant

How do contributors get access to CI logs?

@ycombinator
Copy link
Contributor

CI failures look relevant

How do contributors get access to CI logs?

Oops, sorry about that, @therealdwright! Here are the logs that are relevant:

diff --git a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
--
  | index 074a15daa1..b54834c313 100644
  | a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml | 0s
  | b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml | 0s
  | @@ -212,7 +212,7 @@ kind: ClusterRole
  | metadata:
  | name: elastic-agent
  | labels:
  | -    app.kubernetes.io/name.kubernetes.io/name: elastic-agent
  | +    app.kubernetes.io/name: elastic-agent
  | rules:
  | - apiGroups: [""]
  | resources:
  | @@ -284,7 +284,7 @@ metadata:
  | # Should be the namespace where elastic-agent is running
  | namespace: kube-system
  | labels:
  | -    app.kubernetes.io/name.kubernetes.io/name: elastic-agent
  | +    app.kubernetes.io/name: elastic-agent
  | rules:
  | - apiGroups:
  | - coordination.k8s.io
  | @@ -298,7 +298,7 @@ metadata:
  | name: elastic-agent-kubeadm-config
  | namespace: kube-system
  | labels:
  | -    app.kubernetes.io/name.kubernetes.io/name: elastic-agent
  | +    app.kubernetes.io/name: elastic-agent
  | rules:
  | - apiGroups: [""]
  | resources:
  | @@ -313,5 +313,5 @@ metadata:
  | name: elastic-agent
  | namespace: kube-system
  | labels:
  | -    app.kubernetes.io/name.kubernetes.io/name: elastic-agent
  | +    app.kubernetes.io/name: elastic-agent
  | ---
  | deploy/kubernetes/elastic-agent-managed-kubernetes.yaml: needs update
  | make[1]: *** [Makefile:59: check-no-changes] Error 1
  | make[1]: Leaving directory '/opt/buildkite-agent/builds/bk-agent-prod-gcp-1716236865505762234/elastic/elastic-agent'
  | make: *** [Makefile:40: check-ci] Error 2

To fix that, I ran make generate-k8s from the deploy/kubernetes folder and pushed up 04de6e6 with the changes.

@ycombinator
Copy link
Contributor

buildkite test this

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

therealdwright and others added 2 commits May 28, 2024 12:48
Kubernetes have not used the `app` or `k8s-app` for some time
and have provided guidance on what the recommended labels are
for some time as seen in their [docs](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/).

This commit updates all manifests/docs to use this approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants