Closed bacongobbler closed 8 months ago
I think this might've been due to the fact that I'm using an outdated fork... Recreating my dev environment to reproduce the issue.
Nope. I was able to reproduce the same issue on main
.
><> spin k8s scaffold --from bacongobbler/hello-rust:latest | kubectl apply -f -
spinapp.core.spinoperator.dev/hello-rust created
><> k get spinapps hello-rust -o yaml
apiVersion: core.spinoperator.dev/v1
kind: SpinApp
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"core.spinoperator.dev/v1","kind":"SpinApp","metadata":{"annotations":{},"name":"hello-rust","namespace":"default"},"spec":{"executor":"containerd-shim-spin","image":"bacongobbler/hello-rust:latest","replicas":2}}
creationTimestamp: "2024-02-20T19:00:11Z"
generation: 1
name: hello-rust
namespace: default
resourceVersion: "1107"
uid: c8a32ddf-3ace-4a05-a7ea-c106fd153fa2
spec:
checks: {}
enableAutoscaling: false
executor: containerd-shim-spin
image: bacongobbler/hello-rust:latest
replicas: 2
resources: {}
runtimeConfig: {}
status:
activeScheduler: containerd-shim-spin
conditions:
- lastTransitionTime: "2024-02-20T19:00:14Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2024-02-20T19:00:11Z"
message: ReplicaSet "hello-rust-77496795b6" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
readyReplicas: 2
><> k scale spinapp hello-rust --replicas 3
Error from server (NotFound): spinapps.core.spinoperator.dev "hello-rust" not found
We don't implement a /scale
subresource - we currently have you disable our replicas
if you want to integrate with things like HPA.
We could make the SpinApp CR scalable with something like:
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyReplicas,selectorpath=.status.selector
if we published the pod selector in our status too. But this isn't something we've discussed or thought through - I'm not sure how integrating with HPA works metrics wise if you're not a first party k8s component
To be clear, there is an existing workaround. You can change the number of replicas in the manifest and call kubectl apply
a second time.
><> spin k8s scaffold --from bacongobbler/hello-rust:latest | kubectl apply -f -
spinapp.core.spinoperator.dev/hello-rust created
><> spin k8s list
NAMESPACE NAME EXECUTOR READY
default hello-rust containerd-shim-spin 2/2
><> spin k8s scaffold --from bacongobbler/hello-rust:latest --replicas 3 | kubectl apply -f -
spinapp.core.spinoperator.dev/hello-rust configured
><> spin k8s list
NAMESPACE NAME EXECUTOR READY
default hello-rust containerd-shim-spin 3/3
Yep! (you can also kubectl edit
and update the replicas there)
Can we remove this from the Initial release project board? Doesn't seem totally necessary to solve this issue given that we have several documented workarounds in this thread.
closing as duplicate of https://github.com/spinkube/spin-operator/issues/24.
Given the following SpinApp:
kubectl get spinapp hello-rust
works:But
kubectl scale spinapp hello-rust
does not.