Skip to content

Instantly share code, notes, and snippets.

@iameli
Created January 1, 2016 02:48
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 iameli/1c8f82ecabeeacb870a3 to your computer and use it in GitHub Desktop.
Save iameli/1c8f82ecabeeacb870a3 to your computer and use it in GitHub Desktop.
My attempt to make one ELB balance multiple Kubernetes services.
apiVersion: v1
kind: Service
metadata:
name: balancer
namespace: default
spec:
type: ClusterIP
clusterIP: 10.3.0.101
selector:
app: balancer
ports:
- name: https
protocol: TCP
port: 443
targetPort: 443
- name: http
protocol: TCP
port: 80
targetPort: 80
apiVersion: v1
kind: Endpoints
metadata:
name: elb
subsets:
- addresses:
- ip: 10.3.0.101
ports:
- port: 80
name: http
- port: 443
name: https
- addresses:
- ip: 10.3.0.100
ports:
- port: 25565
name: minecraft
apiVersion: v1
kind: Service
metadata:
name: elb
spec:
type: LoadBalancer
ports:
- port: 80
protocol: TCP
name: http
- port: 443
protocol: TCP
name: https
- port: 25565
protocol: TCP
name: minecraft
apiVersion: v1
kind: Service
metadata:
name: minecraft
namespace: default
spec:
type: ClusterIP
clusterIP: 10.3.0.100
selector:
app: minecraft
ports:
- protocol: TCP
port: 25565
targetPort: 25565
nodePort: 31100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment