diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 363a2df..509b6fb 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -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 }} @@ -40,7 +41,7 @@ spec: - containerPort: 80 envFrom: - secretRef: - name: "{{ .Values.datadogservice.datadogSecret }}" + name: "{{ include "datadog-service.fullname" . }}" env: - name: CONFIGURATION_SERVICE value: "http://localhost:8081/configuration-service" @@ -48,10 +49,6 @@ spec: value: 'production' - name: LOG_LEVEL value: "{{ .Values.datadogservice.logLevel }}" - livenessProbe: - httpGet: - path: /health - port: 10999 resources: {{- toYaml .Values.resources | nindent 12 }} - name: distributor @@ -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" diff --git a/helm/templates/secret.yaml b/helm/templates/secret.yaml new file mode 100644 index 0000000..6b16104 --- /dev/null +++ b/helm/templates/secret.yaml @@ -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 -}} \ No newline at end of file diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml index f3d44c1..d0ce605 100644 --- a/helm/templates/service.yaml +++ b/helm/templates/service.yaml @@ -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: diff --git a/helm/templates/serviceaccount.yaml b/helm/templates/serviceaccount.yaml index eed8989..19542aa 100644 --- a/helm/templates/serviceaccount.yaml +++ b/helm/templates/serviceaccount.yaml @@ -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 }} @@ -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 }} diff --git a/helm/values.yaml b/helm/values.yaml index dbbf93d..486d456 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -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: @@ -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