Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strict decoding error: unknown field "spec.strategy.enableExtraWorkloadForCanary" #211

Open
kinnylee opened this issue Apr 10, 2024 · 0 comments

Comments

@kinnylee
Copy link

kinnylee commented Apr 10, 2024

// kruise rollout version
$ kubectl -n kruise-rollout get deploy kruise-rollout-controller-manager -oyaml|grep image:
image: openkruise/kruise-rollout:v0.5.0

// apply rollout yaml, report unknown field "spec.strategy.enableExtraWorkloadForCanary"
$ kubectl apply -f rollout-backend.yaml
The request is invalid: patch: Invalid value: "{"apiVersion":"rollouts.kruise.io/v1beta1","kind":"Rollout","metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"rollouts.kruise.io/v1beta1\",\"kind\":\"Rollout\",\"metadata\":{\"annotations\":{},\"name\":\"devops-backend\",\"namespace\":\"devops-openkruise\"},\"spec\":{\"strategy\":{\"canary\":{\"steps\":[{\"matches\":[{\"headers\":[{\"name\":\"version\",\"type\":\"Exact\",\"value\":\"canary\"}]}],\"replicas\":1,\"requestHeaderModifier\":{\"add\":[{\"name\":\"version\",\"value\":\"canary\"}]},\"traffic\":\"10%\"},{\"replicas\":2,\"requestHeaderModifier\":{\"add\":[{\"name\":\"version\",\"value\":\"canary\"}]},\"traffic\":\"50%\"},{\"replicas\":\"80%\",\"traffic\":\"80%\"}],\"trafficRoutings\":[{\"customNetworkRefs\":[{\"apiVersion\":\"networking.istio.io/v1alpha3\",\"kind\":\"VirtualService\",\"name\":\"devops-backend\"}],\"service\":\"devops-backend\"}]},\"enableExtraWorkloadForCanary\":true},\"workloadRef\":{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"name\":\"devops-backend\"}}}\n","rollouts.kruise.io/hash":"9492v4cx4v4f544wz48xvwv5vxxw82b8dxxbw548bx84567494496w5dfx6f54d8"},"creationTimestamp":"2024-04-09T14:12:40Z","finalizers":["rollouts.kruise.io/rollout"],"generation":3,"managedFields":[{"apiVersion":"rollouts.kruise.io/v1beta1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{"f:rollouts.kruise.io/hash":{}},"f:finalizers":{".":{},"v:\"rollouts.kruise.io/rollout\"":{}}}},"manager":"kruise-rollout","operation":"Update","time":"2024-04-09T14:12:40Z"},{"apiVersion":"rollouts.kruise.io/v1beta1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}}},"f:spec":{".":{},"f:disabled":{},"f:strategy":{".":{},"f:canary":{".":{},"f:steps":{},"f:trafficRoutings":{}}},"f:workloadRef":{".":{},"f:apiVersion":{},"f:kind":{},"f:name":{}}}},"manager":"kubectl-client-side-apply","operation":"Update","time":"2024-04-09T14:13:39Z"},{"apiVersion":"rollouts.kruise.io/v1beta1","fieldsType":"FieldsV1","fieldsV1":{"f:status":{".":{},"f:canaryStatus":{".":{},"f:canaryReadyReplicas":{},"f:canaryReplicas":{},"f:canaryRevision":{},"f:currentStepIndex":{},"f:currentStepState":{},"f:lastUpdateTime":{},"f:message":{},"f:observedWorkloadGeneration":{},"f:podTemplateHash":{},"f:rolloutHash":{},"f:stableRevision":{}},"f:conditions":{},"f:message":{},"f:observedGeneration":{},"f:phase":{}}},"manager":"kruise-rollout","operation":"Update","subresource":"status","time":"2024-04-10T01:40:16Z"}],"name":"devops-backend","namespace":"devops-openkruise","resourceVersion":"33632965","uid":"a49f36b8-2bb0-4d31-a276-657662d03529"},"spec":{"disabled":false,"strategy":{"canary":{"steps":[{"matches":[{"headers":[{"name":"version","type":"Exact","value":"canary"}]}],"replicas":1,"requestHeaderModifier":{"add":[{"name":"version","value":"canary"}]},"traffic":"10%"},{"replicas":2,"requestHeaderModifier":{"add":[{"name":"version","value":"canary"}]},"traffic":"50%"},{"replicas":"80%","traffic":"80%"}],"trafficRoutings":[{"customNetworkRefs":[{"apiVersion":"networking.istio.io/v1alpha3","kind":"VirtualService","name":"devops-backend"}],"service":"devops-backend"}]},"enableExtraWorkloadForCanary":true},"workloadRef":{"apiVersion":"apps/v1","kind":"Deployment","name":"devops-backend"}},"status":{"canaryStatus":{"canaryReadyReplicas":2,"canaryReplicas":2,"canaryRevision":"cc78bd69b","currentStepIndex":3,"currentStepState":"Completed","lastUpdateTime":"2024-04-10T01:40:11Z","message":"BatchRelease is at state Ready, rollout-id , step 3","observedWorkloadGeneration":35,"podTemplateHash":"7598ddd48f","rolloutHash":"9492v4cx4v4f544wz48xvwv5vxxw82b8dxxbw548bx84567494496w5dfx6f54d8","stableRevision":"67b9cb9d5c"},"conditions":[{"lastTransitionTime":"2024-04-09T14:19:44Z","lastUpdateTime":"2024-04-09T14:19:44Z","message":"Rollout progressing has been completed","reason":"Completed","status":"False","type":"Progressing"},{"lastTransitionTime":"2024-04-10T01:40:16Z","lastUpdateTime":"2024-04-10T01:40:16Z","message":"","reason":"","status":"True","type":"Succeeded"}],"message":"Rollout progressing has been completed","observedGeneration":3,"phase":"Healthy"}}": strict decoding error: unknown field "spec.strategy.enableExtraWorkloadForCanary"

// rollout yaml details
apiVersion: rollouts.kruise.io/v1beta1
kind: Rollout
metadata:
name: devops-backend
namespace: devops-openkruise
spec:
workloadRef:
apiVersion: apps/v1
kind: Deployment
name: devops-backend
strategy:
### 为金丝雀发布创建一个额外的工作负载, 金丝雀发布后会被删除 ###
enableExtraWorkloadForCanary: true
canary:
steps:
- traffic: 10%
replicas: 1
matches:
- headers:
- type: Exact
name: version
value: canary
requestHeaderModifier:
add:
- name: "version"
value: "canary"
- replicas: 2
traffic: 50%
requestHeaderModifier:
add:
- name: version
value: canary
- traffic: 80%
replicas: 80%
trafficRoutings:
- service: devops-backend
customNetworkRefs:
- apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
name: devops-backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant