-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create Helm chart * add end2end test * generate helm-docs for chart * feat: update readme, codeowners --------- Signed-off-by: Frank Kloeker <[email protected]> Co-authored-by: [email protected] <[email protected]>
- Loading branch information
Showing
20 changed files
with
681 additions
and
13 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
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,84 @@ | ||
# This workflow installs 1 instance of sparrow and | ||
# verify the API output | ||
|
||
name: End2End Testing | ||
on: | ||
push: | ||
paths: | ||
- 'chart/**' | ||
|
||
jobs: | ||
end2end: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Set up K3S | ||
uses: debianmaster/actions-k3s@master | ||
id: k3s | ||
with: | ||
version: 'v1.26.9-k3s1' | ||
- name: Check Cluster | ||
run: | | ||
kubectl get nodes | ||
- name: Check Coredns Deployment | ||
run: | | ||
kubectl -n kube-system rollout status deployment/coredns --timeout=60s | ||
STATUS=$(kubectl -n kube-system get deployment coredns -o jsonpath={.status.readyReplicas}) | ||
if [[ $STATUS -ne 1 ]] | ||
then | ||
echo "Deployment coredns not ready" | ||
kubectl -n kube-system get events | ||
exit 1 | ||
else | ||
echo "Deployment coredns OK" | ||
fi | ||
- name: Check Metricsserver Deployment | ||
run: | | ||
kubectl -n kube-system rollout status deployment/metrics-server --timeout=60s | ||
STATUS=$(kubectl -n kube-system get deployment metrics-server -o jsonpath={.status.readyReplicas}) | ||
if [[ $STATUS -ne 1 ]] | ||
then | ||
echo "Deployment metrics-server not ready" | ||
kubectl -n kube-system get events | ||
exit 1 | ||
else | ||
echo "Deployment metrics-server OK" | ||
fi | ||
- name: Setup Helm | ||
run: | | ||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
helm version | ||
- name: Get Image Tag | ||
id: version | ||
run: echo "value=commit-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Install Sparrow | ||
run: | | ||
helm upgrade -i sparrow \ | ||
--atomic \ | ||
--timeout 300s \ | ||
--set extraArgs.loaderType=file \ | ||
--set extraArgs.loaderFilePath=/runconfig/checks.yaml \ | ||
--set image.tag=${{ steps.version.outputs.value }} \ | ||
chart | ||
- name: Check Pods | ||
run: | | ||
kubectl get pods | ||
- name: Wait for Sparrow | ||
run: | | ||
sleep 60 | ||
- name: Healthcheck | ||
run: | | ||
kubectl create job curl --image=quay.io/curl/curl:latest -- curl -f -v -H 'Content-Type: application/json' http://sparrow:8080/v1/metrics/health | ||
kubectl wait --for=condition=complete job/curl | ||
STATUS=$(kubectl get job curl -o jsonpath={.status.succeeded}) | ||
if [[ $STATUS -ne 1 ]] | ||
then | ||
echo "Job failed" | ||
kubectl logs -ljob-name=curl | ||
kubectl delete job curl | ||
exit 1 | ||
else | ||
echo "Job OK" | ||
kubectl delete job curl | ||
fi |
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 @@ | ||
repos: | ||
- repo: https://github.com/norwoodj/helm-docs | ||
rev: "v1.11.3" | ||
hooks: | ||
- id: helm-docs | ||
args: | ||
- --chart-search-root=chart |
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 |
---|---|---|
@@ -1 +1 @@ | ||
* @y-eight @NiklasTreml @puffitos @nico151999 @lvlcn-t | ||
* @y-eight @NiklasTreml @puffitos @nico151999 @lvlcn-t @eumel8 |
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,18 @@ | ||
apiVersion: v2 | ||
name: sparrow | ||
description: A Helm chart to install Sparrow | ||
type: application | ||
keywords: | ||
- monitoring | ||
version: 0.0.2 | ||
appVersion: "v0.1.0" | ||
icon: https://github.com/caas-team/sparrow/blob/main/docs/img/sparrow.png | ||
sources: | ||
- https://github.com/caas-team/sparrow | ||
maintainers: | ||
- name: eumel8 | ||
email: [email protected] | ||
url: https://www.telekom.com | ||
- name: y-eight | ||
email: [email protected] | ||
url: https://www.telekom.com |
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 @@ | ||
# sparrow | ||
|
||
![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) | ||
|
||
A Helm chart to install Sparrow | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| eumel8 | <[email protected]> | <https://www.telekom.com> | | ||
| y-eight | <[email protected]> | <https://www.telekom.com> | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/caas-team/sparrow> | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| affinity | object | `{}` | | | ||
| env | object | `{}` | | | ||
| extraArgs | object | `{"loaderFilePath":"/runconfig/checks.yaml","loaderType":"file"}` | extra command line start parameters see: https://github.com/caas-team/sparrow/blob/main/docs/sparrow_run.md | | ||
| fullnameOverride | string | `""` | | | ||
| image.pullPolicy | string | `"IfNotPresent"` | | | ||
| image.repository | string | `"ghcr.io/caas-team/sparrow"` | | | ||
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | ||
| imagePullSecrets | list | `[]` | | | ||
| ingress.annotations | object | `{}` | | | ||
| ingress.className | string | `""` | | | ||
| ingress.enabled | bool | `false` | | | ||
| ingress.hosts[0].host | string | `"chart-example.local"` | | | ||
| ingress.hosts[0].paths[0].path | string | `"/"` | | | ||
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ||
| ingress.tls | list | `[]` | | | ||
| nameOverride | string | `""` | | | ||
| networkPolicies | object | `{"proxy":{"enabled":false}}` | define a network policy that will open egress traffic to a proxy | | ||
| nodeSelector | object | `{}` | | | ||
| podAnnotations | object | `{}` | | | ||
| podLabels | object | `{}` | | | ||
| podSecurityContext.fsGroup | int | `1000` | | | ||
| podSecurityContext.supplementalGroups[0] | int | `1000` | | | ||
| replicaCount | int | `1` | | | ||
| resources | object | `{}` | | | ||
| runtimeConfig | object | `{"health":{"enabled":true,"healthEndpoint":false,"targets":["https://www.example.com/","https://www.google.com/"]},"latency":{"enabled":true,"interval":1,"retry":{"count":3,"delay":1},"targets":["https://example.com/","https://google.com/"],"timeout":3}}` | runtime configuration of the Sparrow see: https://github.com/caas-team/sparrow#runtime | | ||
| securityContext.allowPrivilegeEscalation | bool | `false` | | | ||
| securityContext.capabilities.drop[0] | string | `"ALL"` | | | ||
| securityContext.privileged | bool | `false` | | | ||
| securityContext.readOnlyRootFilesystem | bool | `true` | | | ||
| securityContext.runAsGroup | int | `1000` | | | ||
| securityContext.runAsUser | int | `1000` | | | ||
| service.port | int | `8080` | | | ||
| service.type | string | `"ClusterIP"` | | | ||
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | | ||
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? | | ||
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | ||
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | | ||
| tolerations | list | `[]` | | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "sparrow.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 "sparrow.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 "sparrow.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "sparrow.labels" -}} | ||
helm.sh/chart: {{ include "sparrow.chart" . }} | ||
{{ include "sparrow.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "sparrow.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "sparrow.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "sparrow.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "sparrow.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "startupConfig" -}} | ||
{{- range $key, $value := .Values.startupConfig }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.