apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-controller
spec:
  replicas: 4
  # selector identifies the set of Pods that this
  # replication controller is responsible for managing
  selector:
    app: nginx
  # podTemplate 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.
        app: nginx
    spec:
      volumes:
      - name: webroot
        hostPath:
          path: /var/lib/nginx

      containers:
      - name: nginx
        image: nginx
        volumeMounts:
        - name: webroot
          mountPath: /usr/share/nginx/html
        ports:
        - containerPort: 80
