diff --git a/charts/drone/Chart.yaml b/charts/drone/Chart.yaml index 9142095..b801b20 100644 --- a/charts/drone/Chart.yaml +++ b/charts/drone/Chart.yaml @@ -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/ diff --git a/charts/drone/templates/deployment.yaml b/charts/drone/templates/deployment.yaml index ba17b54..6e10310 100644 --- a/charts/drone/templates/deployment.yaml +++ b/charts/drone/templates/deployment.yaml @@ -29,6 +29,8 @@ spec: automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + serviceAccount: {{ .Values.serviceAccount.name }} + serviceAccountName: {{ .Values.serviceAccount.name }} containers: - name: server securityContext: diff --git a/charts/drone/templates/serviceaccount.yaml b/charts/drone/templates/serviceaccount.yaml new file mode 100644 index 0000000..8c4fc5e --- /dev/null +++ b/charts/drone/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +{{- if .Values.serviceAccount.create }} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name }} + annotations: +{{ toYaml .Values.serviceAccount.annotations | indent 4 }} +{{- end }} diff --git a/charts/drone/values.schema.json b/charts/drone/values.schema.json index 3df25a1..ece2e06 100644 --- a/charts/drone/values.schema.json +++ b/charts/drone/values.schema.json @@ -9,6 +9,7 @@ "fullnameOverride", "podSecurityContext", "securityContext", + "serviceAccount", "podAnnotations", "service", "ingress", @@ -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" + } + } + }, "podAnnotations": { "$id": "#/properties/podAnnotations", "type": "object" @@ -165,4 +184,4 @@ } } } -} \ No newline at end of file +} diff --git a/charts/drone/values.yaml b/charts/drone/values.yaml index f041adb..311df53 100644 --- a/charts/drone/values.yaml +++ b/charts/drone/values.yaml @@ -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. ## @@ -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/ ##