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

feat(helm/provisioner): support deploying multiple provisioners in same namespace#15637

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
johnstcn merged 3 commits intomainfromcj/helm-provisioner-sa-disable-create
Nov 25, 2024

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedNov 24, 2024
edited
Loading

Fixes#15437

This allows us to support the following use-cases:

  1. Deploying multiple provisioner daemons with separate service accounts and roles: setnameOverride andcoder.serviceAccount.Name
  2. Deploying a provisioner daemon that references an existing service account without creating a separate sa/role/rolebinding: setcoder.serviceAccount.disableCreate=true,coder.serviceAccount.workspacePerms=false andcoder.serviceAccount.name=<name of existing sa>.

ValidatednameOverride using kustomize:

# Staged changes--- a/kustomize/mycluster/coder/provisioner/kustomization.yaml+++ b/kustomize/mycluster/coder/provisioner/kustomization.yaml@@ -7,6 +7,12 @@ helmCharts:     version: "2.17.2"     namespace: coder     valuesFile: provisioner-values.yaml+  - name: coder-provisioner+    releaseName: other-coder-provisioner+    repo: https://helm.coder.com/v2+    version: "2.17.2"+    namespace: coder+    valuesFile: other-provisioner-values.yaml--- /dev/null+++ b/kustomize/mycluster/coder/provisioner/other-provisioner-values.yaml@@ -0,0 +1,7 @@+coder:+  serviceAccount:+    name: "other-coder-provisioner"+provisionerDaemon:+  keySecretName: other-coder-provisioner-keys+  keySecretKey: other-coder-onprem-1+nameOverride: "other-coder-provisioner"# Resulting new files (no modifications):Untracked files:  (use "git add <file>..." to include in what will be committed)clusters/mycluster/coder/generated/deployment-other-coder-provisioner.yamlclusters/mycluster/coder/generated/role-other-coder-provisioner-workspace-perms.yamlclusters/mycluster/coder/generated/rolebinding-other-coder-provisioner.yamlclusters/mycluster/coder/generated/serviceaccount-other-coder-provisioner.yaml

# coder.serviceAccount.name -- The service account name
name:coder
# coder.serviceAccount.name -- Whether to create the service account or use existing service account
# coder.serviceAccount.disableCreate -- Whether to create the service account or use existing service account.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self review: drive-by typo fix

Comment on lines -35 to +36
pskSecretName:"coder-provisioner-psk"
keySecretName:"coder-provisionerd-key"
keySecretKey:"provisionerd-key"
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: advertising provisioner keys as the preferred auth method

Comment on lines +105 to +113
extraTemplates:
- |
apiVersion: v1
kind: ConfigMap
metadata:
name: some-other-config
namespace: {{ .Release.Namespace }}
data:
key: some-other-value
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: this isn't strictly necessary, but I figured it could be a potential point of confusion, so elected to clarify it here.

keySecretKey:"provisionerd-key"
```
## Specific Examples
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: these examples are essentially lifted from our tests

name: other-coder-provisioner
provisionerDaemon:
# ...
nameOverride: "other-coder-provisioner"
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: this setting is essentially buried inlibcoder, but it seems to be the best way to do this. Introducing a new separate variable here is just going to make things more complicated.

Comment on lines +2 to +4
{{- if not .Values.coder.serviceAccount.disableCreate }}
{{ include "libcoder.serviceaccount" (list . "coder.serviceaccount") }}
{{- end }}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: this was added forhelm/coder in#14817 but not ported over here.

I'm not sure if it would be better to do it in libcoder, folks don't seem to look in there much.

type: RuntimeDefault
volumeMounts: []
restartPolicy: Always
serviceAccountName: other-coder-provisioner
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: the fact thatnameOverride has no bearing onserviceAccountName explicitly allows us to reference a pre-existing service account

@johnstcnjohnstcn marked this pull request as ready for reviewNovember 24, 2024 17:06
Copy link
Member

@ethanndicksonethanndickson left a comment

Choose a reason for hiding this comment

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

LGTM, but will let someone with more helm experience approve

@johnstcnjohnstcn removed the request for review fromspikecurtisNovember 25, 2024 10:23
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

LGTM

johnstcn reacted with heart emoji
@johnstcnjohnstcn merged commit7876dc5 intomainNov 25, 2024
30 checks passed
@johnstcnjohnstcn deleted the cj/helm-provisioner-sa-disable-create branchNovember 25, 2024 14:23
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ethanndicksonethanndicksonethanndickson left review comments

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Cannot deploy multiple provisioners on same namespace via Helm
3 participants
@johnstcn@dannykopping@ethanndickson

[8]ページ先頭

©2009-2025 Movatter.jp