-
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.
chore: adding tracetest-monitor-operator chart
- Loading branch information
1 parent
90ee231
commit 9a82cda
Showing
11 changed files
with
248 additions
and
6 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,30 @@ | ||
apiVersion: v2 | ||
name: tracetest-monitor-operator | ||
description: A Helm chart for Tracetest Cloud API | ||
|
||
home: https://github.com/kubeshop/tracetest-cloud-charts | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: v1.0.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: v1.4.3 | ||
dependencies: | ||
- name: tracetest-common | ||
version: v1.0.0 | ||
repository: file://../tracetest-common |
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,51 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "tracetest-monitor-operator.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 "tracetest-monitor-operator.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 "tracetest-monitor-operator.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "tracetest-monitor-operator.labels" -}} | ||
helm.sh/chart: {{ include "tracetest-monitor-operator.chart" . }} | ||
{{ include "tracetest-monitor-operator.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "tracetest-monitor-operator.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "tracetest-monitor-operator.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
11 changes: 11 additions & 0 deletions
11
charts/tracetest-monitor-operator/templates/configmap.yaml
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,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }}-config | ||
labels: | ||
{{- include "tracetest-monitor-operator.labels" . | nindent 4 }} | ||
data: | ||
TRACETEST_NATS_ENDPOINT: "{{ .Values.config.natsEndpoint }}" | ||
TRACETEST_TARGET_NAMESPACE: "{{ .Values.config.targetNamespace }}" | ||
TRACETEST_TARGET_SERVERURL: {{ include "tracetest-common.url" .Values.global.urls.web }} | ||
TRACETEST_TRACING_COLLECTORENDPOINT: "collector-opentelemetry-collector.otel:4317" |
56 changes: 56 additions & 0 deletions
56
charts/tracetest-monitor-operator/templates/deployment.yaml
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,56 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }} | ||
labels: | ||
{{- include "tracetest-monitor-operator.labels" . | nindent 4 }} | ||
spec: | ||
# the numbers for replicas and max surge/unavailable are set to speed up deployments. | ||
# The idea is that there is one "old" version running and one "new" version in parallel | ||
# and once that works the old version is scaled down and the new version is scaled up. | ||
# This timeline avoids the need to wait for new nodes to be started to satisfy requirements. | ||
replicas: {{ .Values.deployment.replicas }} | ||
strategy: | ||
{{- toYaml .Values.deployment.strategy | nindent 4 }} | ||
|
||
selector: | ||
matchLabels: | ||
{{- include "tracetest-monitor-operator.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
labels: | ||
{{- include "tracetest-monitor-operator.selectorLabels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "tracetest-monitor-operator.fullname" . }} | ||
imagePullSecrets: | ||
- name: {{ .Values.imagePullSecrets }} | ||
containers: | ||
- name: tracetestcloud | ||
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} | ||
env: | ||
- name: TRACETEST_NATS_ENDPOINT | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }}-config | ||
key: TRACETEST_NATS_ENDPOINT | ||
- name: TRACETEST_TARGET_NAMESPACE | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }}-config | ||
key: TRACETEST_TARGET_NAMESPACE | ||
- name: TRACETEST_TARGET_SERVERURL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }}-config | ||
key: TRACETEST_TARGET_SERVERURL | ||
- name: TRACETEST_TRACING_COLLECTORENDPOINT | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }}-config | ||
key: TRACETEST_TRACING_COLLECTORENDPOINT | ||
|
||
imagePullPolicy: Always | ||
resources: | ||
{{- toYaml .Values.deployment.resources | nindent 12 }} |
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,27 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }} | ||
rules: | ||
- apiGroups: ["batch"] | ||
resources: ["cronjobs"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "tracetest-monitor-operator.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "tracetest-monitor-operator.fullname" . }} | ||
namespace: {{.Release.Namespace}} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ include "tracetest-monitor-operator.fullname" . }} | ||
apiGroup: rbac.authorization.k8s.io |
6 changes: 6 additions & 0 deletions
6
charts/tracetest-monitor-operator/templates/target-namespace.yaml
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: v1 | ||
kind: Namespace | ||
metadata: | ||
name: "{{ .Values.config.targetNamespace }}" | ||
labels: | ||
{{- include "tracetest-monitor-operator.labels" . | nindent 4 }} |
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,25 @@ | ||
config: | ||
natsEndpoint: "nats://nats-headless.external:4222" | ||
targetNamespace: monitors | ||
targetServerUrl: "http://tracetest-cloud.tracetest-cloud:8090" | ||
|
||
deployment: | ||
replicas: 1 | ||
|
||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
|
||
resources: | ||
limits: | ||
memory: 128Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
|
||
image: | ||
repository: ghcr.io/kubeshop/tracetest-monitor-operator | ||
tag: v1.4.3 | ||
|
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,7 @@ | ||
echo "Add helm repositories" | ||
echo "" | ||
|
||
helm repo add traefik https://traefik.github.io/charts | ||
helm repo add ory https://k8s.ory.sh/helm/charts | ||
helm repo add jetstack https://charts.jetstack.io | ||
helm repo add nats https://nats-io.github.io/k8s/helm/charts/ |