Hi @beirtipol,
Are you able to process the output.json that I attached earlier?
Just confirming that file is coming from running a command like kubectl apply -f raw-k8s.yml -o json
ran from outside of Octopus? This seems fine to me and is valid JSON, however it isn’t indicating a success like I’m seeing on my end with the additional line "availableReplicas": 1,
I’m wondering if there’s something in the response from our K8s cluster which Octopus doesn’t like. Perhaps the JSON embedded in the JSON?
I thought something like this could be going on too, however all my testing and attempts to break it are either working fine or giving more informative errors.
Looking at the code, the error is being thrown due to the output from the kubectl apply -f <file>.yml -o json
command not being able to be successfully parsed by ConvertFrom-Json
, however when I use the JSON supplied with the error message, it’s able to parse it ok.
A teammate managed to find a previous forum post with what looks like it could be a very similar issue: Failure deplying Kubernetes CronJob Yaml
The resolution there was found by using the Run a Kubectl Script step from inside Octopus to deploy the YAML, which ended up revealing what the actual error was. This issue with the error not being shown should have been fixed in v2019 however, but I definitely think it would be worth trying it to see if another error is shown.
Let me know how you get on or if you have any questions!
Best Regards,