> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cnap.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Import a Cluster

> Connect your existing Kubernetes infrastructure

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/cnap/images/cluster/import.png" alt="import cluster" />
</Frame>

If you already have a Kubernetes cluster from any source, you can import it into CNAP. This works with any existing cluster - whether it's self-managed, from cloud providers (EKS, GKE, AKS), or other managed Kubernetes services. This allows you to leverage your existing investment while gaining access to CNAP's product deployment and marketplace features.

Consider [creating a managed cluster](/clusters/create) instead if you don't already have a Kubernetes cluster set up. CNAP handles all the complex control plane management, so you can focus on your product rather than infrastructure operations. With imported clusters, control plane and worker operations are managed by your cloud provider or yourself, depending on your cluster type.

## When to Import vs. Create

<Tabs>
  <Tab title="Import Your Cluster">
    Choose to import your cluster if you already have Kubernetes infrastructure from EKS, GKE, AKS, or other providers, have invested in cluster setup, need specific configurations like custom networking or <Tooltip headline="Compliance Requirements" tip="CNAP makes security simple because you have full control of your worker machines running on your terms, in environments your customers need.">compliance requirements</Tooltip>, or want to maintain your existing cluster management approach.
  </Tab>

  <Tab title="Create a Managed Cluster">
    Consider creating a new managed cluster if you want CNAP to handle the control plane with zero operational overhead, are new to Kubernetes and want to avoid complexity, prefer simplicity to focus on products rather than infrastructure, or need quick setup to get running in minutes.
  </Tab>
</Tabs>

## Prerequisites

Before importing your cluster, ensure it meets these requirements:

* **Kubernetes Version**: 1.33+ (check with `kubectl version`)
* **Cluster Access**: Admin permissions, network connectivity, valid <Tooltip headline="Kubeconfig" tip="A kubeconfig file contains cluster connection information, authentication credentials, and context settings needed to access a Kubernetes cluster.">kubeconfig</Tooltip>
* **Required Permissions**: <Tooltip headline="Namespace" tip="A namespace is a Kubernetes mechanism for organizing and isolating resources within a cluster. Each product deployment gets its own namespace for security and isolation between different customer deployments.">Namespace</Tooltip> management, workload deployment, <Tooltip headline="RBAC" tip="RBAC (Role-Based Access Control) is a Kubernetes authorization mechanism that controls access to cluster resources based on user roles and permissions.">RBAC</Tooltip> operations

<AccordionGroup>
  <Accordion title="View detailed RBAC permissions">
    If you're not using admin kubeconfig, create a service account with these permissions and bind it to a ClusterRole:

    ```yaml RBAC configuration expandable theme={null}
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: cnap-sa
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: cnap-role
    rules:
      - apiGroups: ['']
        resources: ['pods', 'pods/log', 'pods/exec', 'secrets']
        verbs: ['get', 'list', 'watch', 'create', 'update', 'delete']
      - apiGroups: ['apps']
        resources: ['statefulsets', 'statefulsets/status']
        verbs: ['get', 'list', 'watch', 'create', 'update', 'delete']
      - apiGroups: ['']
        resources: ['namespaces', 'namespaces/finalize']
        verbs: ['get', 'list', 'watch', 'create', 'update', 'delete']
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: cnap-role-binding
    subjects:
      - kind: ServiceAccount
        name: cnap-sa
    roleRef:
      kind: ClusterRole
      name: cnap-role
      apiGroup: rbac.authorization.k8s.io
    ```
  </Accordion>
</AccordionGroup>

## How to Import Your Cluster

<Steps>
  <Step title="Prepare Your Kubeconfig">
    Ensure you have a valid kubeconfig file with admin access to your cluster.

    ```bash Test cluster connection theme={null}
    kubectl cluster-info
    kubectl get nodes
    ```

    ```bash Export kubeconfig theme={null}
    # If using default location
    cat ~/.kube/config

    # Or specify custom path
    cat /path/to/your/kubeconfig
    ```
  </Step>

  <Step title="Navigate to Clusters Dashboard">
    In the [clusters dashboard](https://cnap.tech/clusters), click **"Import Cluster"** and choose **"Import Existing Cluster"**.
  </Step>

  <Step title="Upload and Validate Kubeconfig">
    <Tabs>
      <Tab title="File Upload">
        Click "Upload kubeconfig file" and select your kubeconfig file.
      </Tab>

      <Tab title="Paste Content">
        Copy your kubeconfig content and paste it into the text area.
      </Tab>
    </Tabs>

    CNAP will automatically verify cluster accessibility, required permissions, Kubernetes version compatibility, and network connectivity.

    <Warning>
      If validation fails, check your kubeconfig and cluster permissions before retrying.
    </Warning>
  </Step>

  <Step title="Configure and Complete Import">
    Set up how CNAP will interact with your cluster: choose a cluster name, set the default namespace where new products will deploy, configure optional resource limits, and enable CNAP observability (recommended). Then click **"Import Cluster"** to finalize the process.

    <Success>
      Your cluster will appear in the dashboard as "Active" and ready for product deployments.
    </Success>
  </Step>
</Steps>

## What's Next?

Once your cluster is imported, you can:

<CardGroup cols={2}>
  <Card title="Package Your Software" icon="box" href="/products">
    Turn your applications into sellable products
  </Card>

  <Card title="Learn About Clusters" icon="server" href="/clusters">
    Understand how clusters work in CNAP
  </Card>

  <Card title="Launch Your Marketplace" icon="store" href="/marketplace">
    Create a storefront for your products
  </Card>

  <Card title="Learn Success Strategies" icon="money-bill-trend-up" href="/success/build-million-dollar-products">
    Discover how to build profitable cloud products
  </Card>
</CardGroup>

## Limitations of Imported Clusters

Be aware of these differences compared to managed clusters:

<AccordionGroup>
  <Accordion title="Control plane management">
    Control plane and worker operations are managed by your cloud provider or yourself, depending on your cluster type. CNAP does not manage the control plane for imported clusters.
  </Accordion>

  <Accordion title="Worker node provisioning">
    You manage worker nodes yourself or through your cloud provider. CNAP handles product deployments but not worker infrastructure management.
  </Accordion>

  <Accordion title="Automatic updates">
    You must handle Kubernetes version updates and cluster maintenance yourself. CNAP does not automatically update imported clusters.
  </Accordion>

  <Accordion title="24/7 monitoring">
    Limited monitoring compared to managed clusters. CNAP provides application-layer monitoring, but infrastructure monitoring is your responsibility.
  </Accordion>

  <Accordion title="Auto-scaling">
    Not supported through CNAP. You must configure and manage auto-scaling through your cloud provider or cluster management tools.
  </Accordion>

  <Accordion title="Support level">
    Application layer support only. CNAP helps with product deployments and troubleshooting, but full infrastructure support is not included.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Kubeconfig validation fails">
    * Verify cluster is accessible from the internet
    * Check that kubeconfig has admin permissions
    * Ensure Kubernetes version is 1.33 or newer
    * Test connection locally:

    ```bash Test connection theme={null}
    kubectl cluster-info
    ```

    ```text Expected output theme={null}
    Kubernetes control plane is running at https://xxx.xxx.xxx.xxx:6443
    CoreDNS is running at https://xxx.xxx.xxx.xxx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
    ```
  </Accordion>

  <Accordion title="Network connectivity issues">
    * Verify cluster API server is publicly accessible
    * Check firewall rules allow CNAP IP ranges
    * Ensure DNS resolution works for your cluster
    * Test from external network:

    ```bash Test API server access theme={null}
    curl -k https://your-cluster-api:6443
    ```
  </Accordion>

  <Accordion title="Permission errors during import">
    * Confirm kubeconfig has cluster-admin role
    * Check RBAC is properly configured
    * Verify service account has necessary permissions
    * Test permissions:

    ```bash Test permissions theme={null}
    kubectl auth can-i "*" "*" --all-namespaces
    ```
  </Accordion>

  <Accordion title="Products failing to deploy">
    * Check cluster has adequate resources
    * Verify default namespace exists and is accessible
    * Review cluster events:

    ```bash Review events theme={null}
    kubectl get events --sort-by=.metadata.creationTimestamp
    ```

    * Contact support with deployment logs
  </Accordion>
</AccordionGroup>
