diff --git a/README.md b/README.md index 84f3f33..fa18027 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,23 @@ # cursor-devbox -Personal Cursor Remote-SSH workspace image and GitOps for **node1-k3s** and a second home on **node4-k3s**. +Personal Cursor Remote-SSH workspace image and GitOps for **node4-k3s** (box2) and **node5-k3s** (box3). - **Image**: `dcr.trinitysan.by/infra/cursor-devbox` -- **Deploy**: `deploy/node1-k3s/` and `deploy/node4-k3s/` +- **Deploy**: `deploy/node4-k3s/` and `deploy/node5-k3s/` - **Flux image automation**: `flux/` (ImageRepository / ImagePolicy / ImageUpdateAutomation) -Infra on node1 only keeps thin Flux glue (`GitRepository` + Kustomizations + auth SecretAdapters) in `infrastructure/node1-k3s/130-cursor-devbox.yaml`. +Infra glue per cluster lives in the infra repo: `infrastructure/node4-k3s/136-cursor-devbox.yaml`, `infrastructure/node5-k3s/137-cursor-devbox.yaml`. The Gitea PAT (`gitea-cursor-devbox-gitops-token`) originates on node1 (`infrastructure/node1-k3s/130-cursor-devbox.yaml`) and reaches other clusters via the federated-secrets export. + +> History: the original node1 devbox (`devbox.trinitysan.by`) was decommissioned 2026-11-03 — data migrated to box3, workload and PVC removed. Image automation moved from node1 to node5 at the same time. ## Access | Endpoint | Detail | |----------|--------| -| SSH (node1) | `ssh -p 2222 developer@devbox.trinitysan.by` | -| HTTP health (node1) | `https://devbox.trinitysan.by/` | | SSH (node4) | `ssh -p 2222 developer@box2.trinitysan.by` | | HTTP health (node4) | `https://box2.trinitysan.by/` | +| SSH (node5) | `ssh -p 2222 developer@box3.trinitysan.by` | +| HTTP health (node5) | `https://box3.trinitysan.by/` | ## CI @@ -39,7 +41,7 @@ docker build -t dcr.trinitysan.by/infra/cursor-devbox:local . 1. CI pushes `run_number-sha` to DCR 2. ImageRepository scans; ImagePolicy picks highest `run_number` -3. ImageUpdateAutomation commits the new tag into `deploy/node1-k3s/020-statefulset.yaml` and `deploy/node4-k3s/020-statefulset.yaml` +3. ImageUpdateAutomation commits the new tag into `deploy/node4-k3s/020-statefulset.yaml` and `deploy/node5-k3s/020-statefulset.yaml` 4. Kustomization applies; StatefulSet rolls (active SSH sessions drop) Requires a Gitea PAT with **read+write** on this repo (`GITEA_CURSOR_DEVBOX_GITOPS_TOKEN` on node1, see infra `060-external-secrets.yaml.template`). diff --git a/deploy/node1-k3s/010-namespace-secrets.yaml b/deploy/node1-k3s/010-namespace-secrets.yaml deleted file mode 100644 index 67c8245..0000000 --- a/deploy/node1-k3s/010-namespace-secrets.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Namespace, DCR pull secret, SSH allowlist, Service. -# Reconciled by Flux Kustomization cursor-devbox (path ./deploy/node1-k3s) on node1-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: laptop SSH public keys (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@box3 - ---- -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/node1-k3s/020-statefulset.yaml b/deploy/node1-k3s/020-statefulset.yaml deleted file mode 100644 index 89d353e..0000000 --- a/deploy/node1-k3s/020-statefulset.yaml +++ /dev/null @@ -1,119 +0,0 @@ -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:11-7718fcd070d8d970f7d81d194f93e8ce706b3a44 # {"$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 - - name: HTTP_PROXY - value: socks5h://node2-socks5.egress-proxy.svc.clusterset.local:1080 - - name: HTTPS_PROXY - value: socks5h://node2-socks5.egress-proxy.svc.clusterset.local:1080 - - name: NO_PROXY - value: localhost,127.0.0.1,::1,.svc,.svc.cluster.local,.svc.clusterset.local,.trinitysan.by,107.155.122.141,107.155.122.212,63.250.53.80,91.210.106.53,10.0.0.0/8,10.32.0.0/12,10.43.0.0/16,10.51.0.0/16,10.53.0.0/16 - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - SYS_PTRACE - resources: - requests: - cpu: "2" - memory: 3Gi - limits: - cpu: "6" - memory: 8Gi - # 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: "1" - memory: 1Gi - limits: - cpu: "4" - memory: 4Gi - 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 - storageClassName: local-storage - resources: - requests: - storage: 30Gi diff --git a/deploy/node1-k3s/030-ingress.yaml b/deploy/node1-k3s/030-ingress.yaml deleted file mode 100644 index efe9030..0000000 --- a/deploy/node1-k3s/030-ingress.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Traefik TCP SSH + TrinityIngress HTTP health. - ---- -# 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. -apiVersion: ingress.trinitysan.by/v1 -kind: TrinityIngress -metadata: - name: cursor-devbox - namespace: cursor-devbox -spec: - hostname: devbox.trinitysan.by - targetTraefikIP: "91.210.106.53" - serviceRef: - namespace: cursor-devbox - name: cursor-devbox - port: 8080 - certificateReclaimPolicy: Retain diff --git a/deploy/node1-k3s/kustomization.yaml b/deploy/node1-k3s/kustomization.yaml deleted file mode 100644 index abf2bcd..0000000 --- a/deploy/node1-k3s/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - 010-namespace-secrets.yaml - - 020-statefulset.yaml - - 030-ingress.yaml diff --git a/deploy/node5-k3s/010-namespace-secrets.yaml b/deploy/node5-k3s/010-namespace-secrets.yaml index 3e3ee26..4814b3b 100644 --- a/deploy/node5-k3s/010-namespace-secrets.yaml +++ b/deploy/node5-k3s/010-namespace-secrets.yaml @@ -28,8 +28,8 @@ spec: .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. +# Hardcoded allowlist: laptop keys inherited from the decommissioned node1 +# devbox plus the box developer's own identity. Not secrets. apiVersion: v1 kind: ConfigMap metadata: diff --git a/flux/image-automation.yaml b/flux/image-automation.yaml index 2411bea..7c3ffe9 100644 --- a/flux/image-automation.yaml +++ b/flux/image-automation.yaml @@ -1,7 +1,8 @@ -# Flux image automation for cursor-devbox (applied into flux-system on node1). -# GitRepository cursor-devbox is defined in infra glue (130-cursor-devbox.yaml). +# Flux image automation for cursor-devbox (applied into flux-system on node5 since +# the node1 devbox decommission 2026-11-03; see infra 137-cursor-devbox.yaml). +# GitRepository cursor-devbox is defined in infra glue (137-cursor-devbox.yaml). # CI tags: latest, , - — policy elects the last form. -# Setters scan the repo so deploy/node1-k3s and deploy/node4-k3s stay on the elected tag. +# Setters scan the repo so deploy/node4-k3s and deploy/node5-k3s stay on the elected tag. --- apiVersion: image.toolkit.fluxcd.io/v1