Using kubectl to rollout openshift DeploymentConfig

7/7/2019

I'm using openshift container cluster to run my project.
In my CI I'm using helm and kubectl to upgrade and rollout the deployments.

Following this guide, I have created this simple DeploymentConfig:

apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
...

When I run helm upgrade --install I can see the new deployment in my openshift cluster.
But I want to rollout the deployment using kubectl and it fails:

helm upgrade --install --wait --namespace myapp nginx chart/
kubectl rollout status -n myapp -w "dc/nginx"

I'm getting this error error: no king "DeploymentConfig" is registered for version "apps.openshift.io/v1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

Running kubectl api-versions does display "apps.openshift.io/v1" though.

Why can't I rollout the deployment using kubectl?

-- natdev
kubernetes
kubernetes-helm
openshift

1 Answer

8/22/2019

Kubernetes' command line interface (CLI), kubectl, is used to run commands against Kubernetes cluster, while DeploymentConfigsis specific to OpenShift distributions, and not available in standard Kubernetes.

Though, as long as oc is built on top of kubectl, converting a kubectl binary to oc is as simple as changing the binary’s name from kubectl to oc.

See more information for using kubectl and oc

-- A_Suh
Source: StackOverflow