IBM Cloud Kubernetes Apply RBAC And Get Kubeconfig API
The ApplyRBACAndGetKubeconfig API from IBM Cloud Kubernetes — 1 operation(s) for applyrbacandgetkubeconfig.
The ApplyRBACAndGetKubeconfig API from IBM Cloud Kubernetes — 1 operation(s) for applyrbacandgetkubeconfig.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ibm-cloud-kubernetes:ibm-cloud-kubernetes-applyrbacandgetkubeconfig-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ibm Cloud Kubernetes Apply RBAC And Get Kubeconfig API
version: '1.1'
description: 'Operations tagged ApplyRBACAndGetKubeconfig across 2 of this provider''s published API definitions: ibm-cloud-kubernetes-swagger.json, ibm-cloud-kubernetes-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: /global
- url: https://containers.cloud.ibm.com/global
tags:
- name: ApplyRBACAndGetKubeconfig
paths:
/v2/applyRBACAndGetKubeconfig:
post:
description: Apply IAM roles corresponding to your access to the cluster as RoleBindings and ClusterRoleBindings as described in http://ibm.biz/rbac-access, then retrieve the cluster's kubeconfig file to connect to your cluster and run Kubernetes API calls. For example, if you have the IAM Viewer role, you will be granted the `ibm-view` role in the cluster and your kubeconfig will allow 'view' Kubernetes API calls. The roles are applied asynchronously. Use `/v2/getRBACStatus` to verify when they have finished applying.
tags:
- ApplyRBACAndGetKubeconfig
summary: Start applying IAM roles corresponding to your access to the cluster, then…
operationId: ApplyRBACAndGetKubeconfig
parameters:
- description: Your IBM Cloud Identity and Access Management (IAM) token. To retrieve your IAM token, run `ibmcloud iam oauth-tokens`.
name: Authorization
in: header
required: true
schema:
type: string
- description: Your IBM Cloud Identity and Access Management (IAM) refresh token. To retrieve your IAM refresh token, run `cat ~/.bluemix/config.json`. To use the `POST https://iam.cloud.ibm.com/identity/token` API to create a token, see https://ibm.biz/iks-tokens for the required request headers.
name: X-Auth-Refresh-Token
in: header
schema:
type: string
- description: The ID of the resource group that the cluster is in. To check the resource group ID of the cluster, use the `GET /v2/getCluster` API.
name: X-Auth-Resource-Group
in: header
schema:
type: string
responses:
'200':
description: Ok. Returns the cluster's kubeconfig file.
headers:
X-Request-Id:
description: Unique ID for this request
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ClientKubeConfig'
application/zip:
schema:
$ref: '#/components/schemas/ClientKubeConfig'
text/yaml:
schema:
$ref: '#/components/schemas/ClientKubeConfig'
'400':
description: Bad request. The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request in JSON format.
headers:
X-Request-Id:
description: Unique ID for this request
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/zip:
schema:
$ref: '#/components/schemas/ErrorResponse'
text/yaml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized. The IAM token is invalid or expired. To retrieve your IAM token, run `ibmcloud login` and then `ibmcloud iam oauth-tokens`.
headers:
X-Request-Id:
description: Unique ID for this request
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/zip:
schema:
$ref: '#/components/schemas/ErrorResponse'
text/yaml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found. The specified cluster could not be found. To list the clusters that you have access to, use the `GET /v2/getClusters` API or run `ibmcloud ks cluster ls`.
headers:
X-Request-Id:
description: Unique ID for this request
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/zip:
schema:
$ref: '#/components/schemas/ErrorResponse'
text/yaml:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal Server Error. IBM Cloud Kubernetes Service is currently unavailable. Your request could not be processed. Please wait a few minutes and try again. If you still encounter this problem, note the incident ID and contact IBM Cloud support.
headers:
X-Request-Id:
description: Unique ID for this request
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
application/zip:
schema:
$ref: '#/components/schemas/ErrorResponse'
text/yaml:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ibm-events:
description: IAM roles are applied to the cluster, and the Kubernetes configuration file for the cluster is requested. Depending on the request, the kubeconfig might contain administrator or network certificates and secrets to access the cluster.
events:
- name: containers-kubernetes.cluster.config
x-ibm-permissions:
actions:
- name: containers-kubernetes.cluster.read
description: To get the action, the user must have the Viewer platform role to Kubernetes Service in IAM.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Kubeconfig'
description: Options to retrieve a kubeconfig file. Default format is 'json', other options include 'yaml' and 'zip'. To retrieve the Calico network config, pass admin:true and format:"zip" in the body.
required: true
servers:
- url: /global
components:
schemas:
ErrorResponse:
description: ErrorResponse error response to end users
type: object
properties:
code:
type: string
x-go-name: ID
description:
type: string
x-go-name: Err
incidentID:
type: string
x-go-name: ReqID
recoveryCLI:
type: string
x-go-name: RecoveryCLI
terseDescription:
type: string
x-go-name: TerseErr
type:
$ref: '#/components/schemas/ErrorType'
x-go-package: github.ibm.com/alchemy-containers/armada-model/errors
ErrorType:
description: ErrorType error type
type: string
x-go-package: github.ibm.com/alchemy-containers/armada-model/errors
ClientKubeConfig:
description: ClientKubeConfig is the kubernetes config file used by kubectl
type: object
properties:
apiVersion:
description: Legacy field from pkg/api/types.go TypeMeta.
type: string
x-go-name: APIVersion
clusters:
description: Clusters is a map of referencable names to cluster configs
type: array
items:
type: object
properties:
cluster:
description: Cluster holds the cluster information
type: object
properties:
certificate-authority:
description: CertificateAuthority is the path to a cert file for the certificate authority.
type: string
x-go-name: CertificateAuthority
certificate-authority-data:
description: CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
type: string
x-go-name: CertificateAuthorityData
disable-compression:
description: 'DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful
to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on
compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296.'
type: boolean
x-go-name: DisableCompression
insecure-skip-tls-verify:
description: InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
type: boolean
x-go-name: InsecureSkipTLSVerify
proxy-url:
description: 'ProxyURL is the URL to the proxy to be used for all requests made by this
client. URLs with "http", "https", and "socks5" schemes are supported. If
this configuration is not provided or the empty string, the client
attempts to construct a proxy configuration from http_proxy and
https_proxy environment variables. If these environment variables are not
set, the client does not attempt to proxy requests.
socks5 proxying does not currently support spdy streaming endpoints (exec,
attach, port forward).'
type: string
x-go-name: ProxyURL
server:
description: Server is the address of the kubernetes cluster (https://hostname:port).
type: string
x-go-name: Server
tls-server-name:
description: TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used.
type: string
x-go-name: TLSServerName
x-go-name: Cluster
name:
description: Name is the nickname for this Cluster
type: string
x-go-name: Name
x-go-name: Clusters
contexts:
description: Contexts is a map of referencable names to context configs
type: array
items:
type: object
properties:
context:
description: Context holds the context information
type: object
properties:
cluster:
description: Cluster is the name of the cluster for this context
type: string
x-go-name: Cluster
namespace:
description: Namespace is the default namespace to use on unspecified requests
type: string
x-go-name: Namespace
user:
description: AuthInfo is the name of the authInfo for this context
type: string
x-go-name: AuthInfo
x-go-name: Context
name:
description: Name is the nickname for this Context
type: string
x-go-name: Name
x-go-name: Contexts
current-context:
description: CurrentContext is the name of the context that you would like to use by default
type: string
x-go-name: CurrentContext
kind:
description: Legacy field from pkg/api/types.go TypeMeta.
type: string
x-go-name: Kind
preferences:
description: Preferences holds general information to be use for cli interactions
type: object
properties:
colors:
type: boolean
x-go-name: Colors
x-go-name: Preferences
users:
description: AuthInfos is a map of referencable names to user configs
type: array
items:
type: object
properties:
name:
description: Name is the nickname for this AuthInfo
type: string
x-go-name: Name
user:
description: AuthInfo holds the auth information
type: object
properties:
as:
description: Impersonate is the username to impersonate. The name matches the flag.
type: string
x-go-name: Impersonate
as-groups:
description: ImpersonateGroups is the groups to impersonate.
type: array
items:
type: string
x-go-name: ImpersonateGroups
as-uid:
description: ImpersonateUID is the uid to impersonate.
type: string
x-go-name: ImpersonateUID
as-user-extra:
description: ImpersonateUserExtra contains additional information for impersonated user.
type: object
additionalProperties:
type: array
items:
type: string
x-go-name: ImpersonateUserExtra
auth-provider:
description: AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
type: object
properties:
config:
type: object
additionalProperties:
type: string
x-go-name: Config
name:
type: string
x-go-name: Name
x-go-name: AuthProvider
client-certificate:
description: ClientCertificate is the path to a client cert file for TLS.
type: string
x-go-name: ClientCertificate
client-certificate-data:
description: ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate
type: string
x-go-name: ClientCertificateData
client-key:
description: ClientKey is the path to a client key file for TLS.
type: string
x-go-name: ClientKey
client-key-data:
description: ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey
type: string
x-go-name: ClientKeyData
exec:
description: Exec specifies a custom exec-based authentication plugin for the kubernetes cluster.
type: object
properties:
apiVersion:
description: 'Preferred input version of the ExecInfo. The returned ExecCredentials MUST use
the same encoding version as the input.'
type: string
x-go-name: APIVersion
args:
description: Arguments to pass to the command when executing it.
type: array
items:
type: string
x-go-name: Args
command:
description: Command to execute.
type: string
x-go-name: Command
env:
description: 'Env defines additional environment variables to expose to the process. These
are unioned with the host''s environment, as well as variables client-go uses
to pass argument to the plugin.'
type: array
items:
type: object
properties:
name:
type: string
x-go-name: Name
value:
type: string
x-go-name: Value
x-go-name: Env
installHint:
description: 'This text is shown to the user when the executable doesn''t seem to be
present. For example, `brew install foo-cli` might be a good InstallHint for
foo-cli on Mac OS systems.'
type: string
x-go-name: InstallHint
interactiveMode:
description: 'InteractiveMode determines this plugin''s relationship with standard input. Valid
values are "Never" (this exec plugin never uses standard input), "IfAvailable" (this
exec plugin wants to use standard input if it is available), or "Always" (this exec
plugin requires standard input to function). See ExecInteractiveMode values for more
details.
If APIVersion is client.authentication.k8s.io/v1alpha1 or
client.authentication.k8s.io/v1beta1, then this field is optional and defaults
to "IfAvailable" when unset. Otherwise, this field is required.
+optional'
type: string
x-go-name: InteractiveMode
provideClusterInfo:
description: 'ProvideClusterInfo determines whether or not to provide cluster information,
which could potentially contain very large CA data, to this exec plugin as a
part of the KUBERNETES_EXEC_INFO environment variable. By default, it is set
to false. Package k8s.io/client-go/tools/auth/exec provides helper methods for
reading this environment variable.'
type: boolean
x-go-name: ProvideClusterInfo
x-go-name: Exec
password:
description: Password is the password for basic authentication to the kubernetes cluster.
type: string
x-go-name: Password
token:
description: Token is the bearer token for authentication to the kubernetes cluster.
type: string
x-go-name: Token
tokenFile:
description: TokenFile is a pointer to a file that contains a bearer token (as described above). If both Token and TokenFile are present, Token takes precedence.
type: string
x-go-name: TokenFile
username:
description: Username is the username for basic authentication to the kubernetes cluster.
type: string
x-go-name: Username
x-go-name: AuthInfo
x-go-name: AuthInfos
x-go-package: github.ibm.com/alchemy-containers/armada-api-model/json/v2/responses
Kubeconfig:
type: object
title: Kubeconfig contains the fields necessary to request a kubeconfig file.
properties:
admin:
description: AdminUser Retrieve the admin kubeconfig file.
type: boolean
x-go-name: AdminUser
cluster:
description: The name or ID of the cluster that you want to get the worker node details from. To list the clusters that you have access to, use the `GET /v2/getClusters` API or run `ibmcloud ks cluster ls`.
type: string
x-go-name: Cluster
endpointType:
description: EndpointType The type of endpoint server URL to return in the kubeconfig. Supported values are 'default', 'private', 'vpe', 'link', 'vpc'. The 'default' endpoint returns the public endpoint when available, and the private endpoint otherwise. Default is 'default'.
type: string
x-go-name: EndpointType
format:
description: Format Default format is json. Other options include yaml, and zip.
type: string
x-go-name: Format
network:
description: NetworkConfig Retrieve the Calico network config. Requires admin=true and format=zip.
type: boolean
x-go-name: NetworkConfig
x-go-package: github.ibm.com/alchemy-containers/armada-api-model/json/v2/requests
x-refined-from:
- ibm-cloud-kubernetes-swagger.json
- ibm-cloud-kubernetes-openapi.yml