Skip to content

Instantly share code, notes, and snippets.

@bgautrea
bgautrea / duckquacker-ingress.yaml
Last active September 24, 2019 20:36
nginx kubernetes-ingress proxy client and ssl client verify
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: duckquacker-ingress
annotations:
#ingress.kubernetes.io/ssl-redirect: "false"
custom.nginx.org/ssl-verify: "True"
custom.nginx.org/ssl-client-cert: "/etc/nginx/secrets/client"
nginx.org/ssl-services: "mangos-svc"
custom.nginx.org/proxy-ssl-verify: "True"
-----BEGIN CERTIFICATE-----
MIIFnzCCA4egAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwZTELMAkGA1UEBhMCVVMx
DjAMBgNVBAgMBVRleGFzMRMwEQYDVQQHDApDZWRhciBQYXJrMRMwEQYDVQQKDApT
aG9vdGluZ0RCMRwwGgYDVQQDDBNyb290LnNob290aW5nZGIuY29tMB4XDTE5MDkz
MDEzNTE0M1oXDTI5MDkyNzEzNTE0M1owWDELMAkGA1UEBhMCVVMxDjAMBgNVBAgM
BVRleGFzMRMwEQYDVQQKDApTaG9vdGluZ0RCMSQwIgYDVQQDDBtpbnRlcm1lZGlh
dGUuc2hvb3RpbmdkYi5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC
AQD7QuKr0JGqmwgVR6aQm+LeoS++7yjlEs8jwsC5KiKqLNMGRassBrvNfCrxxUcf
KopaoyE4jSYfu3PDx907pPcSxwk0dmovOQR0LNvHDTFQUb5PYVrdCMV8goRTioH+
MGf4SwzvLQnsD+ljQ3NQJNJmiK3V4+QJaejq9GlRywj/CTyBWvKc4xFY2FkjzOMt
version: "2"
services:
nginx-plusunit:
image: nginx-plus2unit
hostname: nginx-plus2unit
domainname: nginxdemo.com
container_name: nginx-plus2unit
ports:
- "80:80"
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-config
namespace: nginx-ingress
data:
enable-debug: "True"
main-template: |
user nginx;
worker_processes {{.WorkerProcesses}};
FROM debian:stretch-slim
LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
ENV NGINX_PLUS_VERSION 19-1~stretch
ARG IC_VERSION
# Download certificate and key from the customer portal (https://cs.nginx.com)
# and copy to the build context
COPY nginx-repo.crt /etc/ssl/nginx/
#!/bin/bash
sed -i 's/\(.*keyval_zone.*\);/\1 sync;/g' nginx-config.yaml
sed -i 's/\(^data:.*\)/\1 \n stream-snippets:\n \
resolver kube-dns.kube-system.svc.cluster.local valid=5s;\n\n \
server {\n listen 0.0.0.0:12345;\n zone_sync;\n \
zone_sync_server nginx-ingress-headless.nginx-ingress.svc.cluster.local:12345 resolve;\n }\n/g' \
nginx-config.yaml
FROM centos:centos7
LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
ENV NGINX_PLUS_VERSION 19-1~stretch
ARG IC_VERSION
# Download certificate and key from the customer portal (https://cs.nginx.com)
# and copy to the build context
COPY nginx-repo.crt /etc/ssl/nginx/
subrequest_output_buffer_size 32k;
#
# API definition
#
location /api/f1 {
limit_except GET {}
set $upstream f1_ergast;
rewrite ^ /_f1 last;
}
# Policy section
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
server {
listen 8080;
server_name _;
access_log off;
location /api {
api write=off;
}
location = /dashboard.html {
root /usr/share/nginx/html;
}