Skip to content

Instantly share code, notes, and snippets.

@danehans
Last active January 31, 2017 18:41
Show Gist options
  • Select an option

  • Save danehans/b797bd6f8fb1d9d3aa7a to your computer and use it in GitHub Desktop.

Select an option

Save danehans/b797bd6f8fb1d9d3aa7a to your computer and use it in GitHub Desktop.
kube web-app test
apiVersion: v1
kind: Service
metadata:
labels:
name: web
role: service
name: web
spec:
type: NodePort
ports:
# the port that this service should serve on
- name: web
nodePort: 30302
port: 80
protocol: TCP
selector:
web: "true"
---
apiVersion: v1
kind: ReplicationController
metadata:
name: web
spec:
replicas: 2
selector:
web: "true"
template:
metadata:
labels:
name: web
web: "true"
role: web
spec:
containers:
- name: web
image: larsks/mini-httpd
env:
- name: WEB
value: "true"
ports:
- containerPort: 80
cat ~/Desktop/web-app2.yml
apiVersion: v1
kind: Service
metadata:
labels:
name: web
role: service
name: web2
spec:
type: NodePort
ports:
# the port that this service should serve on
- name: web
nodePort: 30303
port: 81
protocol: TCP
selector:
web: "true"
---
apiVersion: v1
kind: ReplicationController
metadata:
name: web2
spec:
replicas: 2
selector:
web: "true"
template:
metadata:
labels:
name: web
web: "true"
role: web
spec:
containers:
- name: web
image: larsks/mini-httpd
env:
- name: WEB
value: "true"
ports:
- containerPort: 81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment