apiVersion: v1 kind: Namespace metadata: name: copilot --- apiVersion: apps/v1 kind: Deployment metadata: name: copilot-api namespace: copilot spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: copilot-api template: metadata: labels: app: copilot-api spec: containers: - name: copilot-api image: node:latest imagePullPolicy: Always workingDir: /app command: ["sh", "-c"] args: ["npm cache clean --force && npx copilot-api@latest start --github-token $COPILOT_TOKEN --port 4444"] env: - name: COPILOT_TOKEN valueFrom: secretKeyRef: name: copilot-secret key: token ports: - containerPort: 4444 --- apiVersion: v1 kind: Service metadata: name: copilot-api namespace: copilot spec: selector: app: copilot-api ports: - name: http protocol: TCP port: 4444 targetPort: 4444 --- apiVersion: v1 kind: Secret metadata: name: copilot-secret namespace: copilot type: Opaque stringData: token: "YOUR_COPILOT_TOKEN_HERE" ---