diff --git a/k8s/apps/gitea/deployment.yaml b/k8s/apps/gitea/deployment.yaml index eebd096..d5c08cc 100644 --- a/k8s/apps/gitea/deployment.yaml +++ b/k8s/apps/gitea/deployment.yaml @@ -77,101 +77,6 @@ spec: labels: app: gitea-runner spec: - #nodeSelector: - # kubernetes.io/hostname: home.homenet - volumes: - - name: docker-sock - hostPath: - path: /var/run/docker.sock - type: Socket - - name: runner-data - emptyDir: - sizeLimit: 30Gi - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - preference: - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - home.homenet - - weight: 2 - preference: - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - master.tail2fe2d.ts.net - - weight: 3 - preference: - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - it.tail2fe2d.ts.net - - ch.tail2fe2d.ts.net - - us.tail2fe2d.ts.net - - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - home.homenet - - it.tail2fe2d.ts.net - - ch.tail2fe2d.ts.net - - us.tail2fe2d.ts.net - - master.tail2fe2d.ts.net - containers: - - name: gitea-runner - image: gitea/act_runner:nightly - resources: - requests: - cpu: "100m" - memory: "256Mi" - ephemeral-storage: "1Gi" # reserve ephemeral storage - limits: - cpu: "3000m" - memory: "4Gi" - ephemeral-storage: "28Gi" # hard cap for /data usage - volumeMounts: - - name: docker-sock - mountPath: /var/run/docker.sock - - name: runner-data - mountPath: /data - env: - - name: GITEA_INSTANCE_URL - value: "https://gt.hexor.cy" - - name: GITEA_RUNNER_REGISTRATION_TOKEN - valueFrom: - secretKeyRef: - name: gitea-runner-act-runner-secrets - key: token - - name: GITEA_RUNNER_NAME - value: "k8s-runner" - - name: GITEA_RUNNER_LABELS - value: "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://ghcr.io/catthehacker/ubuntu:act-20.04" - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: gitea-runner-desktop -spec: - replicas: 1 - selector: - matchLabels: - app: gitea-runner-desktop - template: - metadata: - labels: - app: gitea-runner-desktop - spec: - nodeSelector: - kubernetes.io/hostname: uk-desktop.tail2fe2d.ts.net tolerations: - key: workload operator: Equal @@ -185,6 +90,39 @@ spec: - name: runner-data emptyDir: sizeLimit: 30Gi + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + preference: + matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - uk-desktop.tail2fe2d.ts.net + - weight: 50 + preference: + matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - home.homenet + - weight: 30 + preference: + matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - master.tail2fe2d.ts.net + - weight: 10 + preference: + matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - it.tail2fe2d.ts.net + - ch.tail2fe2d.ts.net + - us.tail2fe2d.ts.net containers: - name: gitea-runner image: gitea/act_runner:nightly @@ -211,6 +149,6 @@ spec: name: gitea-runner-act-runner-secrets key: token - name: GITEA_RUNNER_NAME - value: "k8s-runner-desktop" + value: "k8s-runner" - name: GITEA_RUNNER_LABELS value: "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://ghcr.io/catthehacker/ubuntu:act-20.04"