Skip to content

Commit

Permalink
add rathole to devspace and define a configmap to update server.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham3121 committed Apr 30, 2024
1 parent 6f0759e commit bffeefa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
13 changes: 13 additions & 0 deletions packages/grid/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ vars:
DOCKER_IMAGE_BACKEND: openmined/grid-backend
DOCKER_IMAGE_FRONTEND: openmined/grid-frontend
DOCKER_IMAGE_SEAWEEDFS: openmined/grid-seaweedfs
DOCKER_IMAGE_RATHOLE: openmined/grid-rathole
CONTAINER_REGISTRY: "docker.io"
VERSION: "0.8.7-beta.2"
PLATFORM: $(uname -m | grep -q 'arm64' && echo "arm64" || echo "amd64")
Expand Down Expand Up @@ -58,6 +59,14 @@ images:
context: ./seaweedfs
tags:
- dev-${DEVSPACE_TIMESTAMP}
rathole:
image: "${CONTAINER_REGISTRY}/${DOCKER_IMAGE_RATHOLE}"
buildKit:
args: ["--platform", "linux/${PLATFORM}"]
dockerfile: ./rathole/rathole.dockerfile
context: ./rathole
tags:
- dev-${DEVSPACE_TIMESTAMP}

# This is a list of `deployments` that DevSpace can create for this project
deployments:
Expand Down Expand Up @@ -109,6 +118,10 @@ dev:
- path: ./backend/grid:/root/app/grid
- path: ../syft:/root/app/syft
ssh: {}
rathole:
labelSelector:
app.kubernetes.io/name: syft
app.kubernetes.io/component: rathole

profiles:
- name: gateway
Expand Down
11 changes: 11 additions & 0 deletions packages/grid/helm/syft/templates/rathole/rathole-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: rathole-config
labels:
{{- include "common.labels" . | nindent 4 }}
app.kubernetes.io/component: rathole
data:
myserver.toml: |
[server]
bind_addr = "0.0.0.0:2333"
25 changes: 17 additions & 8 deletions packages/grid/helm/syft/templates/rathole/rathole-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
- 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 }}
resources: {{ include "common.resources.set" (dict "resources" .Values.rathole.resources "preset" .Values.rathole.resourcesPreset) | nindent 12 }}
env:
- name: SERVICE_NAME
value: "rathole"
Expand Down Expand Up @@ -65,25 +65,34 @@ spec:
failureThreshold: 30
livenessProbe:
httpGet:
path: /ping?probe=livenessProbe
path: /?probe=livenessProbe
port: api-port
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
volumeMounts:
- name: rathole-data
mountPath: /data
- name: rathole-config
mountPath: /app/data/myserver.toml
subPath: myserver.toml
readOnly: false
# TODO: Mount the .toml and nginx.conf files
terminationGracePeriodSeconds: 5
volumes:
- name: rathole-config
configMap:
name: rathole-config
# 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
labels:
{{- include "common.volumeLabels" . | nindent 8 }}
app.kubernetes.io/component: rathole
spec:
accessModes: [ "ReadWriteOnce" ]
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.rathole.volumeSize | quote }}
storageClassName: {{ .Values.rathole.storageClassName | quote }}
storage: 10Mi

0 comments on commit bffeefa

Please sign in to comment.