Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ ir-engine/Chart\.lock
_site
.sass-cache
configs/beta.values.yaml

.DS_STORE
1 change: 0 additions & 1 deletion ir-engine/templates/api-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
labels:
{{- include "ir-engine.api.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.api.replicaCount }}
selector:
matchLabels:
{{- include "ir-engine.api.selectorLabels" . | nindent 6 }}
Expand Down
41 changes: 41 additions & 0 deletions ir-engine/templates/api-server-horizontal-pod-autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This entire HPA block will only be rendered if HPA is enabled in values.yaml
{{- if ((.Values.api).autoscaling).enabled }}

apiVersion: autoscaling/v2 # Use HPA v2 API for advanced metrics
kind: HorizontalPodAutoscaler # Tells Kubernetes to create an HPA resource
metadata:
# Set the HPA name based on Helm's "fullname" helper (e.g., dev-ir-engine)
name: {{ include "ir-engine.api.fullname" . }}
labels:
# Adds standard Helm labels from the "labels" helper
{{- include "ir-engine.api.labels" . | nindent 4 }}

spec:
# This tells the HPA what to scale
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment # HPA will monitor and scale this Deployment
name: {{ include "ir-engine.api.fullname" . }} # The name of the Deployment to scale

# Minimum number of pods to run
minReplicas: {{ .Values.api.autoscaling.minReplicas }}

# Maximum number of pods to allow
maxReplicas: {{ .Values.api.autoscaling.maxReplicas }}

# Define the metric used to trigger scaling (here: CPU utilization)
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization # We're using percentage-based CPU utilization
averageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }}

{{- end }}
72 changes: 9 additions & 63 deletions ir-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,9 @@ client:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: xrsocial.local
paths: ["/"]
# tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

serviceAccount:
create: true
Expand Down Expand Up @@ -92,15 +87,9 @@ api:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: api.social.local
paths: ["/"]
# tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local


serviceAccount:
create: true
Expand All @@ -115,46 +104,22 @@ api:
securityContext: {}

fileServer:
# This is the path of file server upload folder in your host machine. Its is required when deployed
# in local environment.
#
# For MicroK8s: it will be similar to '/home/<OS_USER_NAME>/<ENGINE_FOLDER>/packages/server/upload'
# or '<ENGINE_FULL_PATH>/packages/server/upload'
#
# For Minikube: it will be similar to '/hosthome/<OS_USER_NAME>/<ENGINE_FOLDER>/packages/server/upload'
# The folder must be in home folder and make sure to use /hosthome/ instead of home in path.
# Ref: https://stackoverflow.com/a/48535001/2077741
hostUploadFolder: ""

# Extra Environment variables to configure xrsocial
extraEnv:
# ENV_VAR1: val1
# ENV_VAR2: val2

# automatically filled by chart.. ignore
# MYSQL_PORT: 3306
# MYSQL_DATABASE: ir-engine
# MYSQL_USER: server
# MYSQL_PASSWORD: password

SMTP_HOST: ""
SMTP_PORT: ""
SMTP_USER: ""
SMTP_PASS: ""

GITHUB_CLIENT_ID: ""
GITHUB_CLIENT_SECRET: ""
GITHUB_CALLBACK_URL: http://127.0.0.1:3000/oauth/github

FACEBOOK_CLIENT_ID: ""
FACEBOOK_CLIENT_SECRET: ""
FACEBOOK_CALLBACK_URL: http://127.0.0.1:3000/oauth/facebook

GOOGLE_CLIENT_ID: ""
GOOGLE_CLIENT_SECRET: ""
GOOGLE_CALLBACK_URL: http://127.0.0.1:3000/oauth/google


STORAGE_PROVIDER: local
STORAGE_S3_BUCKET_NAME: ""
STORAGE_S3_PUBLIC_VIDEO_PATH: "/"
Expand All @@ -163,13 +128,17 @@ api:
STORAGE_S3_CLOUDFRONT_DOMAIN: ""
STORAGE_AWS_ACCESS_KEY_ID: ""
STORAGE_AWS_ACCESS_KEY_SECRET: ""

AWS_SMS_REGION: ""
AWS_SMS_ACCESS_KEY_ID: ""
AWS_SMS_SECRET_ACCESS_KEY: ""
AWS_SMS_TOPIC_ARN: ""
# SERVER_MODE: "api"


autoscaling:
enabled: true # Enable HPA (true = create HorizontalPodAutoscaler resource)
minReplicas: 2 # Minimum number of pods to run
maxReplicas: 10 # Maximum number of pods to run
targetCPUUtilizationPercentage: 75 # Target CPU usage percentage to trigger autoscaling
targetMemoryUtilizationPercentage: 80 # Target RAM usage percentage to trigger autoscaling

media:
enabled: true
Expand All @@ -193,15 +162,9 @@ media:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: api.xrsocial.local
paths: ["/video"]
# tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local


serviceAccount:
create: true
Expand All @@ -215,35 +178,20 @@ media:
podSecurityContext: {}
securityContext: {}

# Extra Environment variables to configure xrsocial
extraEnv:
# ENV_VAR1: val1
# ENV_VAR2: val2

# automatically filled by chart.. ignore
# MYSQL_PORT: 3306
# MYSQL_DATABASE: ir-engine
# MYSQL_USER: server
# MYSQL_PASSWORD: password

SMTP_HOST: ""
SMTP_PORT: ""
SMTP_USER: ""
SMTP_PASS: ""

GITHUB_CLIENT_ID: ""
GITHUB_CLIENT_SECRET: ""
GITHUB_CALLBACK_URL: http://127.0.0.1:3000/oauth/github

FACEBOOK_CLIENT_ID: ""
FACEBOOK_CLIENT_SECRET: ""
FACEBOOK_CALLBACK_URL: http://127.0.0.1:3000/oauth/facebook

GOOGLE_CLIENT_ID: ""
GOOGLE_CLIENT_SECRET: ""
GOOGLE_CALLBACK_URL: http://127.0.0.1:3000/oauth/google


STORAGE_PROVIDER: local
STORAGE_S3_BUCKET_NAME: ""
STORAGE_S3_PUBLIC_VIDEO_PATH: "/"
Expand All @@ -252,12 +200,10 @@ media:
STORAGE_S3_CLOUDFRONT_DOMAIN: ""
STORAGE_AWS_ACCESS_KEY_ID: ""
STORAGE_AWS_ACCESS_KEY_SECRET: ""

AWS_SMS_REGION: ""
AWS_SMS_ACCESS_KEY_ID: ""
AWS_SMS_SECRET_ACCESS_KEY: ""
AWS_SMS_TOPIC_ARN: ""
# SERVER_MODE: "media"

instanceserver:
enabled: true
Expand Down Expand Up @@ -289,8 +235,6 @@ instanceserver:
annotations: {}
name:

########### Subcharts - values here will overwrite the subchart

sql:
database: ir-engine
user: server
Expand Down Expand Up @@ -359,3 +303,5 @@ batchinvalidator:
create: true
annotations: {}
name: