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: networking.k8s.io/v1 kind: Ingress metadata: name: copilot-api-ingress namespace: copilot annotations: cert-manager.io/cluster-issuer: cloudflare-issuer spec: ingressClassName: nginx tls: - hosts: - copilot.alexmickelson.guru secretName: copilot-api-tls-cert rules: - host: copilot.alexmickelson.guru http: paths: - path: / pathType: Prefix backend: service: name: copilot-api port: number: 4444 ---