From 9e4b7dd5c136d94ee6d8ce1a96b55f4793f12dbf Mon Sep 17 00:00:00 2001 From: JacksChoco Date: Sat, 1 Aug 2020 23:06:51 +0900 Subject: [PATCH] pinpoint-collector deployment --- .../charts/pinpoint-collector/Chart.yaml | 6 ++ .../pinpoint-collector/templates/_helpers.tpl | 32 ++++++ .../templates/deployments.yaml | 98 +++++++++++++++++++ .../charts/pinpoint-collector/values.yaml | 9 ++ 4 files changed, 145 insertions(+) create mode 100644 install/kubernetes/helm/pinpoint/charts/pinpoint-collector/Chart.yaml create mode 100644 install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/_helpers.tpl create mode 100644 install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/deployments.yaml diff --git a/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/Chart.yaml b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/Chart.yaml new file mode 100644 index 0000000..3f93197 --- /dev/null +++ b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +name: pinpoint-collector +description: Helm chart for deploying Pinpoint collector +keywords: + - pinpoint + - collector \ No newline at end of file diff --git a/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/_helpers.tpl b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/_helpers.tpl new file mode 100644 index 0000000..6bb454b --- /dev/null +++ b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "pinpoint-collector.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "pinpoint-collector.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "pinpoint-collector.chart" -}} +{{- .Chart.Name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/deployments.yaml b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/deployments.yaml new file mode 100644 index 0000000..bc74b04 --- /dev/null +++ b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/templates/deployments.yaml @@ -0,0 +1,98 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pinpoint-collector.name" . }} + chart: {{ template "pinpoint-collector.chart" . }} + component: "collector" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "pinpoint-collector.fullname" . }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "pinpoint-collector.name" . }} + component: "collector" + release: {{ .Release.Name }} + strategy: + rollingUpdate: + maxSurge: {{ .Values.rollingMaxSurge }} + maxUnavailable: {{ .Values.rollingMaxUnavailable }} + template: + metadata: + labels: + app: {{ template "pinpoint-collector.name" . }} + component: "collector" + release: {{ .Release.Name }} + {{- if .Values.podAnnotations }} + annotations: +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + spec: + containers: + - name: pinpoint-collector +{{- if contains "/" .Values.image }} + image: "{{ .Values.image }}" +{{- else }} + image: "{{ .Values.global.hub }}/{{ .Values.image }}:{{ .Values.global.tag }}" +{{- end }} + imagePullPolicy: Always + env: + - name: CLUSTER_ENABLE + value: "{{ .Values.cluster.enalbe }}" + - name: CLUSTER_ZOOKEEPER_ADDRESS + value: "{{ .Values.cluster.zookeeperAddress }}" + - name: HBASE_HOST + value: "{{ .Values.hbase.host }}" + - name: HBASE_PORT + value: "{{ .Values.hbase.host }}" + - name: SPRING_PROFILES + value: "{{ .Values.profiles }}" + - name: FLINK_CLUSTER_ENABLE + value: "{{ .Values.flink.enable }}" + - name: FLINK_CLUSTER_ZOOKEEPER_ADDRESS + value: "{{ .Values.flink.zookeeperAddress }}" + - name: JAVA_OPTS + value: -Dspring.profiles.active=${SPRING_PROFILES} + - name: DEBUG_LEVEL + value: "{{ .Values.debugLevel }}" + ports: + - containerPort: 9080 + - containerPort: 9991 + - containerPort: 9992 + - containerPort: 9993 + - containerPort: 9994 + - containerPort: 9995 + - containerPort: 9996 + livenessProbe: + failureThreshold: 3 + httpGet: + path: /serverTime.pinpoint + port: 9080 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 2 + name: pinpoint-collector + readinessProbe: + failureThreshold: 3 + httpGet: + path: /serverTime.pinpoint + port: 9080 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 2 + resources: +{{- if .Values.resources }} +{{ toYaml .Values.resources | indent 12 }} +{{- end }} + affinity: + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 6 }} + {{- end }} \ No newline at end of file diff --git a/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/values.yaml b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/values.yaml index e69de29..ce1ea61 100644 --- a/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/values.yaml +++ b/install/kubernetes/helm/pinpoint/charts/pinpoint-collector/values.yaml @@ -0,0 +1,9 @@ +# +# pinpoint collector configuration +# +replicaCount: 1 +rollingMaxSurge: 1 +rollingMaxUnavailable: 1 +tolerations: [] +resources: {} +image: pinpointdocker/pinpoint-collector:2.0.4 \ No newline at end of file