When deploying to a k8s target, each step reports an error of namespace already exists. Why is Octopus deploy trying to create this namespace? The instructions for setting up a k8s deployment target instruct you to create a namespace and a service account for said namespace.
This is only an annoyance for steps that are designed for k8s and custom steps that are based on running a k8s cli script, but any other script fails because of the error.
I suspect the issue here will be that the account assigned to the Kubernetes target does not have permissions to get the namespace (i.e. to run the kubectl get <namespace> command). If the namespace can not be found an attempt is made to create it, which is why you are seeing the error namespace "<namespace>" already exists.
The kubernetes cluster we are running locally, while we’re creating our new proof of concept environment, isn’t exactly the newest version. The server is running kubectl v1.6, but the version I installed on the Octopus server is 1.12.
Calling kubectl get namespace on a server running 1.6 using a client of 1.12 gives a NotAcceptable error, understandably.
Downgrading kubectl on the Octopus server caused a different issue, but I now know that our cluster/kubectl setup is probably causing this warning.