apiVersion: v1 kind: ReplicationController metadata: name: nginx-controller spec: replicas: 2 # selector identifies the set of pods that this # replication controller is responsible for managing selector: name: nginx # template defines the 'cookie cutter' used for creating # new pods when necessary template: metadata: labels: # Important: these labels need to match the selector above # The api server enforces this constraint. name: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80