Skip to main content

Install SlackerNews with the Helm CLI

This tutorial demonstrates how to install an application distributed with Replicated using the Helm CLI.

Introduction

In this tutorial, you will:

  • Download the sample Helm chart (SlackerNews)

  • Create a release for SlackerNews in the Replicated Platform

  • Get the Helm CLI installation instructions for SlackerNews from the Replicated Enterprise Portal

  • Install SlackerNews using the Helm CLI in a Kubernetes cluster

Set Up Your Environment

Before you begin, do the following to set up your environment:

  • Install the Helm CLI, which is the tool for interacting with Helm and managing Helm charts. See Install Helm in Set Up Your Environment.

  • Ensure that you have access to a Kubernetes cluster where you can test the installation using the Helm CLI:

    • Option 1: Use Compatibility Matrix. To use Replicated Compatibility Matrix to create a cluster for this tutorial, first request Compatibility Matrix credits. You can request credits by creating a Vendor Portal account and then going to Compatibility Matrix > Request more credits in the Vendor Portal. For more information about creating an account, see Create a Vendor Account. For more information about Compatibility Matrix credits, see Billing and Credits.

      note

      If you are new to the Replicated platform, you might be eligible for $100 in free Compatibility Matrix credits. To request your free credits, reach out to our sales team at https://www.replicated.com/contact and note in the comments that you are completing a Replicated tutorial.

      After you complete the prerequisites described above, continue to the Tutorial. You will create the cluster with Compatibility Matrix as part of the tutorial.

    • Option 2: Bring your own Cluster. You can use any cloud provider or tool that you prefer to create a cluster, such as Google Kubernetes Engine (GKE) or minikube.

    For more information, see Set Up Development Environments for Testing.

Tutorial

Create an Application

Create a SlackerNews application in the Replicated Platform:

  1. On your local machine, install the Replicated CLI:

    • MacOS

      brew install replicatedhq/replicated/cli
    • Linux / Windows Subsystem for Linux (WSL)

      version=$(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
      | grep -m1 -Po '"tag_name":\s*"v\K[^"]+')
      curl -Ls \
      "https://github.com/replicatedhq/replicated/releases/download/v${version}/replicated_${version}_linux_amd64.tar.gz" \
      -o replicated.tar.gz
      tar xf replicated.tar.gz replicated && rm replicated.tar.gz
      mv replicated /usr/local/bin/replicated

    For more information and additional installation options, see Install the Replicated CLI.

  2. Authorize the Replicated CLI:

    replicated login

    In the browser window that opens, follow the prompt to log in to your Vendor Portal account and authorize the CLI.

  3. Create an application named SlackerNews:

    replicated app create "SlackerNews"
    note

    If you already have an application named SlackerNews in your Vendor Portal team, you can add a qualifier to the name. For example, "SlackerNews Tutorial" or "SlackerNews YOUR_NAME".

  4. Set the REPLICATED_APP environment variable to the slug of the application that you created:

    export REPLICATED_APP=APP_SLUG

    Where APP_SLUG is the unique application slug provided in the output of the replicated app create or replicated app ls commands.

    Setting the REPLICATED_APP environment variable allows you to interact with the application using the Replicated CLI without needing to use the --app flag with every command.

Get the Chart Archive and Create a Release

Download the chart archive for SlackerNews version 1.0.1, then add the archive to a new release in the Replicated Platform:

  1. Run the following command to download the SlackerNews Helm chart archive to a new tutorial-helm-install directory:

    curl -O --create-dirs --output-dir tutorial-helm-install https://docs.replicated.com/slackernews-1.0.1.tgz
  2. Add the chart archive to a new release:

    replicated release create --yaml-dir tutorial-helm-install --promote Unstable

    Example output:

    • Reading manifests from . ✓
    • Creating Release ✓
    • SEQUENCE: 1
    • Promoting ✓
    • Channel 32q8tKLfRFbHYPGJ1Q2E2vcDQ9j successfully set to release 1

Customize the Enterprise Portal

Customize the look and feel of the Enterprise Portal for the SlackerNews application:

  1. Log in to the Vendor Portal.

  2. Under the application drop down, select the SlackerNews application that you created.

    App drop down

    View a larger version of this image

  3. In the left navigation panel, click Enterprise Portal.

  4. On the Enterprise Portal > Settings tab, for Title enter SlackerNews Enterprise Portal.

  5. Scroll down to the Colors section.

  6. For Primary, enter #fd9431. For Secondary, enter #297372. Click Save.

    Enterprise Portal color settings

    View a larger version of this image

  7. Go to the Knowledge base tab. For Helm Post-Install Instructions, enter the following markdown:

    Congratulations! For more information about getting started with SlackerNews, see the docs at [https://docs.slackernews.io/](https://docs.slackernews.io/).

    Enterprise Portal install instructions settings

    View a larger version of this image

  8. Click Save Changes.

Create a Customer

Create a test customer:

  1. In the Vendor Portal, go to Customers > Create customer.

    The Create a new customer page opens:

    Customer a new customer page in the Vendor Portal

    View a larger version of this image

  2. For Customer name, enter a name for the customer. For example, Example Customer.

  3. For Customer email, enter an email address. This email address is only used as a username for authenticating with the Replicated registry and is never contacted. A customer email address is required for Helm CLI installations.

  4. For Assigned Channel, select Unstable. This allows the customer to install releases promoted to the Unstable channel.

  5. For Customer type, select Development.

  6. For Install types, enable Existing Cluster (Helm CLI).

  7. Click Save Changes.

Access the Customer's Enterprise Portal

Log in to the Enterprise Portal for the customer to get the Helm CLI installation instructions:

  1. On the customer's page, go to the Enterprise Portal Access tab.

  2. Enable the Enable Enterprise Portal for this customer toggle.

    enterprise portal toggle enabled

    View a larger version of this image

    note

    The Enterprise Portal is beta. By default, customers have access to the Replicated Download Portal. For more information, see Comparison to the Download Portal in About the Enterprise Portal.

  3. In the Invite users dialog that opens automatically, click Cancel to close the dialog.

    For your production application, this is where you could send initations to customers so they can access the Enterprise Portal.

  4. Click Login to portal to generate a one-time login and open the Enterprise Portal for the customer.

    Login to portal button

    View a larger version of this image

    The Enterprise Portal dashboard opens.

  5. Go to the Enterprise Portal Install tab.

    install tab

    View a larger version of this image

  6. On the Installation Guide page, if multiple installation options are displayed, select Helm.

    note

    The installation options that are displayed in the Enterprise Portal depend on the Install types enabled for the customer.

  7. For Instance Name, enter a nickname for the instance.

  8. For Kubernetes Distribution, select the distribution of the cluster where you will install SlackerNews. If you are going to use Compatibility Matrix to create the cluster, select Vanilla Kubernetes.

  9. For Cluster Network Availability, select Outbound requests allowed.

  10. For Registry Access, select My workstation can access the internet, the registry AND the cluster.

  11. Click Next.

Install

Install SlackerNews in a cluster:

  1. If you brought your own cluster, set kubectl context to the cluster where you want to install. If you are using Compatibility Matrix, do the following:

    1. Create a kind cluster with version 1.34.0 of Kubernetes:

      replicated cluster create --distribution kind --instance-type r1.small --disk 50 --version 1.34.0
    2. Watch for the cluster to have a running status:

      replicated cluster ls --watch
    3. After the cluster status is running, run the following command to set your kubectl context to the cluster:

      replicated cluster shell CLUSTER_ID

      Where CLUSTER_ID is the ID of the cluster provided in the output of replicated cluster ls.

      note

      You can also copy the shell command for the cluster from the Compatibility Matrix page in the Vendor Portal.

  2. Go back to the install wizard in the Enterprise Portal.

    Helm online install wizard

    View a larger version of this image

  3. On the Helm Online Install, for Select a version, ensure that the version you promoted (1.0.1) is selected.

  4. For Export credential and log in, run the command to log in to the Replicated registry.

  5. Run the next command to install the preflight plugin.

  6. Run preflight checks against the cluster.

  7. Skip the Create values override file step. This is not necessary for the purpose of this tutorial because you do not need to pass a local values file to the chart.

  8. Copy the install command provided and make the following changes:

    • Remove the --values my-values.yaml flag.
    • Add --namespace slackernews --create-namespace to install the application in the slackernews namespace.

    Example:

    helm install slackernews oci://registry.replicated.com/slackernews/unstable/slackernews --version 1.0.1 --namespace slackernews --create-namespace 
  9. Watch the SlackerNews deployment:

    kubectl get all --namespace slackernews --watch
  10. When the installation is complete and the slackernews-nginx service is running, run the following command to port forward the service to local port 8080:

    kubectl port-forward --namespace slackernews svc/slackernews-nginx 8080:8080
  11. In a browser, go to localhost:8080. The SlackerNews application landing page opens.

    SlackerNews landing page page

    View a larger version of this image

  12. Go back to the Helm Online Install wizard in the Enterprise Portal and click Continue. On the Installation Complete page, you can see the post-installation message that you set.

    Installation Complete page

    View a larger version of this image

Summary

Congratulations! You created a release using a Helm chart, then followed the Helm CLI installation steps provided in the Enterprise Portal to install the release in a cluster.

For more information about Helm CLI installations for applications distributed with Replicated, see About Helm Installations with Replciated.