Add k8s configuration files for service-hub
This commit is contained in:
parent
6028b0a6f0
commit
e13a05cb43
38
sites/authentication/deploy/k8s/alpha.yaml
Normal file
38
sites/authentication/deploy/k8s/alpha.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: authentication
|
||||
ENVIRONMENT: alpha
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://mongodb-service.freeleaps-alpha.svc.cluster.local:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 50
|
||||
timeoutSeconds: 125
|
||||
periodSeconds: 125
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
38
sites/authentication/deploy/k8s/prod.yaml
Normal file
38
sites/authentication/deploy/k8s/prod.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: authentication
|
||||
ENVIRONMENT: prod
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://freeleaps2-mongodb:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 120
|
||||
periodSeconds: 30
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
11
sites/authentication/deploy/k8s/readme.md
Normal file
11
sites/authentication/deploy/k8s/readme.md
Normal file
@ -0,0 +1,11 @@
|
||||
- K8s namespace should be the same as the code repository name(project name), e.g. **freeleaps-service-hub**
|
||||
- All apps within the repository should be deployed under the same namespace
|
||||
- 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.
|
||||
38
sites/central_storage/deploy/k8s/alpha.yaml
Normal file
38
sites/central_storage/deploy/k8s/alpha.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: central_storage
|
||||
ENVIRONMENT: alpha
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://mongodb-service.freeleaps-alpha.svc.cluster.local:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 50
|
||||
timeoutSeconds: 125
|
||||
periodSeconds: 125
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
38
sites/central_storage/deploy/k8s/prod.yaml
Normal file
38
sites/central_storage/deploy/k8s/prod.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: central_storage
|
||||
ENVIRONMENT: prod
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://freeleaps2-mongodb:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 120
|
||||
periodSeconds: 30
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
11
sites/central_storage/deploy/k8s/readme.md
Normal file
11
sites/central_storage/deploy/k8s/readme.md
Normal file
@ -0,0 +1,11 @@
|
||||
- K8s namespace should be the same as the code repository name(project name), e.g. **freeleaps-service-hub**
|
||||
- All apps within the repository should be deployed under the same namespace
|
||||
- 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.
|
||||
38
sites/content/deploy/k8s/alpha.yaml
Normal file
38
sites/content/deploy/k8s/alpha.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: content
|
||||
ENVIRONMENT: alpha
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://mongodb-service.freeleaps-alpha.svc.cluster.local:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 50
|
||||
timeoutSeconds: 125
|
||||
periodSeconds: 125
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
38
sites/content/deploy/k8s/prod.yaml
Normal file
38
sites/content/deploy/k8s/prod.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: content
|
||||
ENVIRONMENT: prod
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://freeleaps2-mongodb:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 120
|
||||
periodSeconds: 30
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
11
sites/content/deploy/k8s/readme.md
Normal file
11
sites/content/deploy/k8s/readme.md
Normal file
@ -0,0 +1,11 @@
|
||||
- K8s namespace should be the same as the code repository name(project name), e.g. **freeleaps-service-hub**
|
||||
- All apps within the repository should be deployed under the same namespace
|
||||
- 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.
|
||||
38
sites/notification/deploy/k8s/alpha.yaml
Normal file
38
sites/notification/deploy/k8s/alpha.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: notification
|
||||
ENVIRONMENT: alpha
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://mongodb-service.freeleaps-alpha.svc.cluster.local:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 50
|
||||
timeoutSeconds: 125
|
||||
periodSeconds: 125
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
38
sites/notification/deploy/k8s/prod.yaml
Normal file
38
sites/notification/deploy/k8s/prod.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
appEnv:
|
||||
APP_NAME: notification
|
||||
ENVIRONMENT: prod
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
JWT_SECRET_KEY: {JWT_SECRET_KEY}
|
||||
JWT_ALGORITHM: HS256
|
||||
|
||||
STRIPE_API_KEY: {STRIPE_API_KEY}
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://freeleaps2-mongodb:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
APPLICATION_ACTIVITY_LOG: $APP_NAME-activity
|
||||
|
||||
appK8sConfig:
|
||||
replicaCount: 2
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "1Gi"
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: "0.5Gi"
|
||||
startupProbe:
|
||||
command: to_add_startup_check.sh
|
||||
initialDelaySeconds: 60
|
||||
timeoutSeconds: 120
|
||||
periodSeconds: 30
|
||||
livenessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
readinessProbe:
|
||||
command: to_add_healthcheck.sh
|
||||
|
||||
11
sites/notification/deploy/k8s/readme.md
Normal file
11
sites/notification/deploy/k8s/readme.md
Normal file
@ -0,0 +1,11 @@
|
||||
- K8s namespace should be the same as the code repository name(project name), e.g. **freeleaps-service-hub**
|
||||
- All apps within the repository should be deployed under the same namespace
|
||||
- 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.
|
||||
@ -1,5 +1,6 @@
|
||||
appEnv:
|
||||
APP_NAME: payment
|
||||
ENVIRONMENT: alpha
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
@ -11,7 +12,7 @@ appEnv:
|
||||
|
||||
MONGODB_NAME: freeleaps2
|
||||
MONGODB_PORT: 27017
|
||||
MONGODB_URI: mongodb://freeleaps2-mongodb:27017/
|
||||
MONGODB_URI: mongodb://mongodb-service.freeleaps-alpha.svc.cluster.local:27017/
|
||||
|
||||
LOG_BASE_PATH: $CONTAINER_APP_ROOT/log/$APP_NAME
|
||||
BACKEND_LOG_FILE_NAME: $APP_NAME
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
appEnv:
|
||||
APP_NAME: payment
|
||||
ENVIRONMENT: prod
|
||||
CONTAINER_APP_ROOT: /app
|
||||
SERVICE_API_ACCESS_HOST: 0.0.0.0
|
||||
SERVICE_API_ACCESS_PORT: 80
|
||||
|
||||
Loading…
Reference in New Issue
Block a user