# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default values for onlineboutique.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

images:
  repository: us-central1-docker.pkg.dev/google-samples/microservices-demo
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

serviceAccounts:
  # Specifies whether service accounts should be created.
  create: true
  # Annotations to add to the service accounts.
  annotations: {}
  # Annotations to add only for the cartservice app. This allows to follow the least privilege principle where only cartservice needs to connect to external database for example via Workload Identity.
  annotationsOnlyForCartservice: false

networkPolicies:
  # Specifies if the NetworkPolicies are created or not. If true, one fine granular NetworkPolicy per app is created.
  create: false

sidecars:
  # Specifies if the Sidecars are created or not. If true, one fine granular Sidecar per app is created.
  create: false

authorizationPolicies:
  # Specifies if the AuthorizationPolicies are created or not. If true, one fine granular AuthorizationPolicy per app is created.
  create: false

opentelemetryCollector:
  create: false
  name: opentelemetrycollector
  # Specifies the project id for the otel collector. If set as "PROJECT_ID" (default value), an initContainer will automatically retrieve the project id value from the metadata server.
  projectId: "PROJECT_ID"

googleCloudOperations:
  profiler: false
  tracing: false
  metrics: false

seccompProfile:
  enable: false
  type: RuntimeDefault

securityContext:
  enable: true

adService:
  create: true
  name: adservice
  resources:
    requests:
      cpu: 200m
      memory: 180Mi
    limits:
      cpu: 300m
      memory: 300Mi

cartService:
  create: true
  name: cartservice
  resources:
    requests:
      cpu: 200m
      memory: 128Mi
    limits:
      cpu: 300m
      memory: 256Mi

checkoutService:
  create: true
  name: checkoutservice
  resources:
    requests:
      cpu: 100m
      memory: 64Mi
    limits:
      cpu: 200m
      memory: 128Mi

currencyService:
  create: true
  name: currencyservice
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 200m
      memory: 256Mi

emailService:
  create: true
  name: emailservice
  resources:
    requests:
      cpu: 100m
      memory: 64Mi
    limits:
      cpu: 200m
      memory: 128Mi

frontend:
  create: true
  name: frontend
  externalService: true
  cymbalBranding: false
  # One of: local, gcp, aws, azure, onprem, alibaba. When not set, defaults to "local" unless running in GKE, otherwise auto-sets to gcp.
  platform: local
  singleSharedSession: false
  virtualService:
    create: false
    hosts:
    - "*"
    gateway:
      name: asm-ingressgateway
      namespace: asm-ingress
      labelKey: asm
      labelValue: ingressgateway
  resources:
    requests:
      cpu: 100m
      memory: 64Mi
    limits:
      cpu: 200m
      memory: 128Mi

loadGenerator:
  create: true
  name: loadgenerator
  checkFrontendInitContainer: true
  resources:
    requests:
      cpu: 300m
      memory: 256Mi
    limits:
      cpu: 500m
      memory: 512Mi

paymentService:
  create: true
  name: paymentservice
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 200m
      memory: 256Mi

productCatalogService:
  create: true
  name: productcatalogservice
  # Specifies an extra latency to any request on productcatalogservice, by default no extra latency.
  extraLatency: ""
  resources:
    requests:
      cpu: 100m
      memory: 64Mi
    limits:
      cpu: 200m
      memory: 128Mi

recommendationService:
  create: true
  name: recommendationservice
  resources:
    requests:
      cpu: 100m
      memory: 220Mi
    limits:
      cpu: 200m
      memory: 450Mi

shippingService:
  create: true
  name: shippingservice
  resources:
    requests:
      cpu: 100m
      memory: 64Mi
    limits:
      cpu: 200m
      memory: 128Mi

cartDatabase:
  # Specifies the type of the cartservice's database, could be either redis or spanner.
  type: redis
  connectionString: "redis-cart:6379"
  inClusterRedis:
    create: true
    name: redis-cart
    # Uses the public redis image from Docker Hub, otherwise will use the images.repository.
    publicRepository: true
  externalRedisTlsOrigination:
    enable: false
    name: exernal-redis-tls-origination
    endpointAddress: ""
    endpointPort: ""
    certificate: ""

# @TODO: This service is not currently available in Helm.
# https://github.com/GoogleCloudPlatform/microservices-demo/tree/main/kustomize/components/shopping-assistant
shoppingAssistantService:
  create: false
  name: shoppingassistantservice
