Skip to content

Instantly share code, notes, and snippets.

@nordineb
Last active June 3, 2022 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nordineb/16b5732980a91e14fbfff9f8beaac047 to your computer and use it in GitHub Desktop.
Save nordineb/16b5732980a91e14fbfff9f8beaac047 to your computer and use it in GitHub Desktop.
echoheaders HTTP2 GKE ingress global load balancer
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoheaders
spec:
replicas: 1
selector:
matchLabels:
app: echoheaders
template:
metadata:
labels:
app: echoheaders
spec:
containers:
- name: echoheaders
image: k8s.gcr.io/echoserver:1.10
ports:
- containerPort: 8443
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
---
apiVersion: v1
kind: Service
metadata:
annotations:
cloud.google.com/app-protocols: '{"myserviceport":"HTTP2"}'
name: echoheaders
labels:
app: echoheaders
spec:
type: NodePort
ports:
- port: 6678
targetPort: 8443
protocol: TCP
name: myserviceport
selector:
app: echoheaders
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echomap
annotations:
kubernetes.io/ingress.allow-http: "true"
spec:
tls:
- secretName: cert
defaultBackend:
service:
name: echoheaders
port:
number: 6678
@nordineb
Copy link
Author

nordineb commented Jun 3, 2022

Create self signed cert:

openssl genrsa -out test-ingress-1.key 4096

openssl req -new -key test-ingress-1.key -out test-ingress-1.csr \
    -subj "/CN=samn"

openssl x509 -req -days 30 -in test-ingress-1.csr -signkey test-ingress-1.key \
    -out test-ingress-1.crt
kubectl create secret tls cert --cert test-ingress-1.crt --key test-ingress-1.key

@nordineb
Copy link
Author

nordineb commented Jun 3, 2022

curl -k --http2-prior-knowledge  https://**IP** -v 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment