Created
October 1, 2019 12:22
-
-
Save wsgoggway/c5dff4a07f11c9c5c628309ff25b2a7f to your computer and use it in GitHub Desktop.
Caddy K8s TLS
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
| kind: ConfigMap | |
| apiVersion: v1 | |
| metadata: | |
| name: caddy-config | |
| namespace: openfaas | |
| labels: | |
| app: caddy | |
| data: | |
| Caddyfile: | | |
| sub.mydomain.com { | |
| proxy / gateway:8080 { | |
| transparent | |
| } | |
| errors stderr | |
| tls [email protected] | |
| } |
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/v1beta2 | |
| kind: Deployment | |
| metadata: | |
| name: caddy | |
| namespace: openfaas | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: caddy | |
| template: | |
| metadata: | |
| labels: | |
| app: caddy | |
| spec: | |
| containers: | |
| - name: caddy | |
| image: stefanprodan/caddy:0.10.10 | |
| imagePullPolicy: Always | |
| command: ["caddy", "-agree", "--conf", "/Caddyfile"] | |
| ports: | |
| - containerPort: 80 | |
| protocol: TCP | |
| - containerPort: 443 | |
| protocol: TCP | |
| resources: | |
| limits: | |
| memory: 128Mi | |
| volumeMounts: | |
| - mountPath: /Caddyfile | |
| name: caddy-config | |
| subPath: Caddyfile | |
| volumes: | |
| - name: caddy-config | |
| configMap: | |
| name: caddy-config | |
| items: | |
| - key: Caddyfile | |
| path: Caddyfile | |
| mode: 0644 |
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: v1 | |
| kind: Service | |
| metadata: | |
| name: caddy-lb | |
| namespace: openfaas | |
| labels: | |
| app: caddy | |
| spec: | |
| type: LoadBalancer | |
| ports: | |
| - name: http | |
| port: 80 | |
| targetPort: 80 | |
| protocol: TCP | |
| - name: https | |
| port: 443 | |
| targetPort: 443 | |
| protocol: TCP | |
| selector: | |
| app: caddy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment