- Notifications
You must be signed in to change notification settings - Fork928
feat(helm): add commandArgs for custom entrypoint#8567
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
5 commits Select commitHold shift + click to select a range
9239c2d
feat(helm): add args conditional for custom entrypoint
ericpaulsen1d9598b
refactor: commandArgs
ericpaulsene4dddde
add: nested conditional for wsproxy
ericpaulsen241866d
add: command_args test
ericpaulsenb3ae7d2
update helm test
deansheatherFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
8 changes: 6 additions & 2 deletionshelm/templates/coder.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -63,10 +63,14 @@ spec: | ||
command: | ||
{{- toYaml .Values.coder.command | nindent 12 }} | ||
args: | ||
{{- if .Values.coder.commandArgs }} | ||
{{- toYaml .Values.coder.commandArgs | nindent 12 }} | ||
{{- else }} | ||
{{- if .Values.coder.workspaceProxy }} | ||
- wsproxy | ||
{{- end }} | ||
- server | ||
ericpaulsen marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.coder.resources | nindent 12 }} | ||
lifecycle: | ||
4 changes: 4 additions & 0 deletionshelm/tests/chart_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
186 changes: 186 additions & 0 deletionshelm/tests/testdata/command_args.golden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
--- | ||
# Source: coder/templates/coder.yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: "coder" | ||
annotations: | ||
{} | ||
labels: | ||
helm.sh/chart: coder-0.1.0 | ||
app.kubernetes.io/name: coder | ||
app.kubernetes.io/instance: release-name | ||
app.kubernetes.io/part-of: coder | ||
app.kubernetes.io/version: "0.1.0" | ||
app.kubernetes.io/managed-by: Helm | ||
--- | ||
# Source: coder/templates/rbac.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: coder-workspace-perms | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: | ||
- create | ||
- delete | ||
- deletecollection | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: [""] | ||
resources: ["persistentvolumeclaims"] | ||
verbs: | ||
- create | ||
- delete | ||
- deletecollection | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
--- | ||
# Source: coder/templates/rbac.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: "coder" | ||
subjects: | ||
- kind: ServiceAccount | ||
name: "coder" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: coder-workspace-perms | ||
--- | ||
# Source: coder/templates/service.yaml | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: coder | ||
labels: | ||
helm.sh/chart: coder-0.1.0 | ||
app.kubernetes.io/name: coder | ||
app.kubernetes.io/instance: release-name | ||
app.kubernetes.io/part-of: coder | ||
app.kubernetes.io/version: "0.1.0" | ||
app.kubernetes.io/managed-by: Helm | ||
annotations: | ||
{} | ||
spec: | ||
type: LoadBalancer | ||
sessionAffinity: ClientIP | ||
ports: | ||
- name: "http" | ||
port: 80 | ||
targetPort: "http" | ||
protocol: TCP | ||
externalTrafficPolicy: "Cluster" | ||
selector: | ||
app.kubernetes.io/name: coder | ||
app.kubernetes.io/instance: release-name | ||
--- | ||
# Source: coder/templates/coder.yaml | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: coder | ||
labels: | ||
helm.sh/chart: coder-0.1.0 | ||
app.kubernetes.io/name: coder | ||
app.kubernetes.io/instance: release-name | ||
app.kubernetes.io/part-of: coder | ||
app.kubernetes.io/version: "0.1.0" | ||
app.kubernetes.io/managed-by: Helm | ||
annotations: | ||
{} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: coder | ||
app.kubernetes.io/instance: release-name | ||
template: | ||
metadata: | ||
labels: | ||
helm.sh/chart: coder-0.1.0 | ||
app.kubernetes.io/name: coder | ||
app.kubernetes.io/instance: release-name | ||
app.kubernetes.io/part-of: coder | ||
app.kubernetes.io/version: "0.1.0" | ||
app.kubernetes.io/managed-by: Helm | ||
annotations: | ||
{} | ||
spec: | ||
serviceAccountName: "coder" | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 60 | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/instance | ||
operator: In | ||
values: | ||
- coder | ||
topologyKey: kubernetes.io/hostname | ||
weight: 1 | ||
containers: | ||
- name: coder | ||
image: "ghcr.io/coder/coder:latest" | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /opt/coder | ||
args: | ||
- arg1 | ||
- arg2 | ||
resources: | ||
{} | ||
lifecycle: | ||
{} | ||
env: | ||
- name: CODER_HTTP_ADDRESS | ||
value: "0.0.0.0:8080" | ||
- name: CODER_PROMETHEUS_ADDRESS | ||
value: "0.0.0.0:2112" | ||
# Set the default access URL so a `helm apply` works by default. | ||
# See: https://github.com/coder/coder/issues/5024 | ||
- name: CODER_ACCESS_URL | ||
value: "http://coder.default.svc.cluster.local" | ||
# Used for inter-pod communication with high-availability. | ||
- name: KUBE_POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: CODER_DERP_SERVER_RELAY_URL | ||
value: "http://$(KUBE_POD_IP):8080" | ||
ports: | ||
- name: "http" | ||
containerPort: 8080 | ||
protocol: TCP | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: null | ||
runAsGroup: 1000 | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
seccompProfile: | ||
type: RuntimeDefault | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: "http" | ||
scheme: "HTTP" | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: "http" | ||
scheme: "HTTP" | ||
volumeMounts: [] | ||
volumes: [] |
6 changes: 6 additions & 0 deletionshelm/tests/testdata/command_args.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
coder: | ||
image: | ||
tag: latest | ||
commandArgs: | ||
- arg1 | ||
- arg2 |
3 changes: 3 additions & 0 deletionshelm/values.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.