Skip to content

Commit

Permalink
add rathole service and statefilset yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham3121 committed Apr 30, 2024
1 parent b61d70e commit 6f0759e
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/grid/helm/syft/templates/rathole/rathole-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: rathole
labels:
{{- include "common.labels" . | nindent 4 }}
app.kubernetes.io/component: rathole
spec:
type: ClusterIP
selector:
{{- include "common.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: rathole
ports:
- name: nginx
protocol: TCP
port: 80
targetPort: 80
- name: api
protocol: TCP
port: 5555
targetPort: 5555
type: NodePort
selector:
{{- include "common.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: rathole
ports:
- name: rathole
protocol: TCP
port: 2333
targetPort: 2333
89 changes: 89 additions & 0 deletions packages/grid/helm/syft/templates/rathole/rathole-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: rathole
labels:
{{- include "common.labels" . | nindent 4 }}
app.kubernetes.io/component: rathole
spec:
replicas: 1
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
{{- include "common.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: rathole
serviceName: rathole
podManagementPolicy: OrderedReady
template:
metadata:
labels:
{{- include "common.labels" . | nindent 8 }}
app.kubernetes.io/component: rathole
{{- if .Values.rathole.podLabels }}
{{- toYaml .Values.rathole.podLabels | nindent 8 }}
{{- end }}
{{- if .Values.rathole.podAnnotations }}
annotations: {{- toYaml .Values.rathole.podAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if .Values.rathole.nodeSelector }}
nodeSelector: {{- .Values.rathole.nodeSelector | toYaml | nindent 8 }}
{{- end }}
containers:
- name: rathole
image: {{ .Values.global.registry }}/openmined/grid-rathole:{{ .Values.global.version }}
imagePullPolicy: Always
resources: {{ include "common.resources.set" (dict "resources" .Values.rathole.resources "preset" .Values.rathole.resourcesPreset) | nindent 12 }}
env:
- name: SERVICE_NAME
value: "rathole"
- name: APP_LOG_LEVEL
value: {{ .Values.rathole.appLogLevel | quote }}
- name: MODE
value: {{ .Values.rathole.mode | quote }}
- name: DEV_MODE
value: {{ .Values.rathole.devMode | quote }}
- name: APP_PORT
value: {{ .Values.rathole.appPort | quote }}
- name: RATHOLE_PORT
value: {{ .Values.rathole.ratholePort | quote }}
{{- if .Values.rathole.env }}
{{- toYaml .Values.rathole.env | nindent 12 }}
{{- end }}
ports:
- name: rathole-port
containerPort: 2333
- name: api-port
containerPort: 5555
- name: nginx-port
containerPort: 80
startupProbe:
httpGet:
path: /?probe=startupProbe
port: api-port
failureThreshold: 30
livenessProbe:
httpGet:
path: /ping?probe=livenessProbe
port: api-port
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
volumeMounts:
- name: rathole-data
mountPath: /data
readOnly: false
# TODO: Mount the .toml and nginx.conf files

# Add any additional container configuration here
# such as environment variables, volumes, etc.
volumeClaimTemplates:
- metadata:
name: rathole-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ .Values.rathole.volumeSize | quote }}
storageClassName: {{ .Values.rathole.storageClassName | quote }}
24 changes: 24 additions & 0 deletions packages/grid/helm/syft/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,27 @@ ingress:
# =================================================================================

extraResources: []


# =================================================================================

rathole:
# Extra environment vars
env: null

ratholePort: 2333
appPort: 5555
mode: "client"
devMode: "false"
appLogLevel: "info"

# Pod labels & annotations
podLabels: null
podAnnotations: null

# Node selector for pods
nodeSelector: null

# Pod Resource Limits
resourcesPreset: small
resources: null

0 comments on commit 6f0759e

Please sign in to comment.