Created
May 6, 2021 18:42
-
-
Save Lirt/c0cd37c1f76e01ce781710e210bc1c35 to your computer and use it in GitHub Desktop.
Nginx proxy for basic-auth from Loki to AlertManager
This file contains hidden or 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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-proxy-to-alertmanager | |
namespace: kube-system | |
labels: | |
app: nginx-proxy-to-alertmanager | |
group: monitoring | |
component: loki | |
spec: | |
selector: | |
matchLabels: | |
app: nginx-proxy-to-alertmanager | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: nginx-proxy-to-alertmanager | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:1.20.0 | |
ports: | |
- containerPort: 9093 | |
env: | |
- name: NGINX_PORT | |
value: "9093" | |
volumeMounts: | |
- name: config | |
mountPath: /etc/nginx/conf.d/ | |
volumes: | |
- name: config | |
configMap: | |
name: nginx-proxy-to-alertmanager | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-proxy-to-alertmanager | |
namespace: kube-system | |
labels: | |
app: nginx-proxy-to-alertmanager | |
group: monitoring | |
component: loki | |
spec: | |
type: ClusterIP | |
sessionAffinity: None | |
ports: | |
- name: http | |
port: 9093 | |
protocol: TCP | |
targetPort: 9093 | |
selector: | |
app: nginx-proxy-to-alertmanager | |
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
labels: | |
app: nginx-proxy-to-alertmanager | |
group: monitoring | |
component: loki | |
name: nginx-proxy-to-alertmanager | |
namespace: kube-system | |
data: | |
nginx-proxy-to-alertmanager.conf: | | |
server { | |
listen 9093; | |
server_name _; | |
location / { | |
proxy_pass https://<ALERTMANAGER_URL_WITHOUT_PORT>; | |
proxy_set_header Authorization "Basic <BASE64_PASSWORD>"; | |
} | |
location /api/v1/alerts { | |
proxy_pass https://<ALERTMANAGER_URL_WITHOUT_PORT>; | |
proxy_set_header Authorization "Basic <BASE64_PASSWORD>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment