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

25 lines
609 B
YAML
Raw Normal View History

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