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

resources:
- ../../base

images:
- name: container-mom-metrics
  newName: ghcr.io/pfeifferj/container-mom-metrics-service
  newTag: latest
- name: container-mom-dns
  newName: ghcr.io/pfeifferj/container-mom-dns-manager
  newTag: latest
- name: container-mom-billing
  newName: ghcr.io/pfeifferj/container-mom-billing-service
  newTag: latest
- name: container-mom-web
  newName: ghcr.io/pfeifferj/container-mom-web-portal
  newTag: latest

replicas:
- name: metrics-service
  count: 1
- name: dns-manager
  count: 1
- name: billing-service
  count: 1
- name: web-portal
  count: 2

patches:
- target:
    kind: Ingress
    name: container-mom-ingress
  patch: |-
    - op: replace
      path: /spec/rules/0/host
      value: container-mom.apps.ocp4-prd.josie.cloud

- target:
    kind: Deployment
    name: metrics-service
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/imagePullPolicy
      value: Always

- target:
    kind: Deployment
    name: billing-service
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/imagePullPolicy
      value: Always

- target:
    kind: Deployment
    name: dns-manager
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/imagePullPolicy
      value: Always

- target:
    kind: Deployment
    name: web-portal
  patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/imagePullPolicy
      value: Always 
    - op: replace
      path: /spec/template/spec/containers/0/env/
      value:
        name: KEMAL_ENV
        value: "development"
