Docker image and Kubernetes configuration for exposing services over TLS
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resource
scripts
.travis.yml
Dockerfile
README.md
tlsrouter-configmap-config.yaml
tlsrouter-deployment.yaml
tlsrouter-service.yaml

README.md

tlsrouter

This example exposes kubernetes.default.svc. This is a bad idea for production.

Example deployment - components

Components

Example deployment - sequence

Sequence

Configurations

Note: you have to expose this as a service

Example deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tlsrouter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tlsrouter
  template:
    metadata:
      name: tlsrouter
      labels:
        app: tlsrouter
    spec:
      containers:
        - image: 'hub.docker.com/michielkalkman/tlsrouter:latest'
          imagePullPolicy: IfNotPresent
          name: tlsrouter
          args:
          - '/bin/tlsrouter'
          - '-conf'
          - '/etc/tlsrouter/tlsrouter.conf'
          - '-listen'
          - ':8443'
          ports:
            - containerPort: 8443
              protocol: TCP
          resources: {}
          securityContext:
            capabilities:
              drop:
              - all
          volumeMounts:
            - mountPath: /etc/tlsrouter
              name: tlsrouter-config
      volumes:
        - configMap:
            defaultMode: 420
            name: tlsrouter-config
          name: tlsrouter-config

Example configmap.yaml

apiVersion: apps/v1
kind: ConfigMap
metadata:
  name: tlsrouter-config
data:
  tlsrouter.conf: |
    /.*/ kubernetes.default:443