kubernetes/docs/user-guide/walkthrough/replication-controller.yaml

25 lines
609 B
YAML
Raw Normal View History

2015-06-11 04:25:54 +08:00
apiVersion: v1
2014-10-21 13:44:14 +08:00
kind: ReplicationController
2015-05-08 08:55:36 +08:00
metadata:
name: nginx-controller
spec:
2014-10-21 13:44:14 +08:00
replicas: 2
# selector identifies the set of Pods that this
# replication controller is responsible for managing
2015-05-08 08:55:36 +08:00
selector:
app: nginx
# podTemplate defines the 'cookie cutter' used for creating
2014-10-21 13:44:14 +08:00
# new pods when necessary
2015-05-08 08:55:36 +08:00
template:
metadata:
labels:
# Important: these labels need to match the selector above
# The api server enforces this constraint.
app: nginx
2015-05-08 08:55:36 +08:00
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80