spinkube / spin-plugin-kube

A Spin plugin for interacting with Kubernetes.
Other
20 stars 5 forks source link

how to use on project not generated by spin new? #81

Closed codeitlikemiley closed 3 months ago

codeitlikemiley commented 3 months ago

i have already a docker image

so i did was run this command

spin kube scaffold --from codeitlikemiley/rust-grpc:latest

it generated

apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinApp
metadata:
  name: rust-grpc
spec:
  image: "codeitlikemiley/rust-grpc:latest"
  executor: containerd-shim-spin
  replicas: 2

running kubectl apply -f spinapp.yaml

i got this error:

Error from server (InternalError): error when creating "spinapp.yaml": Internal error occurred: failed calling webhook "mspinapp.kb.io": failed to call webhook: Post "https://spin-operator-webhook-service.spin-operator.svc:443/mutate-core-spinoperator-dev-v1alpha1-spinapp?timeout=10s": dial tcp *************:443: connect: connection refused

but when i crate my own deployment.yaml and service.yaml

kubectl apply -f  deployment.yaml 
kubectl apply -f service.yaml

that works since i can port foward

kubectl port-forward services/rust-grpc-service 50051:50051

and now i can use

evans -p 50051 -r

to test the pod

my question is is there a way i can use spin kube on any of my existing project?

or i am bound to create a new one with spin new and move all my rust code there?

would appreciate any help thanks