Skip to content

Make the pod selector label configurable#148

Merged
stefanprodan merged 4 commits intomasterfrom
selectors
Apr 16, 2019
Merged

Make the pod selector label configurable#148
stefanprodan merged 4 commits intomasterfrom
selectors

Conversation

@stefanprodan
Copy link
Copy Markdown
Member

@stefanprodan stefanprodan commented Apr 15, 2019

This PR introduces a new flag named selector-labels that allows the pod selector match label to be configured at run time.

By default Flagger will search for one of the following labels:

  • app
  • name
  • app.kubernetes.io/name

If none of the above labels are found in Deployment.Spec.Selector.MatchLabels the canary is rejected.

Fix: #100

@stefanprodan stefanprodan merged commit bdc3a32 into master Apr 16, 2019
@stefanprodan stefanprodan deleted the selectors branch April 16, 2019 06:51
```

Besides `app` Flagger supports `name` and `app.kubernetes.io/name` selectors. If you use a different
convention you can specify your label with the `-selector-labels` flag.
Copy link
Copy Markdown

@sarialem sarialem Jan 9, 2020

Choose a reason for hiding this comment

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

It was really difficult to know where to use this flag from this documentation, I had to come to this PR to realize that it should be used when installing flagger with helm, or maybe I'm still wrong, how is it used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The Helm options are documented in the chart readme here to set a label with Helm you would do --set selectorLabels=somelabel

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @stefanprodan

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can you please open an issue for making the docs better around selector-labels, the Helm example should probably be there.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here:
#403

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the pod label selector configurable

2 participants