XcellDev|Kubernetes API

Drive your clusters in Mumbai through the Kubernetes API — kubectl, client libraries and GitOps.

Free with XcellCloud. Least-privilege access, built in.

kubeconfig from the console
kubectl, client-go, Python
RBAC & ServiceAccounts
OIDC sign-in · short tokens
LBs & volumes via OpenStack
Clusters run in Mumbai
✦Ask AI About K8s API from XcellHost
Powered by
Kubernetes
Free with XcellCloud · API access
kubectlDev laptop · OIDC
CI pipelineSA token
GitOps agentArgo CD
HelmReleases
k8s-mumbai-1LIVE
K8S API · :6443 · Apply manifest
0 / 0PODS READY
web:1.3IMAGE · ROLLOUT
0API REQUESTS / S
— msAPI LATENCY · SAMPLE
CPU0%
ROLLOUT—
LIVE API SERVER ACTIVITYRBAC ON · SAMPLE
    ISO 27001 & 20000-1 certifiedMicrosoft Gold Partner10,000+ customersSince 199999.95% uptime SLA24×7 NOC + SOC
    Overview

    Everything in Kubernetes is an API call. kubectl apply, a Helm release, a GitOps sync and a CI deploy all send HTTPS requests to one component — the kube-apiserver — which authenticates you, checks RBAC, runs admission and stores the result. This guide shows how to reach that API on XcellHost Kubernetes clusters (managed by XcellHost or self-built on XcellCloud VMs) in our Mumbai region: getting a kubeconfig, the kubectl commands you'll use daily, how each one maps to a REST path, least-privilege RBAC, client libraries, and how clusters use OpenStack for load balancers and volumes. API access is free with XcellCloud; you pay for the nodes and resources you run. Your exact API server address is shown in the XcellCloud console → API Access.

    One API for every cluster action

    Deploy, scale, inspect and secure — from kubectl, code or pipelines, against clusters in Mumbai.

    kubectl, Code & GitOps — Same API
    Clusters in mumbai-1Free with XcellCloud
    Works with kubectl Helm Argo CD · Flux client-go Python client Terraform CI pipelines
    0
    API server per clusterkubectl, Helm, GitOps agents and controllers all talk to it over HTTPS.
    0
    Gates per requestAuthentication → authorisation (RBAC) → admission → storage in etcd.
    0
    RBAC verbs to knowget, list, watch, create, update, patch, delete.
    0
    Typical token lifetime*Short-lived ServiceAccount tokens from kubectl create token.

    * Typical default; the API server can set a different maximum. "XcellHost Kubernetes clusters" covers clusters XcellHost manages for you and clusters you build yourself on XcellCloud VMs — features such as the OpenStack integrations depend on how the cluster is set up.

    Included with every XcellCloud account

    What you get with XcellCloud

    No separate fee for API access — the access patterns, endpoints and defaults you'll plan around. Switch tabs to compare.

    API server address, OIDC issuer and defaults are placeholders for planning. Your exact values are shown in the XcellCloud console → API Access. Nodes, volumes and load balancers are billed per your XcellCloud plan.

    Quickstart

    From kubeconfig to first deploy — in five minutes.

    Download the kubeconfig for your cluster from the console, point kubectl at it, and you're talking to the API. The same file works for client libraries.

    # 1. download the kubeconfig: console → Kubernetes → your cluster → kubeconfig
    mkdir -p ~/.kube && mv ~/Downloads/xcellhost-mumbai-1.yaml ~/.kube/
    chmod 600 ~/.kube/xcellhost-mumbai-1.yaml          # it holds credentials
    
    # 2. point kubectl at it (or merge into ~/.kube/config)
    export KUBECONFIG=~/.kube/xcellhost-mumbai-1.yaml
    kubectl config get-contexts
    kubectl config use-context xcellhost-mumbai-1
    
    # 3. check you can reach the API server
    kubectl cluster-info
    kubectl get nodes -o wide
    kubectl auth can-i --list -n shop
    kubectl get pods -n shop                            # list
    kubectl apply -f web.yaml                           # create or update
    kubectl describe pod -n shop -l app=web             # details + events
    kubectl logs -n shop deploy/web --tail=100 -f       # stream logs
    kubectl exec -n shop -it deploy/web -- sh           # shell in a container
    kubectl port-forward -n shop svc/web 8080:80        # local tunnel
    kubectl rollout status -n shop deploy/web           # watch a rollout
    kubectl rollout undo -n shop deploy/web             # roll back
    kubectl get pods -n shop -v=6                       # print the REST calls
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: web
      namespace: shop
      labels:
        app: web
    spec:
      replicas: 3
      selector:
        matchLabels:
          app: web
      template:
        metadata:
          labels:
            app: web
        spec:
          containers:
          - name: web
            image: registry.xcellhost.cloud/shop/web:1.3
            ports:
            - containerPort: 8080
            resources:
              requests:
                cpu: 100m
                memory: 128Mi
              limits:
                memory: 256Mi
            readinessProbe:
              httpGet:
                path: /healthz
                port: 8080
    APISERVER=https://k8s.mumbai.xcellhost.cloud:6443
    
    # cluster CA from your kubeconfig, and a 1-hour token for a ServiceAccount
    kubectl config view --raw --minify \
      -o jsonpath='{.clusters[0].cluster.certificate-authority-data}' | base64 -d > ca.crt
    TOKEN=$(kubectl create token ci-deployer -n shop --duration=1h)
    
    curl --cacert ca.crt -H "Authorization: Bearer $TOKEN" \
      "$APISERVER/apis/apps/v1/namespaces/shop/deployments?limit=50"
    
    # or let kubectl handle auth and just send the path
    kubectl get --raw "/api/v1/namespaces/shop/pods?limit=50" | jq -r '.items[].metadata.name'
    # pip install kubernetes
    from kubernetes import client, config
    
    config.load_kube_config(context="xcellhost-mumbai-1")  # in a pod: load_incluster_config()
    apps = client.AppsV1Api()
    
    for d in apps.list_namespaced_deployment("shop").items:
        print(d.metadata.name, d.status.ready_replicas, "/", d.spec.replicas)
    
    # scale through the /scale subresource
    apps.patch_namespaced_deployment_scale(
        name="web", namespace="shop", body={"spec": {"replicas": 5}}
    )
    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"os"
    	"path/filepath"
    
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    	"k8s.io/client-go/kubernetes"
    	"k8s.io/client-go/tools/clientcmd"
    )
    
    func main() {
    	home, _ := os.UserHomeDir()
    	kubeconfig := filepath.Join(home, ".kube", "xcellhost-mumbai-1.yaml")
    	cfg, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
    	if err != nil {
    		log.Fatal(err)
    	}
    	cs, err := kubernetes.NewForConfig(cfg)
    	if err != nil {
    		log.Fatal(err)
    	}
    	pods, err := cs.CoreV1().Pods("shop").List(context.Background(),
    		metav1.ListOptions{LabelSelector: "app=web"})
    	if err != nil {
    		log.Fatal(err)
    	}
    	for _, p := range pods.Items {
    		fmt.Println(p.Name, p.Status.Phase)
    	}
    }
    API server and registry are placeholders — your values are in the console → API Access.

    What a kubeconfig holds

    A cluster (API server URL + CA certificate), a user (token, client certificate or an OIDC login command) and a context that pairs them with a default namespace. kubectl reads $KUBECONFIG or ~/.kube/config.

    • Treat it like a password — chmod 600, never commit it
    • People sign in with OIDC; pipelines use ServiceAccount tokens
    • Prefer short-lived tokens (--duration=1h) over long-lived secrets
    • Check what you can do with kubectl auth can-i --list

    Add -v=6 to any kubectl command to see the exact REST requests it sends — the translator below explains them.

    Kubernetes API concepts you'll use daily

    Resources & verbs

    Pods, Deployments, Services and more, each a REST resource you get, list, watch, create, patch or delete.

    API groups & versions

    Core objects live under /api/v1; the rest under /apis/<group>/<version> — e.g. apps/v1.

    Namespaces

    Folders for resources and the natural boundary for RBAC, quotas and network policies — one per team or app.

    RBAC

    Roles list allowed verbs on resources; RoleBindings grant them to users, groups or ServiceAccounts.

    ServiceAccounts

    Identities for workloads and pipelines, with short-lived, audience-bound tokens instead of shared passwords.

    Watch

    ?watch=true streams changes as they happen — how controllers, Argo CD and kubectl get -w stay current.

    Server-side apply

    The API server merges your YAML and tracks which tool owns each field — fewer conflicts between kubectl, Helm and GitOps.

    CRDs & operators

    Custom resources extend the API — cert-manager, Argo CD and database operators all add their own kinds.

    Why to choose XcellHost for Kubernetes

    Clusters in India

    Control plane, nodes, volumes and load balancers in our Mumbai region — straightforward DPDP Act answers.

    API access is free

    kubeconfig, API endpoint and every Kubernetes API call come with XcellCloud. You pay for what you run.

    Upstream Kubernetes API

    Standard API, standard tools. Your manifests, Helm charts and operators move with you.

    24×7 engineers in Mumbai

    Help from XcellHost's NOC when a rollout stalls, a node goes NotReady or RBAC blocks a deploy.

    OpenStack underneath

    Load balancers and block volumes from XcellCloud's OpenStack services, wired in through standard integrations.

    Security by default

    RBAC on, OIDC sign-in, short-lived tokens, network policies and audit logging — we help you set them up.

    INR billing with GST

    Nodes, storage, load balancers and support on one rupee invoice with input credit.

    Since 1999 · ISO certified

    ISO 27001 & 20000-1 certified operations and a Microsoft Gold Partner.

    Shared Admin kubeconfig VS Least-Privilege API Access

    The difference between "everyone has cluster-admin" and access you can audit, rotate and explain to an auditor.

    • ✕One admin kubeconfig passed around on chat
    • ✕Long-lived tokens that never expire
    • ✕CI pipeline with cluster-admin
    • ✕Anyone can read every Secret
    • ✕Pods can reach every other pod
    • ✕kubectl edit in production at midnight
    • ✕No record of who changed what
    • ✕Leaver still has a working kubeconfig
    • ✓Personal OIDC sign-in with MFA
    • ✓Tokens that expire in an hour
    • ✓CI ServiceAccount limited to one namespace
    • ✓Secrets readable only by the apps that need them
    • ✓Default-deny network policies
    • ✓Changes through Git and reviewed pull requests
    • ✓API audit log of every request
    • ✓Remove the user in the identity provider — access ends

    Start Using The Kubernetes API In 5 Easy Steps

    From cluster to automated deploys — the same order our engineers follow.

    01Get a clusterManaged or on XcellCloud VMs
    02Download the kubeconfigConsole → API Access
    03Set up RBAC & OIDCRoles per namespace
    04Deploy your appkubectl apply · Helm
    05Automate with GitOpsArgo CD · CI tokens

    Tools That Speak the Kubernetes API

    kubectlHelmArgo CDFluxgoclient-gopyPython clientKustomizetfTerraformk9sLensPrometheusGitHub ActionsGitLab CI

    Any tool that reads a kubeconfig works against XcellHost clusters. Product names belong to their owners.

    Included with XcellCloud Kubernetes API
    HTTPS API server in Mumbai
    kubeconfig from the console
    RBAC & ServiceAccounts
    OIDC sign-in support
    LBs & volumes via OpenStack
    XcellHost support 24×7
    Tool · kubeconfig builder & explainer

    Build a kubeconfig — and see how its three parts connect.

    Fill in the cluster, user and namespace. The builder writes a valid kubeconfig with placeholders for every secret and draws its anatomy: clusters, users, and the context that ties them together. Hover a box to find its lines. Nothing you type leaves this page.

    How this user signs in OIDC

    Tool · kubectl → REST translator

    Every kubectl command is an HTTP request — see which one.

    Pick a command. The translator shows the request kubectl sends to the API server, the RBAC permission it needs, an equivalent curl call and a sample response, while a request travels through the API server's gates.

    /apis/apps/v1/namespaces/shop/deployments/web/scale
    group/api for core, /apis/<group> otherwise
    versionv1, v2, v1beta1…
    namespaceomitted for cluster-scoped kinds
    resourceplural, lowercase
    nameone object; omit to list
    subresourcestatus, scale, log, exec…
    TLSAuthenticationAuthorization · RBACAdmissionetcdResponse
    Group / versionBase pathCommon resourcesScope
    core · v1/api/v1pods services configmaps secrets persistentvolumeclaims serviceaccounts eventsNamespaced (plus nodes, namespaces, persistentvolumes cluster-wide)
    apps · v1/apis/apps/v1deployments statefulsets daemonsets replicasetsNamespaced
    batch · v1/apis/batch/v1jobs cronjobsNamespaced
    networking.k8s.io · v1/apis/networking.k8s.io/v1ingresses networkpoliciesNamespaced
    rbac.authorization.k8s.io · v1/apis/rbac.authorization.k8s.io/v1roles rolebindings clusterroles clusterrolebindingsBoth
    autoscaling · v2/apis/autoscaling/v2horizontalpodautoscalersNamespaced
    storage.k8s.io · v1/apis/storage.k8s.io/v1storageclasses csidrivers volumeattachmentsCluster-wide

    Run kubectl api-resources -o wide on your cluster for the full, current list with verbs and short names.

    Tool · RBAC builder

    Tick the permissions — get a least-privilege Role in YAML.

    Choose a namespace and a ServiceAccount, then switch on verbs per resource in the matrix (click a header to toggle a whole row or column). The builder writes the ServiceAccount, Role and RoleBinding, flags risky grants and lists the kubectl auth can-i checks to run.

    Start from a preset
    0rules
    0permissions
    Lowrisk
    Integrations

    Load balancers, volumes, policies, Helm and GitOps — the YAML you'll need.

    On OpenStack-based clouds like XcellCloud, clusters typically run the OpenStack cloud-controller-manager (load balancers through Octavia) and the Cinder CSI driver (block volumes). Confirm which integrations are enabled on your cluster.

    Service type: LoadBalancer→cloud-controller-manager→Octavia LB + public IP

    Create a Service of type LoadBalancer and the OpenStack cloud-controller-manager asks Octavia for a load balancer; the external IP appears in kubectl get svc. Annotations tune it — typical OpenStack integration; confirm on your cluster.

    apiVersion: v1
    kind: Service
    metadata:
      name: web
      namespace: shop
      annotations:
        # keep the floating IP if the Service is deleted (OpenStack CCM)
        loadbalancer.openstack.org/keep-floatingip: "true"
        # internal-only load balancer instead of a public IP:
        # service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
    spec:
      type: LoadBalancer
      selector:
        app: web
      ports:
      - name: http
        port: 80
        targetPort: 8080
    kubectl apply -f service.yaml
    kubectl get svc web -n shop -w          # EXTERNAL-IP goes from <pending> to an address
    kubectl describe svc web -n shop        # events from the cloud-controller-manager
    PersistentVolumeClaim→cinder.csi.openstack.org→Cinder volume, attached to the node

    A StorageClass with the Cinder CSI provisioner turns every claim into a block volume in XcellCloud. WaitForFirstConsumer creates the volume in the same zone as the pod. The volume type name below is a placeholder.

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: cinder-ssd
    provisioner: cinder.csi.openstack.org
    parameters:
      type: ssd                       # Cinder volume type — placeholder
    allowVolumeExpansion: true
    reclaimPolicy: Delete
    volumeBindingMode: WaitForFirstConsumer
    ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: postgres-data
      namespace: shop
    spec:
      accessModes: ["ReadWriteOnce"]
      storageClassName: cinder-ssd
      resources:
        requests:
          storage: 50Gi
    deny all ingress→allow ingress controller → web:8080

    Start each namespace with a default-deny policy, then allow only the traffic each app needs. Network policies need a CNI that enforces them (for example Calico or Cilium) — confirm on your cluster.

    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
      name: default-deny-ingress
      namespace: shop
    spec:
      podSelector: {}
      policyTypes: ["Ingress"]
    ---
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
      name: allow-web-from-ingress
      namespace: shop
    spec:
      podSelector:
        matchLabels:
          app: web
      policyTypes: ["Ingress"]
      ingress:
      - from:
        - namespaceSelector:
            matchLabels:
              kubernetes.io/metadata.name: ingress
        ports:
        - protocol: TCP
          port: 8080
    chart + values→Kubernetes API→release history

    Helm renders a chart into manifests and applies them through the same API, keeping a history so you can roll back. Pin chart versions and keep per-environment values in Git.

    helm upgrade --install web ./charts/web \
      --namespace shop --create-namespace \
      --values values-mumbai.yaml \
      --set image.tag=1.4 \
      --wait --timeout 5m
    
    helm list -n shop
    helm history web -n shop
    helm rollback web 3 -n shop          # back to revision 3
    Git repo→Argo CD (in-cluster)→Kubernetes API

    With GitOps, an agent inside the cluster pulls the desired state from Git and applies it — no cluster credentials in your CI system. This Argo CD Application syncs one folder and heals drift.

    apiVersion: argoproj.io/v1alpha1
    kind: Application
    metadata:
      name: shop
      namespace: argocd
    spec:
      project: default
      source:
        repoURL: https://github.com/acme/shop-deploy.git
        targetRevision: main
        path: k8s/overlays/mumbai
      destination:
        server: https://kubernetes.default.svc
        namespace: shop
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
        - CreateNamespace=true
    Security & India

    The API server is the front door — lock it properly.

    Whoever can call the Kubernetes API can run code in your cluster. These defaults keep that list short and auditable.

    OIDC + MFA for people

    Sign in through your identity provider; removing a leaver there ends their cluster access.

    Short-lived tokens

    Use kubectl create token --duration or projected tokens, not long-lived Secret tokens.

    Least-privilege RBAC

    Namespace Roles, no wildcards, and cluster-admin kept for break-glass only.

    No kubeconfigs in Git

    Add kubeconfig files to .gitignore; give CI a scoped ServiceAccount through its secret store.

    Restrict API access

    Allow the API server only from office, VPN and CI IP ranges where the cluster supports it.

    DPDP Act 2023

    Personal data in Mumbai-region volumes, encrypted Secrets at rest, and audit logs that show who accessed what.

    If a kubeconfig or token leaks

    sa/ci-deployer · token · validexpires in 58 min
    1revoke: delete the binding or SA
    2rotate credentials & redeploy
    3review the API audit log
    • CERT-In's April 2022 directions require reporting specified cyber incidents within 6 hours and keeping ICT logs for 180 days in India — keep API audit logs accordingly.
    • Short tokens limit the damage window; deleting a RoleBinding cuts access immediately.
    • Clusters in mumbai-1 keep workloads and volumes in India.
    Token shown is a sample. Ask XcellHost's 24×7 NOC to help rotate cluster credentials.

    Frequently Asked Questions

    It is the HTTPS REST API served by kube-apiserver. Every object — pods, deployments, services, roles — is a resource you read and change through it. kubectl, Helm, GitOps agents and controllers are all API clients.

    Yes. The kubeconfig, API endpoint and API calls come free with XcellCloud. You pay for the nodes, volumes and load balancers your cluster uses, or for XcellHost's management if we run the cluster for you.

    Both patterns are covered here: XcellHost Kubernetes clusters managed by XcellHost, or clusters you build yourself on XcellCloud VMs. The API works the same; integrations such as Octavia load balancers and Cinder volumes depend on how the cluster is set up. Talk to us about the managed option.

    From the XcellCloud console → API Access (or the Kubernetes section) for your cluster. The server address on this page, https://k8s.mumbai.xcellhost.cloud:6443, is an example placeholder.

    People: OIDC through your identity provider with MFA, using a kubectl login plugin. Pipelines: a ServiceAccount with a namespace-scoped Role and short-lived tokens. Client certificates are best kept for break-glass admin access because they can't be revoked individually.

    Add -v=6 to any kubectl command to log the request URLs, or -v=8 to include headers and bodies. kubectl get --raw /api/v1/namespaces/shop/pods sends a raw request with your kubeconfig's credentials.

    A Role grants permissions inside one namespace. A ClusterRole is defined cluster-wide; bound with a RoleBinding it applies to one namespace, bound with a ClusterRoleBinding it applies everywhere. Prefer Roles and RoleBindings.

    Typically through the OpenStack cloud-controller-manager, which creates Octavia load balancers for type: LoadBalancer Services, and the Cinder CSI driver, which provisions block volumes for PersistentVolumeClaims. Confirm both are enabled on your cluster.

    Yes. Helm, Kustomize, Argo CD and Flux use the standard Kubernetes API. GitOps agents run inside the cluster and pull from Git, so your CI system doesn't need cluster credentials.

    Any official or community Kubernetes client — client-go, the Python kubernetes package, the Java and JavaScript clients and others. They read the same kubeconfig, or use in-cluster config when running in a pod.

    Clusters in the mumbai-1 region run their nodes, volumes and load balancers in XcellHost's Mumbai infrastructure. Images pulled from public registries and any external services you call are outside that boundary.

    Remove the RoleBinding or ServiceAccount (or disable the user in your identity provider), rotate any long-lived credentials, then review the API audit log. Call XcellHost's 24×7 NOC on +91 22 6711 1555 for help and assess whether CERT-In's 6-hour reporting applies.