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

add ability to set container labels on nodes using --label/-l #378

Merged

Conversation

lionelnicolas
Copy link
Contributor

Some service discovery systems are using docker labels to configure DNS, load-balancing, monitoring, metering ... (ie. dalidock , traefik, prometheus ...).

This introduce ability to set arbitrary container labels for nodes using a new --label parameter to k3s cluster create, and supports node filters as is already done for --volume and --port.

This PR is a port of that feature which already exists in k3d v1 (see #163)

This supports node filters as is already done for '--volume' and '--port'.
@iwilltry42 iwilltry42 self-requested a review October 19, 2020 12:53
@iwilltry42 iwilltry42 self-assigned this Oct 19, 2020
@iwilltry42 iwilltry42 added the enhancement New feature or request label Oct 19, 2020
Copy link
Member

@iwilltry42 iwilltry42 left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks a lot for your contribution :)
The only thing I'm worrying about is, that some people might confuse the docker runtime labels with Kubernetes labels (on Kubernetes nodes)... What do you think? 🤔

cmd/cluster/clusterCreate.go Show resolved Hide resolved
@iwilltry42 iwilltry42 merged commit 211c937 into k3d-io:main Oct 20, 2020
rancherio-gh-m pushed a commit that referenced this pull request Oct 20, 2020
Merge: a385241 ffe8c96
Author: Thorsten Klein <iwilltry42@gmail.com>
Date:   Tue Oct 20 09:45:00 2020 +0200

    Merge pull request #378 from lionelnicolas/feature/set-custom-container-labels

    Feature: add ability to set container labels on nodes using --label/-l (thanks @lionelnicolas)
@iwilltry42
Copy link
Member

Thank you!
Feel free to follow this guide to add yourself to the contributors list :)

@lionelnicolas
Copy link
Contributor Author

Thanks !

@lionelnicolas
Copy link
Contributor Author

@all-contributors please add @lionelnicolas for code

@lionelnicolas lionelnicolas deleted the feature/set-custom-container-labels branch October 20, 2020 13:03
@allcontributors
Copy link
Contributor

@lionelnicolas

I've put up a pull request to add @lionelnicolas! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants