Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(examples): use more precise example kubernetes template labels#14028

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

geniass
Copy link
Contributor

The current example template doesn't have the selector labels to correct identify the pods created by the workspace kubernetes deployment.

I.e. when multiple workspaces are created from a template, the deployment resources incorrectly try to manage pods from the other workspace's deployment.

This fix also changes persistent resource names to use immutable IDs instead of names as per the docs:https://coder.com/docs/templates/resource-persistence

matifali reacted with hooray emoji
@cdr-botcdr-botbot added the communityPull Requests and issues created by the community. labelJul 26, 2024
@github-actionsGitHub Actions
Copy link

github-actionsbot commentedJul 26, 2024
edited
Loading

All contributors have signed the CLA ✍️ ✅
Posted by theCLA Assistant Lite bot.

@geniassgeniass changed the titleFix kubernetes template example labelsfix(examples): use more preceise example kubernetes template labelsJul 26, 2024
@geniassgeniass changed the titlefix(examples): use more preceise example kubernetes template labelsfix(examples): use more precise example kubernetes template labelsJul 26, 2024
@geniass
Copy link
ContributorAuthor

I have read the CLA Document and I hereby sign the CLA

@geniass
Copy link
ContributorAuthor

recheck

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

I agree with the overall intent, but Kubernetes PVCs have a length limit of 63 characters. Theworkspace_instance local will be 73 characters long as it consists of 2 UUIDs joined by a hyphen.

How about we instead usedata.coder_workspace.me.id to act as a stable identifier?

@geniass
Copy link
ContributorAuthor

I agree with the overall intent, but Kubernetes PVCs have a length limit of 63 characters. Theworkspace_instance local will be 73 characters long as it consists of 2 UUIDs joined by a hyphen.

How about we instead usedata.coder_workspace.me.id to act as a stable identifier?

Good catch, I thinkdata.coder_workspace.me.id is good for the PVC name. Do you think there's any reason to keepworkspace_instance for the labels or should I just make everything use the workspace ID?

@johnstcn
Copy link
Member

Good catch, I thinkdata.coder_workspace.me.id is good for the PVC name. Do you think there's any reason to keepworkspace_instance for the labels or should I just make everything use the workspace ID?

I think you'll run into the same issue if you try to use thatworkspace_instance local as a label value:

A label key and value must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters each.

https://kubernetes.io/docs/reference/kubectl/generated/kubectl_label/

@geniassgeniassforce-pushed thefix-kubernetes-template-example-labels branch fromfb0805a tobf1ea39CompareJuly 31, 2024 10:32
@geniass
Copy link
ContributorAuthor

Sorry I didn't realise labels had the same restriction. I've changed everything to just use the workspace ID.

@matifalimatifali requested a review fromjohnstcnAugust 7, 2024 13:40
@matifali
Copy link
Member

@geniass, it looks like CLA is still not signed by you. This can happen if your GitHub email and your commuter email are different.

@geniass
Copy link
ContributorAuthor

recheck

cdrcommunity added a commit to coder/cla that referenced this pull requestAug 8, 2024
@geniassgeniassforce-pushed thefix-kubernetes-template-example-labels branch fromfb6fb0f tobf1ea39CompareAugust 8, 2024 09:31
Copy link
Member

@johnstcnjohnstcn left a comment
edited
Loading

Choose a reason for hiding this comment

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

👍 Smoke-tested on my personal deployment (v2.14.1)

matifali reacted with rocket emoji
@johnstcnjohnstcn merged commitf50e1d5 intocoder:mainAug 8, 2024
47 of 48 checks passed
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 8, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

@geniassgeniass

Labels
communityPull Requests and issues created by the community.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@geniass@johnstcn@matifali

[8]ページ先頭

©2009-2025 Movatter.jp