-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(canary): add prometheus push metrics (#36)
- Loading branch information
1 parent
a180a06
commit 49b6e15
Showing
14 changed files
with
561 additions
and
141 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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,93 @@ | ||
{{- if and .Values.controller.enabled (eq .Values.controller.mode "daemonset") }} | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: {{ include "canary.fullname" . }}-controller | ||
namespace: {{ .Release.Namespace }} | ||
|
||
labels: | ||
app: {{ include "canary.labels.app" . }} | ||
component: controller | ||
chart: {{ include "canary.labels.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- range $key, $value := .Values.controller.labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
annotations: | ||
{{- range $key, $value := .Values.controller.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
|
||
spec: | ||
|
||
selector: | ||
matchLabels: | ||
app: {{ include "canary.labels.app" . }} | ||
component: controller | ||
release: {{ .Release.Name }} | ||
|
||
updateStrategy: | ||
{{- if eq .Values.controller.daemonset.updateStrategy "RollingUpdate" }} | ||
rollingUpdate: | ||
maxUnavailable: {{ .Values.controller.daemonset.maxUnavailable }} | ||
{{- end }} | ||
type: {{ .Values.controller.daemonset.updateStrategy }} | ||
|
||
template: | ||
metadata: | ||
labels: | ||
app: {{ include "canary.labels.app" . }} | ||
component: controller | ||
chart: {{ include "canary.labels.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
{{- range $key, $value := .Values.controller.labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
annotations: | ||
{{- range $key, $value := .Values.controller.podAnnotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- range $key, $value := .Values.controller.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
|
||
spec: | ||
|
||
restartPolicy: Always | ||
serviceAccountName: canaryhttpmonitor | ||
|
||
tolerations: {{ toYaml .Values.controller.tolerations | nindent 8 }} | ||
nodeSelector: {{ toYaml .Values.controller.nodeSelector | nindent 8 }} | ||
affinity: {{ toYaml .Values.controller.affinity | nindent 8 }} | ||
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriod }} | ||
|
||
containers: | ||
- name: controller | ||
{{- include "canary.image" (dict "image" .Values.controller.image) | indent 10 }} | ||
|
||
ports: | ||
- containerPort: 8080 | ||
|
||
envFrom: | ||
{{- include "canary.envFrom" (dict "Release" .Release "Values" .Values "extraEnv" .Values.controller.extraEnvFrom) | indent 12 }} | ||
env: | ||
# Make the controller aware of where it is in the cluster | ||
- name: CANARY_K8S_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: CANARY_K8S_POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: CANARY_K8S_POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: CANARY_K8S_RELEASE_NAME | ||
value: {{ .Release.Name }} | ||
{{- include "canary.env" (dict "Release" .Release "Values" .Values "extraEnv" .Values.controller.extraEnv) | indent 12 }} | ||
|
||
{{- end }} |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{{- if .Values.monitor.example.enabled }} | ||
apiVersion: "canary.ukserp.ac.uk/v1" | ||
kind: CanaryHTTPMonitor | ||
metadata: | ||
name: github | ||
name: github-canary | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
url: https://api.github.com/octocat | ||
interval: 30 #seconds | ||
|
||
url: https://github.com/SwanseaUniversityMedical/Canary | ||
interval: 60 #seconds | ||
status: 200 | ||
{{- end }} |
This file contains 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
Oops, something went wrong.