OctopusDeploy / Issues

| Public | Bug reports and known issues for Octopus Deploy and all related tools
https://octopus.com
162 stars 20 forks source link

kubectl apply with server-side fails on Windows hosted workers in cloud #8888

Closed SeanStanway-Octopus closed 4 days ago

SeanStanway-Octopus commented 1 week ago

Severity

One cloud customer experienced, no futher reports as of yet

Version

2024.3.4152, 2024.3.4762

Latest Version

None

What happened?

When trying to use the step Configure and Apply Kubernetes Resource on cloud, while using the server-side apply feature, this will fail on Windows hosted workers with the error: error: unknown flag: --server-side --field-manager octopus --force-conflicts. If you then switch to using Ubuntu hosted workers, this will deploy fine.

Reproduction

  1. Add the "Configure and Apply Kubernetes Resource" to any cloud instance project
  2. Set the deploying worker as "Hosted Windows"
  3. Configure the main step as necessary
  4. Make sure the "server-side apply" options are ticked (which should be by default)
  5. Deploy, error should be observed

Error and Stacktrace

...

12:09:27   Verbose  |       "metadata":
12:09:27   Verbose  |       "name": "octopus-feedcred-feeds-3867"
12:09:27   Verbose  |       "labels":
12:09:27   Verbose  |       Octopus.Kubernetes.SelectionStrategyVersion: "SelectionStrategyVersion2"
12:09:27   Verbose  |       Octopus.Project.Id: "projects-5466"
12:09:27   Verbose  |       Octopus.Action.Id: "a9af4144-bdcd-4467-9da1-94ae6fda0142"
12:09:27   Verbose  |       Octopus.Deployment.Id: "deployments-88814"
12:09:27   Verbose  |       Octopus.RunbookRun.Id: ""
12:09:27   Verbose  |       Octopus.Step.Id: "fe13c0b9-028d-45b0-96ca-4a599bb406f6"
12:09:27   Verbose  |       Octopus.Environment.Id: "environments-1801"
12:09:27   Verbose  |       Octopus.Deployment.Tenant.Id: "untenanted"
12:09:27   Verbose  |       Octopus.Kubernetes.DeploymentName: "randomquotesclouddeployment"
12:09:27   Verbose  |       "type": "kubernetes.io/dockerconfigjson"
12:09:27   Error    |       error: unknown flag: --server-side --field-manager octopus --force-conflicts
12:09:27   Error    |       See 'kubectl apply --help' for usage.
12:09:27   Error    |       The Deployment was not created or updated.
12:09:27   Error    |       The service randomquotesservice was not updated.
12:09:28   Error    |       The previous Deployments were not removed.
12:09:28   Error    |       The previous config maps were not removed.
12:09:28   Error    |       The previous secrets were not removed.
12:09:28   Error    |       The previous custom resources were not removed.
12:09:28   Error    |       The deployment process failed. The resources created by this step will be passed to "kubectl describe" and logged below.
12:09:28   Info     |       The Deployment resource description: kubectl describe deployment randomquotesclouddeployment

...

More Information

Link to example internal project on cloud: Internal Operations

Attaching logs: SuccessOperationsHostedUbuntu.txt FailOperationsHostedWindows.txt

Workaround

Switch from Hosted Windows to Hosted Ubuntu workers

octoreleasebot commented 4 days ago

Release Note: Fixed an issue with Kubernetes Server-side apply running on Windows workers.

Octobob commented 3 days ago

:tada: The fix for this issue has been released in:

Release stream Release
2024.2 2024.2.9274
2024.3 2024.3.5593