From e6153495d364c546520ac988b45d12feeacc4525 Mon Sep 17 00:00:00 2001 From: rimas Date: Mon, 24 Jul 2017 16:18:18 +0100 Subject: [PATCH] add self-update and webhookrelay options --- chart/keel/Chart.yaml | 4 +- chart/keel/templates/deployment.yaml | 25 ++++++++- .../keel/templates/secrets-webhookrelay.yaml | 16 ++++++ chart/keel/values.yaml | 53 ++++++++++++++----- 4 files changed, 81 insertions(+), 17 deletions(-) create mode 100644 chart/keel/templates/secrets-webhookrelay.yaml diff --git a/chart/keel/Chart.yaml b/chart/keel/Chart.yaml index 547f79b3..bbf386ac 100644 --- a/chart/keel/Chart.yaml +++ b/chart/keel/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: keel description: Open source, tool for automating Kubernetes deployment updates. Keel is stateless, robust and lightweight. -version: 0.1.0 -appversion: 0.4.0-rc.2 +version: 0.1.1 +appversion: 0.4.0-rc.3 keywords: - kubernetes deployment - helm release diff --git a/chart/keel/templates/deployment.yaml b/chart/keel/templates/deployment.yaml index 636b521e..bbfa8ae6 100644 --- a/chart/keel/templates/deployment.yaml +++ b/chart/keel/templates/deployment.yaml @@ -11,7 +11,7 @@ metadata: annotations: kubernetes.io/service-account.name: keel spec: - replicas: {{ .Values.replicaCount }} + replicas: 1 template: metadata: labels: @@ -65,3 +65,26 @@ spec: timeoutSeconds: 10 resources: {{ toYaml .Values.resources | indent 12 }} +{{- if .Values.webhookRelay.enabled }} + - name: webhookrelayd + image: "{{ .Values.webhookRelay.image.repository }}:{{ .Values.webhookRelay.image.tag }}" + imagePullPolicy: {{ .Values.webhookRelay.image.pullPolicy }} + command: ["/webhookrelayd"] + env: + - name: KEY + valueFrom: + secretKeyRef: + name: {{ template "name" . }}-webhookrelay + key: key + - name: SECRET + valueFrom: + secretKeyRef: + name: {{ template "name" . }}-webhookrelay + key: secret + - name: BUCKET + value: "{{ .Values.webhookRelay.bucket }}" + resources: +{{ toYaml .Values.resources | indent 12 }} +{{- end }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/chart/keel/templates/secrets-webhookrelay.yaml b/chart/keel/templates/secrets-webhookrelay.yaml new file mode 100644 index 00000000..db9d38f1 --- /dev/null +++ b/chart/keel/templates/secrets-webhookrelay.yaml @@ -0,0 +1,16 @@ +{{- if .Values.webhookRelay.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "name" . }}-webhookRelay + namespace: kube-system + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + key: {{ .Values.webhookRelay.key | b64enc }} + secret: {{ .Values.webhookRelay.secret | b64enc }} +{{- end }} diff --git a/chart/keel/values.yaml b/chart/keel/values.yaml index ed243ba3..161d4282 100644 --- a/chart/keel/values.yaml +++ b/chart/keel/values.yaml @@ -2,8 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 - image: repository: karolisr/keel tag: 0.4.0-rc.3 @@ -16,7 +14,6 @@ service: externalPort: 9300 internalPort: 9300 - # Polling is enabled by default, # you can disable it setting value below to false polling: @@ -39,6 +36,20 @@ webhook: enabled: false endpoint: "" +# Webhook Relay integration +# If you don’t want to expose your Keel service, you can use https://webhookrelay.com/ +# which can deliver webhooks to your internal Keel service through Keel sidecar container. +webhookRelay: + enabled: false + image: + repository: webhookrelay/webhookrelayd + tag: 0.2.7 + pullPolicy: IfNotPresent + # webhookrelay.com credentials + key: "" + secret: "" + bucket: "" + # Slack notification slack: enabled: false @@ -46,14 +57,28 @@ slack: channel: "" # Resources -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - #requests: - # cpu: 100m - # memory: 128Mi +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 50m + memory: 64Mi + +# Keel self-update +# uncomment lines below if you want Keel to automaticly +# self-update to the latest release version +keel: + # keel policy (all/major/minor/patch/force) + policy: all + # trigger type, defaults to events such as pubsub, webhooks + trigger: poll + # polling schedule + pollSchedule: "@every 3m" + # images to track and update + images: + - repository: image.repository + tag: image.tag + +# NodeSelector +nodeSelector: {}