Skip to content

Instantly share code, notes, and snippets.

@kostyrev
Created June 26, 2018 13:37
Show Gist options
  • Save kostyrev/43f8a9e60c9baf4dcb6917e31be49e31 to your computer and use it in GitHub Desktop.
Save kostyrev/43f8a9e60c9baf4dcb6917e31be49e31 to your computer and use it in GitHub Desktop.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ws-example
spec:
replicas: 1
template:
metadata:
labels:
app: wseg
spec:
containers:
- name: websocketexample
image: nicksardo/websocketexample
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
env:
- name: podname
valueFrom:
fieldRef:
fieldPath: metadata.name
---
apiVersion: v1
kind: Service
metadata:
name: ws-example-svc
labels:
app: wseg
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: wseg
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ws-example-svc
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
spec:
tls:
- secretName: websocket-tls
hosts:
- websocket.k.fasten.cloud
rules:
- host: websocket.k.fasten.cloud
http:
paths:
- backend:
serviceName: ws-example-svc
servicePort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment