diff --git a/sites/payment/deploy/k8s/alpha.yaml b/sites/payment/deploy/k8s/alpha.yaml index ac0a6f7..8127f2e 100644 --- a/sites/payment/deploy/k8s/alpha.yaml +++ b/sites/payment/deploy/k8s/alpha.yaml @@ -1,5 +1,6 @@ appEnv: APP_NAME: payment + CONTAINER_APP_ROOT: /app SERVICE_API_ACCESS_HOST: 0.0.0.0 SERVICE_API_ACCESS_PORT: 80 diff --git a/sites/payment/deploy/k8s/prod.yaml b/sites/payment/deploy/k8s/prod.yaml index 0f00435..e9ac616 100644 --- a/sites/payment/deploy/k8s/prod.yaml +++ b/sites/payment/deploy/k8s/prod.yaml @@ -1,5 +1,6 @@ appEnv: APP_NAME: payment + CONTAINER_APP_ROOT: /app SERVICE_API_ACCESS_HOST: 0.0.0.0 SERVICE_API_ACCESS_PORT: 80 @@ -35,5 +36,3 @@ appK8sConfig: readinessProbe: command: to_add_healthcheck.sh - - diff --git a/sites/payment/deploy/k8s/readme.md b/sites/payment/deploy/k8s/readme.md new file mode 100644 index 0000000..8c82110 --- /dev/null +++ b/sites/payment/deploy/k8s/readme.md @@ -0,0 +1,10 @@ +- 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. \ No newline at end of file