apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: frontend
  labels:
    app: ui
    tier: frontend
spec:
  # here we select the number of pods we wish to start and the selector that tells our replica set which pods it needs 
  #  to manage
  replicas: 3
  selector:  # Using the selector we tell our replicaset which pods to manage
    matchLabels:
      tier: frontend
  template:   # here we define our PODS Specs (k8s uses go template in the background)
    metadata:
      labels:
        tier: frontend
    spec:
      containers:
      - name: spring-music
        image: yanivomc/spring-music:latest
        volumeMounts:
        - mountPath: /mnt/files
          name: test-volume
      - name: animals
        image: supergiantkir/animals:bear
        volumeMounts:
        - mountPath: /mnt/files
          name: test-volume
      volumes:
        - name: test-volume
          hostPath:
            path: /tmp/files/
            type: DirectoryOrCreate 
