A Kubernetes app is a containerized app that you can run on your
Kubernetes cluster. The Kubernetes apps in Cloud Marketplace include
container images and configuration files, such as a `kubectl` configuration or
a Helm chart. When you deploy an app from Cloud Marketplace, the Kubernetes
resources are created in your cluster, and you can manage the resources as a
group.

For an overview of Kubernetes concepts, see the
[Kubernetes documentation](https://kubernetes.io/docs/concepts/).

If you are new to Google Kubernetes Engine, see the
[Google Kubernetes Engine Overview](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/kubernetes-engine-overview.md.txt),
or try the [Google Kubernetes Engine Quickstart](https://docs.cloud.google.com/kubernetes-engine/docs/deploy-app-cluster.md.txt).

## Before you begin

- If you want to deploy a commercial Kubernetes app, verify that your
  organization's billing administrator has bought a subscription for the app.

  For steps to select a billing plan for an app, see
  [Managing billing plans](https://docs.cloud.google.com/marketplace/docs/manage-billing.md.txt#manage_billing_plan).
- If you are using a [custom service account](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/access-scopes.md.txt#service_account)
  for your GKE cluster, make sure that service account has the
  [Storage Object Viewer role](https://cloud.google.com/container-registry/docs/access-control#permissions_and_roles).

## Deploying a Kubernetes app

To see the Kubernetes apps that you can deploy to your Google Kubernetes Engine cluster, see
the Kubernetes Apps category in Cloud Marketplace.

[Go to Cloud Marketplace](https://console.cloud.google.com/marketplace/browse?filter=solution-type:k8s)

You can deploy apps to your cluster from Cloud Marketplace, or using
the command line.

> [!NOTE]
> **Note:** Marketplace applications that require elevated privileges generate `ClusterRole` and `ClusterRoleBinding` resources upon deployment. When you use Google Cloud console to deploy or delete an application that requires elevated privileges, these resources are automatically removed. However, if you use the command line to deploy or delete an application that requires elevated privileges, you must manually delete the `ClusterRole` and `ClusterRoleBinding` resources. For instructions, see the command-line instructions that follow.

You must have the `Kubernetes Engine Admin` and `Project Viewer`,
or `Project Owner` role to deploy an app to a GKE cluster.

To deploy a Kubernetes app from Cloud Marketplace, your project must have
a network called `default`. [Learn about creating networks with Virtual Private Cloud](https://docs.cloud.google.com/vpc/docs/create-modify-vpc-networks.md.txt#creating_networks).

### Console

1. To see information about an app, including its pricing, select the app.
2. Click **Configure**.
3. Select the Kubernetes cluster that you want to deploy the app to. If you
   want to create a new cluster, click **Create cluster**.

   > [!NOTE]
   > **Note:** If a cluster is marked ineligible, verify that you have permissions to deploy workloads to that cluster.

4. Select or create a Namespace to use for the application.
   [Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
   are a way to divide cluster resources among multiple users or teams.

   > [!NOTE]
   > **Note:** Namespaces with the `-system` suffix are reserved for Cloud Marketplace components. You cannot deploy applications to these namespaces.

5. In the **App instance name** box, enter a name for the app, such as
   `sandbox-dev-app`. The name must be unique within the namespace.

6. If you need to change the service account associated with the
   application's billing plan, expand **Advanced plan settings**, and verify
   the service account that is associated with the application.

   For information on billing plans for Kubernetes apps, see
   [Understanding Billing](https://docs.cloud.google.com/marketplace/docs/understanding-billing).
7. Enter a name for your app instance, and then click **Deploy**.

8. To manage, edit, or delete your deployment, open the
   GKE Applications page.

   [Go to the Applications Page](https://console.cloud.google.com/kubernetes/application)

   For information on what you can customize in the app, see the
   documentation provided by the software vendor.
9. If the application needs to be accessible to external traffic, follow
   [these steps to expose the application as a Service](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/exposing-apps.md.txt).

### Command Line

You can deploy a Kubernetes app to a Google Kubernetes Engine cluster, or to
your own infrastructure, such as a local installation of [Minikube](https://kubernetes.io/docs/setup/minikube/).

To deploy the app from the command line, you download a license file
from Google Cloud. When you deploy the app using the steps below, you must
apply the license file to your `kubectl` config or Helm chart.

Depending on the app provider, the specific steps to deploy the app might
be different. At a high level, you do the following:

1. Connect to your Kubernetes cluster.
2. Add the license file to your `kubectl` configuration or Helm chart, as applicable.
3. Clone the Git repository for the app. The repository typically contains:

   - A `kubectl` configuration or
     Helm chart, which describes the Kubernetes resources for the app.

     If you want to customize the app, such as increasing the number
     of replicas, or changing the update strategy for application pods,
     edit the `kubectl` configuration or Helm chart.
   - An [Application resource](https://github.com/kubernetes-sigs/application),
     which defines the application's properties, such as the type of
     application, the version, maintainers, and so on.

   - Specific steps to deploy the application to your Kubernetes cluster.

   - Additional scripts or tools added by the provider.

4. Verify the app's configuration and deploy the app.

5. Following deployment, check for `ClusterRole` or `ClusterRoleBinding`
   resources labeled
   `app.kubernetes.io/component=deployer-rbac.marketplace.cloud.google.com`.
   If you find them, delete them.