Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/drone/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: drone
description: Drone is a self-service Continuous Delivery platform for busy development teams
# TODO: Un-comment once we move back to apiVersion: v2.
# type: application
version: 0.1.7
version: 0.1.8
appVersion: 1.9.0
kubeVersion: "^1.13.0-0"
home: https://drone.io/
Expand Down
2 changes: 2 additions & 0 deletions charts/drone/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccount: {{ .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}
Comment on lines +32 to +33

Choose a reason for hiding this comment

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

Suggested change
serviceAccount: {{ .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}

I think you only need serviceAccountName.

containers:
- name: server
securityContext:
Expand Down
9 changes: 9 additions & 0 deletions charts/drone/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if .Values.serviceAccount.create }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
annotations:
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}

Choose a reason for hiding this comment

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

I like using nindent to keep the template indentation aligned with the yaml indentation.

Suggested change
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}

{{- end }}
21 changes: 20 additions & 1 deletion charts/drone/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"fullnameOverride",
"podSecurityContext",
"securityContext",
"serviceAccount",
"podAnnotations",
"service",
"ingress",
Expand Down Expand Up @@ -66,6 +67,24 @@
"$id": "#/properties/securityContext",
"type": "object"
},
"serviceAccount": {
"$id": "#/properties/serviceAccount",
"type": "object",
"required": [
"name",
"create"
],
"properties": {
"name": {
"$id": "#/properties/serviceAccount/name",
"type": "string"
},
"create": {
"$id": "#/properties/serviceAccount/create",
"type": "boolean"
}
}
},
Comment on lines +70 to +87
Copy link

@cognifloyd cognifloyd Sep 2, 2021

Choose a reason for hiding this comment

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

whitespacing is inconsistent. You've got tabs and a trailing space.
Also, I recommend adding annotations here as well.

Suggested change
"serviceAccount": {
"$id": "#/properties/serviceAccount",
"type": "object",
"required": [
"name",
"create"
],
"properties": {
"name": {
"$id": "#/properties/serviceAccount/name",
"type": "string"
},
"create": {
"$id": "#/properties/serviceAccount/create",
"type": "boolean"
}
}
},
"serviceAccount": {
"$id": "#/properties/serviceAccount",
"type": "object",
"required": [
"name",
"create"
],
"properties": {
"name": {
"$id": "#/properties/serviceAccount/properties/name",
"type": "string"
},
"create": {
"$id": "#/properties/serviceAccount/properties/create",
"type": "boolean"
},
"annotations": {
"$id": "#/properties/serviceAccount/properties/annotations",
"type": "object"
}
}
},

"podAnnotations": {
"$id": "#/properties/podAnnotations",
"type": "object"
Expand Down Expand Up @@ -165,4 +184,4 @@
}
}
}
}
}
12 changes: 11 additions & 1 deletion charts/drone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

## If you need to run drone under a specific kubernetes service account, pass in
## the name and any annotations here.
## If you need the service account created, set create: to true
## Annotations are added to service account only when create: true.
serviceAccount:
name: default
create: false
annotations: {}

## Add extra annotations to the Drone server pods here. See below example for
## Prometheus scrape annotations.
##
Expand Down Expand Up @@ -159,7 +168,8 @@ env:
## REQUIRED: Set the user-visible Drone hostname, sans protocol.
## Ref: https://docs.drone.io/installation/reference/drone-server-host/
##
DRONE_SERVER_HOST: ""
DRONE_SERVER_HOST: drone.company.com

## The protocol to pair with the value in DRONE_SERVER_HOST (http or https).
## Ref: https://docs.drone.io/installation/reference/drone-server-proto/
##
Expand Down