Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvp for a production service #1

Merged
merged 24 commits into from
May 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add extraArgs chart parameter
  • Loading branch information
jhoblitt committed Apr 29, 2024
commit 37d127a0bc52c24dcb6799e4348421e12478b8f2
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,13 +19,29 @@ docker push lsstit/gnocpush
docker run -e GNOC_USERNAME=$GNOC_USERNAME -e GNOC_PASSWORD=$GNOC_PASSWORD -e GNOC_SERVER=$GNOC_SERVER -e GNOC_REALM=$GNOC_REALM --network=host lsstit/gnocpush
```

## Testing gnocgateway with curl
## Testing on k8s

```bash
curl http://localhost:8080/push -v --json @- -u alertmanager:hello < alerts.json
helm upgrade --install \
gnocpush ./charts/gnocpush \
--create-namespace --namespace gnocpush \
-f ./values.yaml
```

## Testing gnocgateway with curl
```bash
k logs alertmanager-kube-prometheus-stack-alertmanager-0 --tail=100 -f

k logs -l app.kubernetes.io/instance=gnocpush -f
```

### prometheus metrics

```bash
k -n gnocpush port-forward gnocpush-dc4d94d8-mqvqq 8080
$ curl localhost:8080/metrics
```

## Testing gnocpush with curl

### without auth

45 changes: 45 additions & 0 deletions charts/gnocpush/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# gnocpush

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)

Push Prometheus Alertmanager webhook payloads to Global NOC

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| extraArgs | list | `[]` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/lsst-it/gnocpush"` | |
| image.tag | string | `""` | |
| 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 | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| service.port | int | `8080` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `false` | |
| serviceAccount.name | string | `""` | |
| serviceMonitor.enabled | bool | `true` | |
| serviceMonitor.labels | object | `{}` | |
| serviceMonitor.namespace | string | `""` | |
| tolerations | list | `[]` | |

5 changes: 5 additions & 0 deletions charts/gnocpush/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -33,6 +33,11 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- --listen=0.0.0.0:{{ .Values.service.port }}
{{- if .Values.extraArgs }}
{{- toYaml .Values.extraArgs | nindent 12 }}
{{- end }}
env:
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
2 changes: 2 additions & 0 deletions charts/gnocpush/values.yaml
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

extraArgs: []

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""