Azure / k8s-deploy

GitHub Action for deploying to Kubernetes clusters
MIT License
255 stars 104 forks source link

Feature Request: Switch to disable all annotations / labeling #242

Closed vitaly-pavluk closed 1 year ago

vitaly-pavluk commented 2 years ago

Feature request

As a DevOps engineer working on the CI/CD GH workflow, I want to disable all annotations and labeling that K8s-Deploy GH action does, so they will not pollute K8s namespaces, deployments, pods, etc. Now K8s-Deploy allows only disabling the namespace annotation but there is no way to disable pod labeling that does not work correctly.

Reason for turning off auto-annotations - I have a team-wide strategy for them so the GH action just pollutes K9s resources with labels and annotations that are not useful for my K8s resources. NOTE: There is a bug in K8s-Deploy GH action that does not properly sanitize the workflow name before using it as in the POD/Service/Deployment label. E.g. my GitHub workflow name is "Build & Deploy Web Api" when K8s-Deploy calls kubectl to label all resources listed in the file it uses the following command kubectl label -f /tmp/baked-template-12345.yaml workflowFriendlyName=Build_&_Deploy_Web_Api so the label Build_&_Deploy_Web_Api contains invalid symbol & that is not allowed by K8s Kubenetes - Label Syntax and character set

OliverMKing commented 2 years ago

Will look into it. Thanks!

OliverMKing commented 2 years ago

@vitaly-pavluk what version of this action are you running? v4.4 should remove the &.

vitaly-pavluk commented 2 years ago

@OliverMKing I've used version azure/k8s-deploy@v3.1 per the first example I've seen on the GH Basic deployment (without any deployment strategy)
If version 3.1 is not supported or has flaws so the examples should be updated accordingly to avoid confusion

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

vitaly-pavluk commented 2 years ago

Is it enough for the team to fix the issue?

OliverMKing commented 2 years ago

@vitaly-pavluk Have you tried v4 or v4.4? Those contain the fix.

The docs need to be updated to show v4 as the example.

vitaly-pavluk commented 2 years ago

@OliverMKing No, I didn't try 4th version but changed the name of the workflow so it does not have unsupported chars. I explicitly mentioned v3 of the GH action as those that has an issue. If 3rd version is not supported anymore, please just close this issue and update docs to use only v4.4. Thank you.

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

OliverMKing commented 1 year ago

I have fixed the docs :).