freeleaps-service-hub/sites/payment/deploy/k8s/readme.md

1.1 KiB

  • K8s namespace should be the same as the code repository name(project name), e.g. freeleaps-service-hub
  • For each app, the K8s pod name must be the same as appEnv.APP_NAME
  • When loading deployment yaml file under k8s folder (alpha.yaml, prod.yaml):
    • Replace the secret values that are in format of {SECRET_NAME}, e.g. {STRIPE_API_KEY}
    • Secret value should be stored in {REPO_NAME}/{APP_NAME}/{ENV}/{SECRET_NAME}, e.g. freeleaps-service-hub/payment/alpha/STRIPE_API_KEY
    • Resolve appEnv references in the yaml file, e.g. LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME, $CONTAINER_APP_ROOT and $APP_NAME should be replaced by the appEnv with the same name. And we should do the same for a SECRET referrence
    • NOTE: only appEnvs are allowed to have references in the yaml file
    • When reference can not be resolved, terminate the CI/CD
  • For each app, the related k8s resource should be named as {APP_NAME}-{RESOURCE_NAME}, e.g. payment-deployment, payment-service
  • For each app's k8s pod, we should deploy the resources defined in appK8sConfig as long as it doesn't conflict with the resource quota.