I have a kubernetes cluster, and I basically have an authenticated api for deploying tasks within the cluster without having kubectl etc set-up locally. I'm aware of the client libraries etc for the Kubernetes api, however they don't seem to support all of the different primatives etc (including some custom ones like Argo). So I just wondered if there was a way I could effectively run $ kubectl apply -f ./file.yml
within a container on the cluster?
Obviously I can create a container with kubectl installed, but I just wondered how that could then 'connect' to the Kubernetes controller?
I found that the roffe/kubectl image works well for running a kubectl apply -f to deploy to my cluster. However, you do need to use a ClusterRole and ClusterRoleBinding "attached" to your ServiceAccount, (and the serviceAccount named in your kubectl container), to deploy to any other namespaces.
Yes, it is possible. refer halyard container. spinnaker is deployed from halyard container.
You can choose from existing ones: https://hub.docker.com/search?q=kubectl&type=image