docs: document auto service discovery example

This commit is contained in:
Geoff Bourne
2018-05-26 14:03:04 -05:00
parent c49099f1cf
commit 50ff433fd0
5 changed files with 213 additions and 13 deletions
+36 -2
View File
@@ -1,5 +1,32 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mc-router
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: services-watcher
rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["watch","list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: mc-router-services-watcher
subjects:
- kind: ServiceAccount
name: mc-router
namespace: default
roleRef:
kind: ClusterRole
name: services-watcher
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Service
metadata:
name: mc-router
@@ -27,15 +54,18 @@ spec:
selector:
matchLabels:
run: mc-router
strategy:
type: Recreate
template:
metadata:
labels:
run: mc-router
spec:
serviceAccountName: mc-router
containers:
- image: itzg/mc-router:1.0.1
- image: itzg/mc-router:1.1.1
name: mc-router
args: ["--api-binding", ":8080"]
args: ["--api-binding", ":8080", "--in-kube-cluster"]
ports:
- name: proxy
containerPort: 25565
@@ -46,6 +76,8 @@ apiVersion: v1
kind: Service
metadata:
name: mc-stable
annotations:
"mc-router.itzg.me/externalServerName": "mc.your.domain"
spec:
ports:
- port: 25565
@@ -90,6 +122,8 @@ apiVersion: v1
kind: Service
metadata:
name: mc-snapshot
annotations:
"mc-router.itzg.me/externalServerName": "mc-snapshot.your.domain"
spec:
ports:
- port: 25565