apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - ../../base

namePrefix: dev-

labels:
  - pairs:
      environment: dev

patches:
  - patch: |-
      - op: replace
        path: /spec/replicas
        value: 1
      - op: replace
        path: /spec/template/spec/containers/0/imagePullPolicy
        value: Never
    target:
      kind: Deployment
      name: {{ app_name }}
  - patch: |-
      - op: replace
        path: /spec/template/spec/containers/0/resources/requests/memory
        value: "256Mi"
      - op: replace
        path: /spec/template/spec/containers/0/resources/requests/cpu
        value: "100m"
      - op: replace
        path: /spec/template/spec/containers/0/resources/limits/memory
        value: "1Gi"
      - op: replace
        path: /spec/template/spec/containers/0/resources/limits/cpu
        value: "500m"
    target:
      kind: Deployment
      name: {{ app_name }}
  - patch: |-
      - op: replace
        path: /spec/type
        value: NodePort
      - op: add
        path: /spec/ports/0/nodePort
        value: {{ node_port_http }}
      - op: add
        path: /spec/ports/1/nodePort
        value: {{ node_port_grpc }}
    target:
      kind: Service
      name: {{ app_name }}
