diff --git a/charts/k8soketi/.helmignore b/charts/k8soketi/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/k8soketi/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/k8soketi/Chart.yaml b/charts/k8soketi/Chart.yaml new file mode 100644 index 0000000..d71da37 --- /dev/null +++ b/charts/k8soketi/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: k8soketi +description: Run soketi/k8soketi in your Kubernetes cluster using this Helm chart. + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 1.0.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.0.0 diff --git a/charts/k8soketi/README.md b/charts/k8soketi/README.md new file mode 100644 index 0000000..401570c --- /dev/null +++ b/charts/k8soketi/README.md @@ -0,0 +1,49 @@ +k8soketi Server Chart +=================== + +Containerize & Orchestrate your k8soketi application with this simple Helm chart. + +## 🤝 Supporting + +**If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with [Github Sponsors](https://github.com/sponsors/rennokki). 📦** + +## 🛑 Requirements + +- Kubernetes v1.19+ + +## 🚀 Installation + +Install Helm chart repository: + +```bash +$ helm repo add k8soketi https://helm.soketi.app +$ helm repo update +``` + +Install the k8soketi chart: + +```bash +$ helm upgrade k8soketi \ + --install \ + --version=1.0.0 \ + soketi/k8soketi +``` + +Check `values.yaml` for additional available customizations. + +## 🐛 Testing + +Coming soon. + +## 🤝 Contributing + +Please see [CONTRIBUTING](../../CONTRIBUTING.md) for details. + +## 🔒 Security + +If you discover any security related issues, please email alex@renoki.org instead of using the issue tracker. + +## 🎉 Credits + +- [Alex Renoki](https://github.com/rennokki) +- [All Contributors](../../../../contributors) diff --git a/charts/k8soketi/templates/NOTES.txt b/charts/k8soketi/templates/NOTES.txt new file mode 100644 index 0000000..fd0abfc --- /dev/null +++ b/charts/k8soketi/templates/NOTES.txt @@ -0,0 +1,30 @@ +{{- if .Values.ingress.enabled }} +The application is available at these URLs: +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} +Get the application URL by running these commands: + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "soketi.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "soketi.fullname" . }}' +Get the application URL by running these commands: + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "soketi.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} +Get the application URL by running these commands: + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "soketi.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:{{ .Values.service.port }} to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.service.port }}:$CONTAINER_PORT +{{- end }} + +{{- if or .Values.metrics.enabled .Values.serviceMonitor.enabled }} +Metrics: The Prometheus metrics are enabled on port {{ .Values.metrics.service.port }}. +{{- end }} +The pods can discovery each other using WebSockets with the port {{ .Values.peerServer.service.port }}. diff --git a/charts/k8soketi/templates/_helpers.tpl b/charts/k8soketi/templates/_helpers.tpl new file mode 100644 index 0000000..f8a3e61 --- /dev/null +++ b/charts/k8soketi/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "soketi.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "soketi.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "soketi.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "soketi.labels" -}} +helm.sh/chart: {{ include "soketi.chart" . }} +{{ include "soketi.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "soketi.selectorLabels" -}} +app.kubernetes.io/name: {{ include "soketi.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app: soketi +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "soketi.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "soketi.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/k8soketi/templates/deployment.yaml b/charts/k8soketi/templates/deployment.yaml new file mode 100644 index 0000000..d6e09a1 --- /dev/null +++ b/charts/k8soketi/templates/deployment.yaml @@ -0,0 +1,148 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "soketi.fullname" . }} + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} + selector: + matchLabels: + {{- include "soketi.selectorLabels" . | nindent 6 }} + {{- if or .Values.metrics.enabled .Values.serviceMonitor.enabled }} + k8s.soketi.app/serves-metrics: "yes" + {{- end }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "soketi.selectorLabels" . | nindent 8 }} + {{- if or .Values.metrics.enabled .Values.serviceMonitor.enabled }} + k8s.soketi.app/serves-metrics: "yes" + {{- end }} + spec: + {{- with .Values.extraVolumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + + {{- if .Values.app.multicast.enabled }} + hostNetwork: {{ .Values.app.multicast.hostNetwork }} + dnsPolicy: {{ .Values.app.multicast.dnsPolicy }} + {{- end }} + + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + + serviceAccountName: {{ include "soketi.serviceAccountName" . }} + + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + + {{- with .Values.extraInitContainers }} + initContainers: + {{- toYaml . | nindent 8 }} + {{- end }} + + containers: + {{- with .Values.extraContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.app.image.repository }}:{{ .Values.app.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.app.image.pullPolicy }} + {{- with .Values.app.extraVolumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + ports: + - name: soketi + containerPort: {{ .Values.service.port }} + protocol: TCP + - name: metrics + containerPort: {{ .Values.metrics.service.port }} + protocol: TCP + - name: peer + containerPort: {{ .Values.peerServer.service.port }} + protocol: TCP + command: + - node + - --optimize_for_size + - --optimize-for-size + - /app/bin/server.js + - start + {{- if or .Values.metrics.enabled .Values.serviceMonitor.enabled }} + - --metrics + {{- end }} + {{- with .Values.app.flags }} + {{- toYaml . | nindent 12 }} + {{- end }} + env: + - name: PORT + value: "{{ .Values.service.port }}" + - name: METRICS_SERVER_PORT + value: "{{ .Values.metrics.service.port }}" + - name: KUBE_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: KUBE_POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: KUBE_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: KUBE_SERVICES + value: {{ include "soketi.fullname" . }}-peer + - name: PEER_WS_PORT + value: "{{ .Values.peerServer.service.port }}" + - name: NODE_OPTIONS + value: "--es-module-specifier-resolution=node" + - name: PEER_INACTIVITY_TIMEOUT + value: "10" + - name: WS_GRACE_PERIOD + value: "10" + - name: MODE + value: {{ .Values.app.mode | default "full" }} + {{- with .Values.app.extraEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.app.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/k8soketi/templates/hpa.yaml b/charts/k8soketi/templates/hpa.yaml new file mode 100644 index 0000000..90ee75c --- /dev/null +++ b/charts/k8soketi/templates/hpa.yaml @@ -0,0 +1,39 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "soketi.fullname" . }} + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "soketi.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{- with .Values.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} + {{- with .Values.autoscaling.customMetrics }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/k8soketi/templates/ingress.yaml b/charts/k8soketi/templates/ingress.yaml new file mode 100644 index 0000000..24847f4 --- /dev/null +++ b/charts/k8soketi/templates/ingress.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "soketi.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "soketi.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + {{- if .Values.ingress.class }} + ingressClassName: {{ .Values.ingress.class }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + pathType: ImplementationSpecific + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} diff --git a/charts/k8soketi/templates/pdb.yaml b/charts/k8soketi/templates/pdb.yaml new file mode 100644 index 0000000..05e553b --- /dev/null +++ b/charts/k8soketi/templates/pdb.yaml @@ -0,0 +1,18 @@ +{{- if or (and .Values.autoscaling.enabled (gt (.Values.autoscaling.minReplicas | int) 1)) (gt (.Values.replicaCount | int) 1) -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + labels: + {{- include "soketi.labels" . | nindent 4 }} + name: {{ include "soketi.fullname" . }} +spec: + selector: + matchLabels: + {{- include "soketi.selectorLabels" . | nindent 6 }} + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if .Values.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} +{{- end }} diff --git a/charts/k8soketi/templates/service-metrics.yaml b/charts/k8soketi/templates/service-metrics.yaml new file mode 100644 index 0000000..567aecc --- /dev/null +++ b/charts/k8soketi/templates/service-metrics.yaml @@ -0,0 +1,18 @@ +{{- if or .Values.metrics.enabled .Values.serviceMonitor.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "soketi.fullname" . }}-metrics + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.metrics.service.port }} + targetPort: {{ .Values.metrics.service.port }} + protocol: TCP + name: metrics + selector: + {{- include "soketi.selectorLabels" . | nindent 4 }} + ws.soketi.app/serves-metrics: "yes" +{{- end }} diff --git a/charts/k8soketi/templates/service-ws-peer.yaml b/charts/k8soketi/templates/service-ws-peer.yaml new file mode 100644 index 0000000..f02baff --- /dev/null +++ b/charts/k8soketi/templates/service-ws-peer.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "soketi.fullname" . }}-peer + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.peerServer.service.port }} + targetPort: {{ .Values.peerServer.service.port }} + protocol: TCP + name: peer + selector: + {{- include "soketi.selectorLabels" . | nindent 4 }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "soketi.fullname" . }}-peer-headless + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ .Values.peerServer.service.port }} + targetPort: {{ .Values.peerServer.service.port }} + protocol: TCP + name: peer + selector: + {{- include "soketi.selectorLabels" . | nindent 4 }} diff --git a/charts/k8soketi/templates/service.yaml b/charts/k8soketi/templates/service.yaml new file mode 100644 index 0000000..774f1d9 --- /dev/null +++ b/charts/k8soketi/templates/service.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "soketi.fullname" . }} + labels: + {{- include "soketi.labels" . | nindent 4 }} + annotations: + {{- with .Values.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP + name: soketi + selector: + {{- include "soketi.selectorLabels" . | nindent 4 }} + k8s.soketi.app/low-memory: "no" +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "soketi.fullname" . }}-headless + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP + name: soketi + selector: + {{- include "soketi.selectorLabels" . | nindent 4 }} diff --git a/charts/k8soketi/templates/serviceaccount-role.yaml b/charts/k8soketi/templates/serviceaccount-role.yaml new file mode 100644 index 0000000..36ed38f --- /dev/null +++ b/charts/k8soketi/templates/serviceaccount-role.yaml @@ -0,0 +1,42 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "soketi.serviceAccountName" . }} + labels: + app.kubernetes.io/component: controller + {{- include "soketi.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: + - pods + verbs: + - get + - patch + - apiGroups: [""] + resources: + - events + verbs: + - create + - apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "soketi.serviceAccountName" . }} + labels: + app.kubernetes.io/component: controller + {{- include "soketi.labels" . | nindent 4 }} +subjects: +- kind: ServiceAccount + name: {{ include "soketi.serviceAccountName" . }} +roleRef: + kind: Role + name: {{ include "soketi.serviceAccountName" . }} + apiGroup: rbac.authorization.k8s.io +{{- end }} diff --git a/charts/k8soketi/templates/serviceaccount.yaml b/charts/k8soketi/templates/serviceaccount.yaml new file mode 100644 index 0000000..225145c --- /dev/null +++ b/charts/k8soketi/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "soketi.serviceAccountName" . }} + labels: + {{- include "soketi.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/k8soketi/templates/servicemonitor.yaml b/charts/k8soketi/templates/servicemonitor.yaml new file mode 100644 index 0000000..8db1abc --- /dev/null +++ b/charts/k8soketi/templates/servicemonitor.yaml @@ -0,0 +1,20 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "soketi.fullname" . }} + labels: + {{- include "soketi.labels" . | nindent 4 }} +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "soketi.selectorLabels" . | nindent 6 }} + ws.soketi.app/serves-metrics: "yes" + endpoints: + - port: metrics + interval: {{ .Values.serviceMonitor.scrapeInterval }} + scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} +{{- end }} diff --git a/charts/k8soketi/templates/tests/test-connection.yaml b/charts/k8soketi/templates/tests/test-connection.yaml new file mode 100644 index 0000000..81d7ff7 --- /dev/null +++ b/charts/k8soketi/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "soketi.fullname" . }}-test-connection" + labels: + {{- include "soketi.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "soketi.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/k8soketi/values.yaml b/charts/k8soketi/values.yaml new file mode 100644 index 0000000..b9a6cec --- /dev/null +++ b/charts/k8soketi/values.yaml @@ -0,0 +1,205 @@ +# Default values for k8soketi. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +strategy: {} + # type: RollingUpdate + # rollingUpdate: + # maxSurge: 0 + # maxUnavailable: 1 + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +# k8soketi is the server that will act like the Pusher server. +app: + image: + repository: quay.io/soketi/k8soketi + pullPolicy: IfNotPresent + tag: "0.1-18-debian" + # You can use distroless to avoid Remote Code Execution attacks in-cluster. + # tag: "latest-18-distroless" + + flags: + - --verbose + - --accept-traffic-threshold=70 + + # Add extra env to the k8soketi container. + extraEnv: [] + # - name: NODE_NAME + # valueFrom: + # fieldRef: + # fieldPath: spec.nodeName + + # Extra volumes to mount on the container. + extraVolumeMounts: [] + # - name: some-folder + # mountPath: /some/path + + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + resources: + limits: + cpu: 500m + memory: 256Mi + # requests: + # cpu: 100m + # memory: 128Mi + + # The mode the app is running with. (full, worker, server) + # Read the documentation: https://docs.soketi.app/advanced-usage/horizontal-scaling/running-modes + mode: full + + # Multicast will enable settings for pods to support multicast. + multicast: + enabled: false + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet + +# Peer server is the P2P server that pods will communicate between them. +# Default is 6002, but you can set any port you want. +peerServer: + service: + type: ClusterIP + port: 6002 + annotations: {} + +metrics: + enabled: true + + service: + type: ClusterIP + port: 9601 + annotations: {} + +serviceMonitor: + enabled: false + scrapeInterval: 5s + scrapeTimeout: 3s + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 6001 + annotations: {} + +ingress: + enabled: false + # class: "nginx" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: k8soketi-example.local + paths: + - / + # - host: k8soketi.test + # paths: + # - / + tls: [] + # - secretName: k8soketi-example-tls + # hosts: + # - k8soketi-example.local + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 60 + targetMemoryUtilizationPercentage: 80 + + # Set the behavior for the autoscaler. + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior + behavior: + scaleDown: + stabilizationWindowSeconds: 1800 + scaleUp: + stabilizationWindowSeconds: 10 + + # Custom Metrics will be appended to the default CPU/Memory resources (if they're enabled). + customMetrics: [] + # - type: Pods + # pods: + # metric: + # name: nginx_process_utilization + # target: + # type: AverageValue + # averageValue: "50" + +pdb: + enabled: false + minAvailable: 1 + # maxUnavailable: 25% + +livenessProbe: + httpGet: + path: / + port: 6001 + httpHeaders: + - name: X-Kube-Healthcheck + value: "Yes" + initialDelaySeconds: 5 + periodSeconds: 2 + failureThreshold: 1 + successThreshold: 1 + # terminationGracePeriodSeconds: 30 + +readinessProbe: + httpGet: + path: /ready + port: 6001 + httpHeaders: + - name: X-Kube-Healthcheck + value: "Yes" + initialDelaySeconds: 5 + periodSeconds: 1 + failureThreshold: 1 + successThreshold: 1 + +# In some cases, closing a Pod that has a lot of connections +# will disconnect them, and stats would need some time to catch up with the disconnections, +# so a bigger termination grace period would be suitable. +terminationGracePeriodSeconds: 30 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +# Extra volumes to attach to the deployment. +extraVolumes: [] +# - name: some-folder +# emptyDir: {} + +# Extra containers to run in the deployment. +extraContainers: [] + +# Extra init containers to run in the deployment. +extraInitContainers: []