-
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.
- Loading branch information
1 parent
84af7fc
commit d9d5e36
Showing
7 changed files
with
239 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,6 @@ | ||
apiVersion: v2 | ||
name: nats-blackbox-exporter | ||
description: A Helm chart for SnappCloud/Platform NATS BlackBox Exporter | ||
type: application | ||
version: 0.0.0 | ||
appVersion: latest |
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "blackbox-exporter.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 "blackbox-exporter.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 "blackbox-exporter.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "blackbox-exporter.labels" -}} | ||
helm.sh/chart: {{ include "blackbox-exporter.chart" . }} | ||
{{ include "blackbox-exporter.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "blackbox-exporter.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "blackbox-exporter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "blackbox-exporter.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "blackbox-exporter.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "blackbox-exporter.fullname" . }} | ||
data: | ||
config.yaml: | | ||
logger: | ||
level: {{ .Values.logLevel | quote}} | ||
nats: | ||
streams: {{ .Values.nats.streams | toYaml | nindent 8 }} | ||
url: nats://{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local:4222 | ||
publish_interval: {{ .Values.nats.publish_interval | quote }} | ||
request_timeout: {{ .Values.nats.request_timeout | quote }} | ||
max_pub_acks_inflight: {{ .Values.nats.rmax_pub_acks_inflight | quote }} | ||
queue_subscription_group: {{ .Values.nats.queue_subscription_group | quote }} | ||
flush_timeout: {{ .Values.nats.flush_timeout | quote }} | ||
new_stream_allow: {{ .Values.nats.new_stream_allow }} | ||
metric: | ||
server: | ||
address: ":8080" | ||
enabled: true |
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,55 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "blackbox-exporter.fullname" . }} | ||
labels: | ||
{{- include "blackbox-exporter.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "blackbox-exporter.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "blackbox-exporter.labels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
args: | ||
- --configPath | ||
- /app/setting/config.yaml | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: metrics | ||
containerPort: {{ .Values.metrics.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
{{- toYaml .Values.livenessProbe | nindent 12 }} | ||
readinessProbe: | ||
{{- toYaml .Values.readinessProbe | nindent 12 }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
volumeMounts: | ||
- name: config | ||
mountPath: /app/setting | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ include "blackbox-exporter.fullname" . }} |
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,12 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PodMonitor | ||
metadata: | ||
name: {{ include "blackbox-exporter.fullname" . }} | ||
labels: | ||
{{- include "blackbox-exporter.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "blackbox-exporter.selectorLabels" . | nindent 6 }} | ||
podMetricsEndpoints: | ||
- port: metrics |
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,60 @@ | ||
# Default values for blackbox-exporter. | ||
# to disable exporter just set replicaCount to 0 | ||
replicaCount: 1 | ||
|
||
image: | ||
repository: ghcr.io/snapp-incubator/nats-blackbox-exporter | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "" | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
podAnnotations: {} | ||
podLabels: {} | ||
|
||
podSecurityContext: {} | ||
# fsGroup: 2000 | ||
|
||
securityContext: {} | ||
# capabilities: | ||
# drop: | ||
# - ALL | ||
# readOnlyRootFilesystem: true | ||
# runAsNonRoot: true | ||
# runAsUser: 1000 | ||
|
||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
|
||
metrics: | ||
port: 8080 | ||
livenessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: metrics | ||
readinessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: metrics | ||
|
||
logLevel: debug | ||
|
||
nats: | ||
streams: | ||
- name: "stream" | ||
subject: "test" | ||
url: "localhost:4222" | ||
publish_interval: 2s | ||
request_timeout: 50ms | ||
max_pub_acks_inflight: 1000 | ||
queue_subscription_group: "group" | ||
flush_timeout: 2s | ||
new_stream_allow: false |