137 lines
3.8 KiB
YAML
137 lines
3.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: bootnode-api
|
|
namespace: bootnode
|
|
labels:
|
|
app: bootnode-api
|
|
component: api
|
|
brand: hanzo
|
|
spec:
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
app: bootnode-api
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: bootnode-api
|
|
component: api
|
|
brand: hanzo
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/port: "8000"
|
|
prometheus.io/path: "/metrics"
|
|
spec:
|
|
serviceAccountName: bootnode-api
|
|
affinity:
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 100
|
|
podAffinityTerm:
|
|
labelSelector:
|
|
matchLabels:
|
|
app: bootnode-api
|
|
topologyKey: kubernetes.io/hostname
|
|
containers:
|
|
- name: api
|
|
image: ghcr.io/hanzoai/bootnode:1.0.0-amd64-api
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- name: http
|
|
containerPort: 8000
|
|
protocol: TCP
|
|
env:
|
|
- name: APP_ENV
|
|
value: production
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: bootnode-secrets
|
|
key: database-url
|
|
- name: REDIS_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: bootnode-secrets
|
|
key: redis-url
|
|
- name: DATASTORE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: bootnode-secrets
|
|
key: datastore-url
|
|
- name: JWT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: bootnode-secrets
|
|
key: jwt-secret
|
|
- name: API_KEY_SALT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: bootnode-secrets
|
|
key: api-key-salt
|
|
# Hanzo IAM integration
|
|
- name: IAM_URL
|
|
value: https://id.hanzo.network
|
|
- name: IAM_ORG
|
|
value: HANZO
|
|
# KMS integration
|
|
- name: HANZO_KMS_URL
|
|
value: https://kms.hanzo.network
|
|
- name: HANZO_KMS_ORG
|
|
value: hanzo
|
|
- name: HANZO_KMS_PROJECT
|
|
value: bootnode
|
|
- name: HANZO_KMS_ENV
|
|
value: production
|
|
- name: HANZO_KMS_CLIENT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: hanzo-kms-secrets
|
|
key: client-id
|
|
optional: true
|
|
- name: HANZO_KMS_CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: hanzo-kms-secrets
|
|
key: client-secret
|
|
optional: true
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: "2"
|
|
memory: 2Gi
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
volumeMounts:
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|