Skip to content

Commit

Permalink
fix: bring helm chart to a working state
Browse files Browse the repository at this point in the history
  • Loading branch information
vadasambar committed Feb 23, 2022
1 parent 7fed81a commit f73609e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 9 deletions.
32 changes: 27 additions & 5 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "datadog-service.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "datadog-service.labels" . | nindent 4 }}

Expand Down Expand Up @@ -40,18 +41,14 @@ spec:
- containerPort: 80
envFrom:
- secretRef:
name: "{{ .Values.datadogservice.datadogSecret }}"
name: "{{ include "datadog-service.fullname" . }}"
env:
- name: CONFIGURATION_SERVICE
value: "http://localhost:8081/configuration-service"
- name: env
value: 'production'
- name: LOG_LEVEL
value: "{{ .Values.datadogservice.logLevel }}"
livenessProbe:
httpGet:
path: /health
port: 10999
resources:
{{- toYaml .Values.resources | nindent 12 }}
- name: distributor
Expand Down Expand Up @@ -83,6 +80,31 @@ spec:
value: "{{ .Values.distributor.projectFilter }}"
- name: SERVICE_FILTER
value: "{{ .Values.distributor.serviceFilter }}"
- name: VERSION
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/version'']'
- name: K8S_DEPLOYMENT_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/name'']'
- name: K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
{{- if .Values.remoteControlPlane.enabled }}
- name: KEPTN_API_ENDPOINT
value: "{{ .Values.remoteControlPlane.api.protocol }}://{{ .Values.remoteControlPlane.api.hostname }}/api"
Expand Down
15 changes: 15 additions & 0 deletions helm/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if not .Values.datadogservice.existingSecret -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "datadog-service.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "datadog-service.labels" . | nindent 4 }}
type: Opaque
data:
DD_API_KEY: {{ required "A valid DD_API_KEY is required to connect to the Datadog API" .Values.datadogservice.ddApikey | b64enc | quote }}
DD_APP_KEY: {{ required "A valid DD_API_KEY is required to connect to the Datadog API" .Values.datadogservice.ddAppKey | b64enc | quote }}
DD_SITE: {{ required "A valid DD_API_KEY is required to connect to the Datadog API" .Values.datadogservice.ddSite | b64enc | quote }}

{{- end -}}
1 change: 1 addition & 0 deletions helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "datadog-service.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "datadog-service.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "datadog-service.serviceAccountName" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "datadog-service.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand All @@ -14,6 +15,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: keptn-{{ .Release.Namespace }}-datadog-service-cluster-admin
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "datadog-service.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand Down
16 changes: 12 additions & 4 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Sets namespace for all the templates (set to chart release's namespace if empty)
namespace: keptn
datadogservice:
logLevel: debug
# Set to DD_API_KEY in the chart's Secret
ddApikey: ""
# Set to DD_APP_KEY in the chart's Secret
ddAppKey: ""
# Set to DD_SITE in the chart's Secret
ddSite: ""
# Secret containing datadog's DD_API_KEY
# DD_APP_KEY and DD_SITE (key names should be an exact match)
datadogSecret: datadog-secret
# DD_APP_KEY, DD_API_KEY and DD_SITE (key names should be an exact match)
existingSecret: "" # If you want to use existing Secret in the cluster
image:
repository: ghcr.io/vadasambar/datadog-service # Container Image Name
repository: ghcr.io/keptn-sandbox/datadog-service # Container Image Name
pullPolicy: IfNotPresent # Kubernetes Image Pull Policy
tag: 0.1.0 # Container Tag
service:
Expand All @@ -17,7 +25,7 @@ distributor:
image:
repository: ghcr.io/keptn/distributor # Container Image Name
pullPolicy: IfNotPresent # Kubernetes Image Pull Policy
tag: "" # Container Tag
tag: "0.10.0" # Container Tag

remoteControlPlane:
enabled: false # Enables remote execution plane mode
Expand Down

0 comments on commit f73609e

Please sign in to comment.