<p>I try to deploy a spring api-gateway app to GKE using jenkins and helm chart</p>
<p>for RoleBinding I have this manifest</p>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
  name: api-gateway-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: api-gateway-cr
rules:
  - apiGroups: [&quot;&quot;]
    resources: [ &quot;services&quot;, &quot;pods&quot;, &quot;configmaps&quot;, &quot;endpoints&quot; ]
    verbs: [ &quot;get&quot;, &quot;watch&quot;, &quot;list&quot; ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: api-gateway-rb
  namespace: default
roleRef:
  kind: ClusterRole
  name: api-gateway-cr
  apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
  name: api-gateway-sa
</code></pre>
<p>and have this command</p>
<p><code>helm upgrade --install -f helm-values/values.stag.common.yaml -f helm-values/values.stag.secret.yaml -f helm-values/values.stag.yaml stag-api-gateway helm-api-gateway || build_error=true</code></p>
<p>But I keep getting error this</p>
<p><code>Error: UPGRADE FAILED: current release manifest contains removed kubernetes api(s) for this kubernetes version and it is therefore unable to build the kubernetes objects for performing the diff. error from kubernetes: unable to recognize &quot;&quot;: no matches for kind &quot;RoleBinding&quot; in version &quot;rbac.authorization.k8s.io/v1beta1&quot;</code></p>
<p>What I had done:</p>
<ul>
<li>Update kubernetes version in jenkins-slave node to 1.20</li>
<li>make sure that all manifest using rbac.authorization.k8s.io/v1</li>
</ul>
<p>What can I do next?</p>

Bonifasius Anggara
<ol>
<li><p>Run the command <code>kubectl version</code> to check the version of Kubernetes you're using. Make sure that you are using the latest kubernetes and <a href="https://github.com/DNXLabs/terraform-aws-eks-cloudwatch-logs/issues/7#issuecomment-1143525388" rel="nofollow noreferrer">Helm version</a>  to support <code>rbac.authorization.k8s.io/v1</code>.</p>
</li>
<li><p>Examine the <code>apiVersion</code> field in your manifest to confirm it supports RoleBinding and it corresponds to the version supported by your Kubernetes cluster.</p>
</li>
<li><p>The API version is different in the error and the manifest file,  Check whether you used the below command after updating the version in the manifest file.</p>
</li>
</ol>
<blockquote>
<p><code>Kubectl apply -f &lt;file name&gt;</code></p>
</blockquote>
<p>Refer to the following official docs <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">RBAC Authorization</a>, <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/#rbac-resources-v122" rel="nofollow noreferrer">Deprecated API Migration Guide</a> for more information</p>
