peridot/peridot/cmd/v1/peridotserver/ci/deploy.jsonnet

75 lines
1.9 KiB
Plaintext
Raw Normal View History

2022-10-30 08:18:01 +00:00
local resfdeploy = import 'ci/resfdeploy.jsonnet';
2022-07-07 20:11:50 +00:00
local db = import 'ci/db.jsonnet';
local kubernetes = import 'ci/kubernetes.jsonnet';
local temporal = import 'ci/temporal.jsonnet';
local utils = import 'ci/utils.jsonnet';
2022-10-31 02:23:40 +00:00
local s3 = import 'ci/s3.jsonnet';
2022-07-07 20:11:50 +00:00
2022-10-30 08:18:01 +00:00
resfdeploy.new({
2022-07-07 20:11:50 +00:00
name: 'peridotserver',
2022-10-31 02:23:40 +00:00
helm_strip_prefix: 'PERIDOT_',
2022-07-07 20:11:50 +00:00
replicas: if kubernetes.prod() then 5 else 1,
dbname: 'peridot',
backend: true,
migrate: true,
legacyDb: true,
command: '/bundle/peridotserver',
image: kubernetes.tag('peridotserver'),
tag: kubernetes.version,
dsn: {
name: 'PERIDOT_DATABASE_URL',
value: db.dsn_legacy('peridot', false, 'peridotserver'),
},
requests: if kubernetes.prod() then {
cpu: '0.2',
memory: '512M',
},
limits: if kubernetes.prod() then {
cpu: '2',
memory: '12G',
} else {
cpu: '2',
memory: '10G',
},
service_account_options: {
annotations: {
2022-10-31 02:23:40 +00:00
'eks.amazonaws.com/role-arn': if utils.helm_mode then '{{ .Values.awsRoleArn | default !"!" }}' else 'arn:aws:iam::893168113496:role/peridot_k8s_role',
}
},
2022-07-07 20:11:50 +00:00
ports: [
{
name: 'http',
containerPort: 15002,
protocol: 'TCP',
expose: true,
},
{
name: 'grpc',
containerPort: 15003,
protocol: 'TCP',
},
],
health: {
port: 15002,
},
env: [
{
name: 'PERIDOT_PRODUCTION',
value: if kubernetes.dev() then 'false' else 'true',
},
2022-10-31 02:23:40 +00:00
{
name: 'HYDRA_PUBLIC_HTTP_ENDPOINT_OVERRIDE',
value: if utils.helm_mode then '{{ .Values.hydraPublicEndpoint | default !"!" }}' else '',
},
2022-10-31 02:23:40 +00:00
{
name: 'HYDRA_ADMIN_HTTP_ENDPOINT_OVERRIDE',
value: if utils.helm_mode then '{{ .Values.hydraAdminEndpoint | default !"!" }}' else '',
2022-10-30 01:59:25 +00:00
},
2022-10-31 02:23:40 +00:00
{
name: 'SPICEDB_GRPC_ENDPOINT_OVERRIDE',
value: if utils.helm_mode then '{{ .Values.spicedbEndpoint | default !"!" }}' else '',
2022-10-30 01:59:25 +00:00
},
2022-07-07 20:11:50 +00:00
$.dsn,
2022-10-31 02:23:40 +00:00
] + s3.kube_env('PERIDOT') + temporal.kube_env('PERIDOT'),
2022-07-07 20:11:50 +00:00
})