0
votes

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?

1
Hi, Deployment and DeploymentConfig (OpenShift specific ) are two different resources,Kubectl client is not aware of dc - Suresh Vishnoi
If you want to use deployment then you just need to switch to deploy kubectl rollout status -n myapp -w "deployment/nginx" - Suresh Vishnoi
or if you have deployed using helm then you can use oc client oc rollout status -n myapp -w "dc/nginx” - Suresh Vishnoi
Why don't you use "helm rollback <release-name>" ? - cecunami
@cecunami btw, helm rollback doesn't suppose as the same as kubectl/oc rollout. - Shudipta Sharma

1 Answers

1
votes

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