Skip to content

Commit

Permalink
Fix/kustomize examples (#23)
Browse files Browse the repository at this point in the history
* auto update kustomize version

* update readme

* feat: provide overlay examples

* feat: provide overlay examples

* remove test server

* newline

* newline
  • Loading branch information
alesz authored Aug 5, 2024
1 parent bd90322 commit a6b08f4
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 108 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ jobs:
uses: go-semantic-release/[email protected]
with:
github-token: ${{ secrets.PAT }}
allow-initial-development-versions: true
allow-initial-development-versions: true
extra-plugins: |
@semantic-release/exec
7 changes: 7 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
["@semantic-release/exec", {
"publishCmd": "sed -i 's/\(newTag:\).*/\1 ${nextRelease.version}/' deploy/kustomize/overlays/*/kustomization.yaml"
}],
]
}
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@ This repository creates and publishes Docker image for deployment of Alertmanage

This proxy is useful for preventing sensitive information (e.g. IP addressess, hostnames, alert descriptions, etc.) leaving organisational boundaries when monitoring is outsourced to external entity.

For convenience, Dockerfile to couple filtering proxy with Signalilo is also provided.
For convenience, Dockerfile and deployment to couple filtering proxy with Signalilo is also provided.

## Installation

See `deploy/` for Kustomize based deployment.
See `deploy/kustomize` for Kustomize based deployment.

## Configuration

Patch ConfigMaps using Kustomize overlay. Example provided in `deploy/overlays/example`.

Separately deploy Secret named `signalilo`, containing key/value pairs:

```
SIGNALILO_ALERTMANAGER_BEARER_TOKEN: foo
SIGNALILO_ICINGA_PASSWORD: bar
```
Patch ConfigMaps using Kustomize overlay. Examples provided in `deploy/kustomize/overlays`.

### Proxy

Implicitly uses default HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables
Implicitly uses default HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables.

### Alertmanager

Expand All @@ -34,7 +27,7 @@ receivers:
- name: Default
webhook_configs:
- url: >-
http://signalilo-scrubbed.signalilo-scrubbed.svc.cluster.local:8080/webhook
http://scrubbed.scrubbed.svc.cluster.local:8080/webhook
send_resolved: true
http_config:
bearer_token: "foo"
Expand Down
16 changes: 0 additions & 16 deletions deploy/kustomize/base/configmap-signalilo.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data:
SCRUBBED_ALERT_LABELS: alertname severity
SCRUBBED_COMMON_ANNOTATIONS: ''
SCRUBBED_COMMON_LABELS: alertname severity
SCRUBBED_DESTINATION_URL: 'http://signalilo-scrubbed:8888/webhook'
SCRUBBED_DESTINATION_URL: 'http://receiver:8888/webhook'
SCRUBBED_GROUP_LABELS: ''
SCRUBBED_LISTEN_PORT: '8080'
SCRUBBED_LOG_LEVEL: INFO
46 changes: 3 additions & 43 deletions deploy/kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,17 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: signalilo-scrubbed
name: scrubbed
spec:
replicas: 1
selector: {}
template:
spec:
serviceAccountName: signalilo-scrubbed
serviceAccountName: scrubbed
tolerations:
- effect: NoSchedule
operator: Exists
containers:
- resources:
limits:
cpu: 20m
memory: 32Mi
requests:
cpu: 10m
memory: 16Mi
readinessProbe:
httpGet:
path: /healthz
port: 8888
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
terminationMessagePath: /dev/termination-log
name: signalilo
command:
- signalilo
livenessProbe:
httpGet:
path: /healthz
port: 8888
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
ports:
- containerPort: 8888
protocol: TCP
imagePullPolicy: Always
terminationMessagePolicy: File
envFrom:
- configMapRef:
name: signalilo
- secretRef:
name: signalilo
image: 'signalilo-scrubbed'
- resources:
limits:
cpu: 100m
Expand Down Expand Up @@ -89,7 +49,7 @@ spec:
envFrom:
- configMapRef:
name: scrubbed
image: signalilo-scrubbed
image: scrubbed
restartPolicy: Always
terminationGracePeriodSeconds: 10
dnsPolicy: ClusterFirst
Expand Down
25 changes: 10 additions & 15 deletions deploy/kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- serviceaccount.yaml
- deployment.yaml
- service.yaml
- configmap-scrubbed.yaml
- configmap-signalilo.yaml
- prometheusrule.yaml

images:
- name: signalilo-scrubbed
newName: quay.io/adfinis/signalilo-scrubbed
newTag: v0.2.0
- namespace.yaml
- serviceaccount.yaml
- deployment.yaml
- service.yaml
- configmap.yaml
- prometheusrule.yaml

labels:
- includeSelectors: true
pairs:
app.kubernetes.io/component: alerting
app.kubernetes.io/name: signalilo-scrubbed
- includeSelectors: true
pairs:
app.kubernetes.io/component: alerting
app.kubernetes.io/name: scrubbed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kind: Namespace
apiVersion: v1
metadata:
name: signalilo-scrubbed
name: scrubbed
6 changes: 1 addition & 5 deletions deploy/kustomize/base/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kind: Service
apiVersion: v1
metadata:
name: signalilo-scrubbed
name: scrubbed
spec:
sessionAffinityConfig:
clientIP:
Expand All @@ -11,10 +11,6 @@ spec:
protocol: TCP
port: 8080
targetPort: 8080
- name: signalilo
protocol: TCP
port: 8888
targetPort: 8888
internalTrafficPolicy: Cluster
type: ClusterIP
ipFamilyPolicy: SingleStack
Expand Down
2 changes: 1 addition & 1 deletion deploy/kustomize/base/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: signalilo-scrubbed
name: scrubbed
12 changes: 0 additions & 12 deletions deploy/kustomize/overlays/example/kustomization.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions deploy/kustomize/overlays/standalone/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: scrubbed

images:
- name: scrubbed
newName: quay.io/adfinis/scrubbed
newTag: v0.2.0

resources:
- ../../base
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ kind: ConfigMap
apiVersion: v1
metadata:
name: signalilo
immutable: false
data:
SIGNALILO_ALERTMANAGER_PLUGINOUTPUT_ANNOTATIONS: |
description
message
SIGNALILO_ALERTMANAGER_PORT: "8888"
SIGNALILO_ICINGA_CA: |
-----BEGIN CERTIFICATE-----
...
Expand Down
48 changes: 48 additions & 0 deletions deploy/kustomize/overlays/with-signalilo/deployment-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: scrubbed
spec:
template:
spec:
containers:
- resources:
limits:
cpu: 20m
memory: 32Mi
requests:
cpu: 10m
memory: 16Mi
readinessProbe:
httpGet:
path: /healthz
port: 8888
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
terminationMessagePath: /dev/termination-log
name: signalilo
command:
- signalilo
livenessProbe:
httpGet:
path: /healthz
port: 8888
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
ports:
- containerPort: 8888
protocol: TCP
imagePullPolicy: Always
terminationMessagePolicy: File
envFrom:
- configMapRef:
name: signalilo
- secretRef:
name: signalilo
image: scrubbed
18 changes: 18 additions & 0 deletions deploy/kustomize/overlays/with-signalilo/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: scrubbed

images:
- name: scrubbed
newName: quay.io/adfinis/scrubbed-signalilo
newTag: v0.2.0

resources:
- ../../base
- secret-signalilo.yaml
- configmap-signalilo.yaml

patches:
- path: deployment-patch.yaml
- path: service-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ metadata:
name: signalilo
stringData::
SIGNALILO_ALERTMANAGER_BEARER_TOKEN: foo
SIGNALILO_ICINGA_PASSWORD: bar
SIGNALILO_ICINGA_PASSWORD: bar
10 changes: 10 additions & 0 deletions deploy/kustomize/overlays/with-signalilo/service-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: Service
apiVersion: v1
metadata:
name: scrubbed
spec:
ports:
- name: signalilo
protocol: TCP
port: 8888
targetPort: 8888

0 comments on commit a6b08f4

Please sign in to comment.