Skip to content

Instantly share code, notes, and snippets.

@boxrick
Created February 6, 2019 16:02
Show Gist options
  • Save boxrick/7897b87fba5457f2b5b9be294734ef3b to your computer and use it in GitHub Desktop.
Save boxrick/7897b87fba5457f2b5b9be294734ef3b to your computer and use it in GitHub Desktop.
GKE Container Native HTTPS
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: website
labels:
app: website
spec:
replicas: 1
template:
metadata:
labels:
app: website-app
spec:
containers:
- name: website
image: eu.gcr.io/apache-https
ports:
- name: container-443
containerPort: 443
readinessProbe:
httpGet:
scheme: HTTPS
port: container-443
failureThreshold: 2
initialDelaySeconds: 3
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 1
---
apiVersion: v1
kind: Service
metadata:
name: website-svc
annotations:
service.alpha.kubernetes.io/app-protocols: '{"https-port":"HTTPS"}'
cloud.google.com/neg: '{"ingress": true}'
spec:
type: NodePort
selector:
app: website-app
ports:
- name: https-port
targetPort: container-443
port: 443
protocol: TCP
---
apiVersion: v1
data:
tls.crt: BASE64CRT
tls.key: BASE64KEY
kind: Secret
metadata:
name: ssl-certs
type: Opaque
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: website-ing
spec:
tls:
- secretName: ssl-certs
backend:
serviceName: website-svc
servicePort: https-port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment