Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

3.8 KB
Raw Blame
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "helm.fullname" . }}
  labels:
    {{- include "helm.labels" . | nindent 4 }}
spec:
  # One writer: the API's data is JSON files on a ReadWriteOnce volume. Recreate, so the old pod
  # lets go of the volume before the new one mounts it.
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      {{- include "helm.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
        checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
        {{- with .Values.podAnnotations }}
        {{- toYaml . | nindent 8 }}
        {{- end }}
      labels:
        {{- include "helm.labels" . | nindent 8 }}
        {{- with .Values.podLabels }}
        {{- toYaml . | nindent 8 }}
        {{- end }}
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      serviceAccountName: {{ include "helm.serviceAccountName" . }}
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      containers:
        - name: api
          securityContext:
            {{- toYaml .Values.securityContext | nindent 12 }}
          image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.api.image.pullPolicy }}
          envFrom:
            - configMapRef:
                name: {{ include "helm.fullname" . }}-api
            - secretRef:
                name: {{ include "helm.fullname" . }}-api
          ports:
            - name: api
              containerPort: {{ .Values.api.service.port }}
              protocol: TCP
          livenessProbe:
            {{- toYaml .Values.api.livenessProbe | nindent 12 }}
          readinessProbe:
            {{- toYaml .Values.api.readinessProbe | nindent 12 }}
          resources:
            {{- toYaml .Values.api.resources | nindent 12 }}
          volumeMounts:
            - name: data
              mountPath: {{ .Values.api.env.DATA_DIR | default "/data" }}
        - name: web
          securityContext:
            {{- toYaml .Values.securityContext | nindent 12 }}
          image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.web.image.pullPolicy }}
          envFrom:
            - configMapRef:
                name: {{ include "helm.fullname" . }}-web
          # NGINX_PORT (the ConfigMap) is the same web.service.port, 8080 unless changed: uid 101
          # cannot bind 80 here. The probes and the Service's targetPort name this port.
          ports:
            - name: web
              containerPort: {{ .Values.web.service.port }}
              protocol: TCP
          livenessProbe:
            {{- toYaml .Values.web.livenessProbe | nindent 12 }}
          readinessProbe:
            {{- toYaml .Values.web.readinessProbe | nindent 12 }}
          resources:
            {{- toYaml .Values.web.resources | nindent 12 }}
          # No volume: the exercise stills and animations (180 px) are part of the web image since
          # v1.4.0. They are licensed from Gym visual for openGym only; see NOTICE.md.
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: {{ .Values.persistence.data.existingClaim | default (printf "%s-data" (include "helm.fullname" .)) }}
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}