[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Step-by-step guides](../index.md) > Installing applications from Cloud Marketplace > Installing Crossplane

# Installing Crossplane with Yandex Cloud support

[Crossplane](https://crossplane.io/) is an open-source Kubernetes extension that enables platform development teams to build infrastructure for multiple vendors and create higher-level service APIs for application development teams.

You can install Crossplane in any of the following ways:
* [Using Yandex Cloud Marketplace in the management console](#marketplace-install).
* [Using a Helm chart from the Cloud Marketplace repository](#helm-install).
* [Using a Helm chart from the Crossplane repository](#helm-repo-install).

## Getting started {#before-you-begin}

1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

1. [Create a service account](../../../iam/operations/sa/create.md) with the `admin` [role](../../../iam/concepts/access-control/roles.md) for the folder where you want to manage resources using Crossplane.
1. Create an [authorized key](../../../iam/concepts/authorization/key.md) for the service account and save it to a file:

   ```bash
   yc iam key create \
     --service-account-name <service_account_name> \
     --output key.json
   ```

1. [Make sure](../connect/security-groups.md) the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If a rule is missing, [add it](../../../vpc/operations/security-group-add-rule.md).

    {% note warning %}
    
    The configuration of security groups determines performance and availability of the cluster and the services and applications running in it.
    
    {% endnote %}

## Installation in the management console using Cloud Marketplace {#marketplace-install}

1. In the [management console](https://console.yandex.cloud), select a folder.
1. Navigate to **Managed Service for&nbsp;Kubernetes**.
1. Click the name of the [Managed Service for Kubernetes cluster](../../concepts/index.md#kubernetes-cluster) you need and select the ![image](../../../_assets/console-icons/shopping-cart.svg) **Marketplace** tab.
1. Under **Application available for installation**, select [Crossplane with Yandex Cloud support](https://yandex.cloud/en/marketplace/products/yc/crossplane) and click **Go to install**.
1. Configure the application:
   * **Namespace**: Create a new [namespace](../../concepts/index.md#namespace), e.g., `crossplane-space`. If you leave the default namespace, Crossplane may work incorrectly.
   * **Application name**: Specify the application name.
   * **Service account key**: Paste the contents of the file with the service account [authorized key](../../../iam/concepts/authorization/key.md) you [obtained earlier](#before-you-begin) or create a new one.
1. Click **Install**.
1. Wait for the application to change its status to `Deployed`.

When installing Crossplane from Cloud Marketplace, a [provider](https://github.com/yandex-cloud/crossplane-provider-yc/) will also be installed in the cluster and configured to work with Yandex Cloud resources.

You can [change the provider settings](crossplane.md#change-provider-settings), e.g., specify the default [cloud](../../../resource-manager/concepts/resources-hierarchy.md#cloud) and [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) to create your resources in. 
   
For more information about the Yandex Cloud resources you can create with Crossplane, see [this section](crossplane.md#see-resources).

## Installation using a Helm chart from the Cloud Marketplace repository {#helm-install}

1. [Install Helm](https://helm.sh/docs/intro/install/) v3.8.0 or higher.
1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [configure it to work with the new cluster](../connect/index.md#kubectl-connect).
1. To install a [Helm chart](https://helm.sh/docs/topics/charts/) with Crossplane, run this command:

   ```bash
   helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/crossplane/crossplane \
     --version v1.20.6 \
     --untar && \
   helm install \
     --namespace <namespace> \
     --create-namespace \
     --set-file providerJetYc.creds=key.json \
     crossplane ./crossplane/
   ```

   If you set `namespace` to the default namespace, Crossplane may work incorrectly. We recommend specifying a value different from all the existing namespaces, e.g., `crossplane-space`.

   {% note info %}
   
   If you are using a Helm version below 3.8.0, add the `export HELM_EXPERIMENTAL_OCI=1 && \` string at the beginning of the command to enable [Open Container Initiative](https://opencontainers.org/) (OCI) support in the Helm client.
   
   {% endnote %}

1. Make sure all Crossplane pods switched to `Running`:

   ```bash
   kubectl get pods -A | grep -E "crossplane|provider-jet-yc"
   ```

When installing Crossplane from Cloud Marketplace, a [provider](https://github.com/yandex-cloud/crossplane-provider-yc/) will also be installed in the cluster and configured to work with Yandex Cloud resources.

You can [change the provider settings](crossplane.md#change-provider-settings), e.g., specify the default [cloud](../../../resource-manager/concepts/resources-hierarchy.md#cloud) and [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) to create your resources in. 
   
For more information about the Yandex Cloud resources you can create with Crossplane, see [this section](crossplane.md#see-resources).

## Installation using a Helm chart from the Crossplane repository {#helm-repo-install}

1. [Install Helm](https://helm.sh/docs/intro/install/) v3.8.0 or higher.
1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [configure it to work with the new cluster](../connect/index.md#kubectl-connect).
1. Create a namespace for Crossplane:

   ```bash
   kubectl create namespace <namespace>
   ```

1. Add the Helm GitHub repository:

   ```bash
   helm repo add crossplane-stable https://charts.crossplane.io/stable && \
   helm repo update
   ```

1. Install Crossplane:

   ```bash
   helm install crossplane --namespace <namespace> crossplane-stable/crossplane
   ```

1. Make sure Crossplane is installed and running:

   ```bash
   helm list --namespace <namespace> && \
   kubectl get all --namespace <namespace>
   ```

1. Install the Crossplane CLI:

   ```bash
   curl --silent --location https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh && \
   sudo mv kubectl-crossplane $(dirname $(which kubectl))
   ```

1. Install the provider:

   ```bash
   crossplane xpkg install provider xpkg.upbound.io/yandexcloud/crossplane-provider-yc:v0.5.1
   ```
   
   The current provider version is available in the [GitHub repository](https://github.com/yandex-cloud/crossplane-provider-yc).

1. Create a secret named `yc-creds`:

   ```bash
   kubectl create secret generic yc-creds \
     --namespace "<namespace>" \
     --from-file=credentials=<path_to_key.json>
   ```

1. Make sure the [Yandex Cloud provider](https://github.com/yandex-cloud/crossplane-provider-yc/tree/main) is installed:
   
   ```bash
   kubectl get provider
   ```

1. Create the `providerconfig.yaml` Crossplane manifest with the Yandex Cloud provider settings:

   ```yaml
   apiVersion: yandex-cloud.jet.crossplane.io/v1beta1
   kind: ProviderConfig
   metadata:
     name: default
   spec:
     credentials:
       cloudId: <cloud_ID>
       folderId: <folder_ID>
       source: Secret
       secretRef:
         name: yc-creds
         namespace: <namespace>
         key: credentials
   ```

1. Apply the provider settings:

   ```bash
   kubectl apply -f providerconfig.yaml
   ```

## Configuring the provider {#change-provider-settings}

1. To change the Yandex Cloud provider settings for Crossplane, e.g., specify the default [cloud](../../../resource-manager/concepts/resources-hierarchy.md#cloud) and [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) to create resources in, run this command:

   ```bash
   kubectl edit ProviderConfig/default
   ```

1. Edit the parameters you want to update and save the changes.

## Getting information about resources {#see-resources}

1. View the list of Yandex Cloud resources you can create using Crossplane:

   ```bash
   kubectl get crd | grep yandex-cloud.jet.crossplane.io
   ```

1. View the parameters you can set with Crossplane for a specific resource:
   
   ```bash
   kubectl describe crd <resource_name>
   ```

   For example, request the parameters for creating a Yandex Compute Cloud [VM](../../../compute/concepts/vm.md):

   ```bash
   kubectl describe crd instances.compute.yandex-cloud.jet.crossplane.io
   ```

   For examples of how to configure Yandex Cloud resources, see the [provider's GitHub repository](https://github.com/yandex-cloud/crossplane-provider-yc/tree/main/examples).

## Use cases {#examples}

* [Integration with Crossplane](../../tutorials/marketplace/crossplane.md)

## Useful links {#see-also}

* [Crossplane documentation](https://docs.crossplane.io/)