Skip to content

Commit

Permalink
feat(node): add broadcaster
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Jan 18, 2024
1 parent 2e525f6 commit 85c9abb
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/rss3-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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: 0.3.1
version: 0.3.2

# 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
Expand Down
9 changes: 8 additions & 1 deletion charts/rss3-node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,11 @@ node.rss3.io/network: {{ .network }}
{{- if .worker }}
node.rss3.io/worker: {{ .worker }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create rss3-node hub name and version as used by the chart label.
*/}}
{{- define "rss3-node.broadcaster.fullname" -}}
{{- printf "%s-%s" (include "rss3-node.fullname" .) .Values.broadcaster.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
74 changes: 74 additions & 0 deletions charts/rss3-node/templates/broadcaster/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apiVersion: apps/v1
kind: Deployment
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.broadcaster.deploymentAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ template "rss3-node.broadcaster.fullname" .}}
labels:
{{- include "rss3-node.labels" (dict "context" . "component" .Values.broadcaster.name "name" .Values.broadcaster.name) | nindent 4 }}
spec:
replicas: {{ .Values.broadcaster.replicaCount }}
revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "rss3-node.selectorLabels" (dict "context" . "name" .Values.broadcaster.name) | nindent 6 }}
template:
metadata:
annotations:
checksum/configmap: {{ include "rss3-node.globalConfigCheckSum" .}}
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.broadcaster.podAnnotations) }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "rss3-node.labels" (dict "context" . "component" .Values.broadcaster.name "name" .Values.broadcaster.name) | nindent 8 }}
{{- with .Values.broadcaster.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.broadcaster.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "rss3-node.hub.ServiceAccountName" . }}
securityContext:
{{- toYaml .Values.broadcaster.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Values.broadcaster.name }}
securityContext:
{{- toYaml .Values.broadcaster.securityContext | nindent 12 }}
image: "{{ default .Values.global.image.repository .Values.broadcaster.image.repository }}:{{ .Values.broadcaster.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.broadcaster.image.pullPolicy }}
args:
- --module=broadcaster
resources:
{{- toYaml .Values.broadcaster.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /root/rss3-node/deploy
{{- with .Values.broadcaster.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "rss3-node.fullname" . }}
defaultMode: 0644
{{- with .Values.broadcaster.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.broadcaster.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.broadcaster.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.broadcaster.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
64 changes: 64 additions & 0 deletions charts/rss3-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,70 @@ hub:

affinity: { }

## BroadCaster
broadcaster:
# -- RSS3 Node hub name
name: broadcaster

replicaCount: 1

image:
repository: rss3/node
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: [ ]

# -- Annotations to be added to server Deployment
deploymentAnnotations: { }

# -- Annotations to be added to server pods
podAnnotations: { }

# -- Labels to be added to server pods
podLabels: { }

# -- Resource limits and requests for the Argo CD server
resources: { }
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 50m
# memory: 64Mi


podSecurityContext: { }
# fsGroup: 2000

securityContext: { }
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

# Additional volumes on the output Deployment definition.
volumes: [ ]
# - name: foo
# secret:
# secretName: mysecret
# optional: false

# Additional volumeMounts on the output Deployment definition.
volumeMounts: [ ]
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true

nodeSelector: { }

tolerations: [ ]

affinity: { }

## Node Configs
configs:
environment: development
Expand Down

0 comments on commit 85c9abb

Please sign in to comment.