From bd1ba87e33c291d30fecbe0453f0e6ad443ad997 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 2 Nov 2026 13:42:03 +0000 Subject: [PATCH] deploy: add node5 instance box3.trinitysan.by MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same shape as box2 (no proxy env — NL egress is clean) with node5 sizing: ssh req 2/16Gi lim 12/48Gi, dind req 2/2Gi lim 12/48Gi, PVC local-storage 150Gi (hostpath, non-expandable). authorized_keys = node1 devbox keys + developer@cursor-devbox-0. First TrinityIngress on node5. --- deploy/node5-k3s/010-namespace-secrets.yaml | 63 +++++++++++ deploy/node5-k3s/020-statefulset.yaml | 116 ++++++++++++++++++++ deploy/node5-k3s/030-ingress.yaml | 37 +++++++ deploy/node5-k3s/kustomization.yaml | 6 + 4 files changed, 222 insertions(+) create mode 100644 deploy/node5-k3s/010-namespace-secrets.yaml create mode 100644 deploy/node5-k3s/020-statefulset.yaml create mode 100644 deploy/node5-k3s/030-ingress.yaml create mode 100644 deploy/node5-k3s/kustomization.yaml diff --git a/deploy/node5-k3s/010-namespace-secrets.yaml b/deploy/node5-k3s/010-namespace-secrets.yaml new file mode 100644 index 0000000..3e3ee26 --- /dev/null +++ b/deploy/node5-k3s/010-namespace-secrets.yaml @@ -0,0 +1,63 @@ +# Namespace, DCR pull secret, SSH allowlist, Service. +# Reconciled by Flux Kustomization cursor-devbox (path ./deploy/node5-k3s) on node5-k3s. + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: cursor-devbox + labels: + name: cursor-devbox + annotations: + linkerd.io/inject: disabled + +--- +# Replicate federated DCR RO credentials for kubelet imagePullSecrets. +apiVersion: secret-adapter.trinitysan.by/v1 +kind: SecretAdapter +metadata: + name: dcr-registry-auth-ro + namespace: cursor-devbox +spec: + name: dcr-registry-auth-ro + namespace: cursor-devbox + type: kubernetes.io/dockerconfigjson + waitForSources: true + syncInterval: 60 + stringData: + .dockerconfigjson: ${federated-secrets.dcr-registry-auth-ro.".dockerconfigjson"} + +--- +# Hardcoded allowlist: same keys as the node1 devbox (this box) plus the box +# developer's own identity (developer@cursor-devbox-0). Not secrets. +apiVersion: v1 +kind: ConfigMap +metadata: + name: cursor-devbox-authorized-keys + namespace: cursor-devbox +data: + authorized_keys: | + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDbyPCd5RhlTZYCIgmrSGR6ugnwI513vzHf0qvUP3pGf8mYVd68G6CLu9OXJxFv+LKo2eT8H3ToxLpuG0iiIWz+4rJrNXTJInU2lqrcMsHhLoo1XCs7OAARYiIp7Pl4XKcLdbiXwdL2XUsHImv7cjmaD6jGJ3yR+q9t6jORQEB/h6nUc0MMkNKLIrUyJSlZtWRp22ymGnEqiwKl9doukii6QBhY1k+i9oW09ln6gbFTol9KoONkJ74b2iKw5abZwyjjXuXaE1b98/nmI30MYs8VMJC/w9pEZbmVEflb1k4+C1IE5llwmievjNWpWlZt38uzvGTLbiC9mMIewwFm4UsT5ASLpYKBdFrCaK4JIOTCdJt+SMInkzz0rArCNPMBwZIjBgCFSM33nJsX4gbf/l/rnVtLjXr86rF5s9SOSVyQmjPJoBigqyGw45H2CrB7iTqqWGCpPTnXbzzspiIQGYXLW5+5/4wARCPO0KXYcPgg4Vzh5z+dMcFKJvc8XhocZCc= aaa@LAPTOP-08PG1IL5 + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDK+dk9MtPgRZr7638SASpbJK7z+XkmBesXRlozTFqvT0X6gKk+75kyqNR2W+ZXDwiiWuXS2t9Dbdk9Xpuj2uWaUE0D+n3NOFEQV27Zd1ZTMeLlf3ukSLhb7un0pFHXQXvPn2Iwhh5zCyTDvIWU1rHUgBmakmxoRZ6zwJdsZX/yZHurts//7Dvb2xKKYAq4MFMAB+s6Ch80q6kCnHcByJVFyVLfOUVcNzHGUQbbj4pft2QYiTVxqTBZdvdWQvdBRkKjV2oK/mRUfGsdwmk+ldT65hdcFjbG3oG4hD3g2+AJC+/vN/xqlCeht/TU/Ei4GMF3UB3ank7z1rsGbU1T5lDoFWBWMg+tgw7ZdbYD+HIi/kuQU3FKM2xekB2fgpzuu5GQynjflygBmuQQp5/HAJDoxrkt+Yn79QX6aan8xXcHnt600Bm7SWfnsCl6BpcaD/8f2Lr8CcFCN5pcG020gvLSVdok71dB27NQ/2HOax1i0WQTZVjDrL6kMwRb37njr/k= svv@LAPTOP-08PG1IL5 + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA6qTQDgqPFTbqjS1bguEW8xs903Typhx5EVbdidmw73 developer@cursor-devbox-0 + +--- +apiVersion: v1 +kind: Service +metadata: + name: cursor-devbox + namespace: cursor-devbox + annotations: + service.kubernetes.io/topology-mode: Auto +spec: + selector: + app: cursor-devbox + ports: + - name: ssh + port: 22 + targetPort: ssh + protocol: TCP + - name: http + port: 8080 + targetPort: http + protocol: TCP diff --git a/deploy/node5-k3s/020-statefulset.yaml b/deploy/node5-k3s/020-statefulset.yaml new file mode 100644 index 0000000..b593e82 --- /dev/null +++ b/deploy/node5-k3s/020-statefulset.yaml @@ -0,0 +1,116 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: cursor-devbox + namespace: cursor-devbox +spec: + serviceName: cursor-devbox + replicas: 1 + selector: + matchLabels: + app: cursor-devbox + template: + metadata: + labels: + app: cursor-devbox + annotations: + linkerd.io/inject: disabled + spec: + terminationGracePeriodSeconds: 30 + imagePullSecrets: + - name: dcr-registry-auth-ro + containers: + - name: ssh + image: dcr.trinitysan.by/infra/cursor-devbox:10-90c6b6c4250a68f4cb654bc18e52f2a47f9dc3a4 # {"$imagepolicy": "flux-system:cursor-devbox"} + imagePullPolicy: IfNotPresent + ports: + - name: ssh + containerPort: 22 + - name: http + containerPort: 8080 + env: + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + - name: HOME + value: /home/developer + securityContext: + allowPrivilegeEscalation: true + capabilities: + add: + - SYS_PTRACE + # node5 (12 CPU / 60Gi): main box gets generous bursts; node also + # hosts the CI runner and core services, so requests stay modest. + resources: + requests: + cpu: "2" + memory: 16Gi + limits: + cpu: "12" + memory: 48Gi + # startupProbe covers slow first boot (sshd after host-key/auth setup). + startupProbe: + tcpSocket: + port: ssh + failureThreshold: 60 + periodSeconds: 10 + readinessProbe: + tcpSocket: + port: ssh + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: ssh + periodSeconds: 20 + volumeMounts: + - name: home + mountPath: /home/developer + subPath: home + - name: authorized-keys + mountPath: /etc/ssh-authorized-keys + readOnly: true + - name: dind + image: docker:27-dind + imagePullPolicy: IfNotPresent + args: + - --host=tcp://0.0.0.0:2375 + - --tls=false + env: + - name: DOCKER_TLS_CERTDIR + value: "" + securityContext: + privileged: true + resources: + requests: + cpu: "2" + memory: 2Gi + limits: + cpu: "12" + memory: 48Gi + readinessProbe: + tcpSocket: + port: 2375 + initialDelaySeconds: 5 + periodSeconds: 10 + volumeMounts: + - name: home + mountPath: /var/lib/docker + subPath: docker + - name: dind-run + mountPath: /var/run + volumes: + - name: authorized-keys + configMap: + name: cursor-devbox-authorized-keys + - name: dind-run + emptyDir: {} + volumeClaimTemplates: + - metadata: + name: home + spec: + accessModes: + - ReadWriteOnce + # node5 has only hostpath local-storage (no expansion) — sized generously. + storageClassName: local-storage + resources: + requests: + storage: 150Gi diff --git a/deploy/node5-k3s/030-ingress.yaml b/deploy/node5-k3s/030-ingress.yaml new file mode 100644 index 0000000..1ec39d4 --- /dev/null +++ b/deploy/node5-k3s/030-ingress.yaml @@ -0,0 +1,37 @@ +# Traefik TCP SSH + TrinityIngress HTTP health on node5 (box3.trinitysan.by). + +--- +# Traefik TCP :2222 → OpenSSH in the pod (plain SSH; HostSNI catch-all). +apiVersion: traefik.io/v1alpha1 +kind: IngressRouteTCP +metadata: + name: cursor-devbox-ssh + namespace: cursor-devbox +spec: + entryPoints: + - ssh + routes: + - match: HostSNI(`*`) + services: + - name: cursor-devbox + port: 22 + +--- +# DNS A record + HTTPS front for the tiny HTTP health page; SSH uses Traefik TCP :2222. +# First TrinityIngress on node5: the operator adopts the pre-seeded +# coredns-trinitysan-zone ConfigMap placeholder (110-core-dns.yaml). +apiVersion: ingress.trinitysan.by/v1 +kind: TrinityIngress +metadata: + name: cursor-devbox + namespace: cursor-devbox + annotations: + # cert-manager HTTP-01 self-check must reach Traefik :80, not the SSH Service. + ingress.trinitysan.by/internal-route-to-traefik: "true" +spec: + hostname: box3.trinitysan.by + serviceRef: + namespace: cursor-devbox + name: cursor-devbox + port: 8080 + certificateReclaimPolicy: Retain diff --git a/deploy/node5-k3s/kustomization.yaml b/deploy/node5-k3s/kustomization.yaml new file mode 100644 index 0000000..abf2bcd --- /dev/null +++ b/deploy/node5-k3s/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - 010-namespace-secrets.yaml + - 020-statefulset.yaml + - 030-ingress.yaml