apiVersion: apps/v1
kind: Deployment
metadata:
  name: react-client
spec:
  selector:
    matchLabels:
      app: react-client
  template:
    metadata:
      labels:
        app: react-client
    spec:
      containers:
      - name: react-client
        image: davidyap/udemy-section2-client
        ports:
        - containerPort: 8080
        env:
          - name: REACT_APP_PORT
            value: "3000"
          - name: REACT_APP_COMMENT_LINK
            value: "http://comment:8080"
          - name: REACT_APP_POST_LINK
            value: "http://posts:8080"
          - name: REACT_APP_QUERY_LINK
            value: "http://query:8080"


# ---
# apiVersion: v1
# kind: Service
# metadata:
#   name: react-client
# spec:
#   selector:
#     app: react-client
#   ports:
#   - port: 3000
#     targetPort: 3000
#   type: ClusterIP

# ---
# apiVersion: v1
# kind: Service
# metadata:
#   name: react-client-nodeport
# spec:
#   selector:
#     app: react-client
#   ports:
#   - port: 3000
#     targetPort: 3000
#   type: NodePort