|
| 1 | +import DependencyYaml from "../partials/replicated-sdk/_dependency-yaml.mdx" |
| 2 | +import HelmPackage from "../partials/helm/_helm-package.mdx" |
| 3 | +import Requirements from "../partials/embedded-cluster/_requirements.mdx" |
| 4 | + |
| 5 | +# Install SlackerNews with the Helm CLI |
| 6 | + |
| 7 | +This tutorial demonstrates how to install an application distributed with Replicated using the Helm CLI. |
| 8 | + |
| 9 | +## Introduction |
| 10 | + |
| 11 | +In this tutorial, you will: |
| 12 | + |
| 13 | +* Download the sample Helm chart (SlackerNews) |
| 14 | + |
| 15 | +* Create a release for SlackerNews in the Replicated Platform |
| 16 | + |
| 17 | +* Get the Helm CLI installation instructions for SlackerNews from the [Replicated Enterprise Portal](/vendor/enterprise-portal-about) |
| 18 | + |
| 19 | +* Install SlackerNews using the Helm CLI in a Kubernetes cluster |
| 20 | + |
| 21 | +## Set Up Your Environment |
| 22 | + |
| 23 | +Before you begin, do the following to set up your environment: |
| 24 | + |
| 25 | +* Install the Helm CLI, which is the tool for interacting with Helm and managing Helm charts. See [Install Helm](/vendor/environment-setup#install-helm) in _Set Up Your Environment_. |
| 26 | + |
| 27 | +* Ensure that you have access to a Kubernetes cluster where you can test the installation using the Helm CLI: |
| 28 | + |
| 29 | + * **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**](https://vendor.replicated.com/compatibility-matrix) in the Vendor Portal. For more information about creating an account, see [Create a Vendor Account](vendor-portal-creating-account). For more information about Compatibility Matrix credits, see [Billing and Credits](/vendor/testing-about#billing-and-credits). |
| 30 | + |
| 31 | + :::note |
| 32 | + 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. |
| 33 | + ::: |
| 34 | + |
| 35 | + After you complete the prerequisites described above, continue to the [Tutorial](#tutorial). You will create the cluster with Compatibility Matrix as part of the tutorial. |
| 36 | + |
| 37 | + * **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. |
| 38 | + |
| 39 | + For more information, see [Set Up Development Environments for Testing](/vendor/environment-setup#dev). |
| 40 | + |
| 41 | +## Tutorial |
| 42 | + |
| 43 | +### Create an Application |
| 44 | + |
| 45 | +Create a SlackerNews application in the Replicated Platform: |
| 46 | + |
| 47 | +1. On your local machine, install the Replicated CLI: |
| 48 | + |
| 49 | + * MacOS |
| 50 | + |
| 51 | + ```bash |
| 52 | + brew install replicatedhq/replicated/cli |
| 53 | + ``` |
| 54 | + * Linux / Windows Subsystem for Linux (WSL) |
| 55 | + |
| 56 | + ```bash |
| 57 | + version=$(curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \ |
| 58 | + | grep -m1 -Po '"tag_name":\s*"v\K[^"]+') |
| 59 | + curl -Ls \ |
| 60 | + "https://github.com/replicatedhq/replicated/releases/download/v${version}/replicated_${version}_linux_amd64.tar.gz" \ |
| 61 | + -o replicated.tar.gz |
| 62 | + tar xf replicated.tar.gz replicated && rm replicated.tar.gz |
| 63 | + mv replicated /usr/local/bin/replicated |
| 64 | + ``` |
| 65 | + For more information and additional installation options, see [Install the Replicated CLI](/reference/replicated-cli-installing). |
| 66 | + |
| 67 | +1. Authorize the Replicated CLI: |
| 68 | + |
| 69 | + ```bash |
| 70 | + replicated login |
| 71 | + ``` |
| 72 | + In the browser window that opens, follow the prompt to log in to your Vendor Portal account and authorize the CLI. |
| 73 | + |
| 74 | +1. Create an application named SlackerNews: |
| 75 | + |
| 76 | + ```bash |
| 77 | + replicated app create "SlackerNews" |
| 78 | + ``` |
| 79 | + :::note |
| 80 | + 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". |
| 81 | + ::: |
| 82 | + |
| 83 | +1. Set the `REPLICATED_APP` environment variable to the slug of the application that you created: |
| 84 | + |
| 85 | + ```bash |
| 86 | + export REPLICATED_APP=APP_SLUG |
| 87 | + ``` |
| 88 | + Where `APP_SLUG` is the unique application slug provided in the output of the `replicated app create` or `replicated app ls` commands. |
| 89 | + |
| 90 | + 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. |
| 91 | + |
| 92 | +### Get the Chart Archive and Create a Release |
| 93 | + |
| 94 | +Download the chart archive for SlackerNews version 1.0.1, then add the archive to a new release in the Replicated Platform: |
| 95 | + |
| 96 | +1. Run the following command to download the SlackerNews Helm chart archive to a new `tutorial-helm-install` directory: |
| 97 | + |
| 98 | + ```bash |
| 99 | + curl -O --create-dirs --output-dir tutorial-helm-install https://docs.replicated.com/slackernews-1.0.1.tgz |
| 100 | + ``` |
| 101 | + |
| 102 | +1. Add the chart archive to a new release: |
| 103 | + |
| 104 | + ```bash |
| 105 | + replicated release create --yaml-dir tutorial-helm-install --promote Unstable |
| 106 | + ``` |
| 107 | + **Example output:** |
| 108 | + ``` |
| 109 | + • Reading manifests from . ✓ |
| 110 | + • Creating Release ✓ |
| 111 | + • SEQUENCE: 1 |
| 112 | + • Promoting ✓ |
| 113 | + • Channel 32q8tKLfRFbHYPGJ1Q2E2vcDQ9j successfully set to release 1 |
| 114 | + ``` |
| 115 | + |
| 116 | +### Customize the Enterprise Portal |
| 117 | + |
| 118 | +Customize the look and feel of the Enterprise Portal for the SlackerNews application: |
| 119 | + |
| 120 | +1. Log in to the [Vendor Portal](https://vendor.replicated.com). |
| 121 | + |
| 122 | +1. Under the application drop down, select the SlackerNews application that you created. |
| 123 | + |
| 124 | + <img alt="App drop down" src="/images/quick-start-app-dropdown-slackernews.png" width="250px"/> |
| 125 | + |
| 126 | + [View a larger version of this image](/images/quick-start-app-dropdown-slackernews.png) |
| 127 | + |
| 128 | +1. In the left navigation panel, click **Enterprise Portal**. |
| 129 | + |
| 130 | +1. On the **Enterprise Portal > Settings** tab, for **Title** enter `SlackerNews Enterprise Portal`. |
| 131 | + |
| 132 | +1. Scroll down to the **Colors** section. |
| 133 | + |
| 134 | +1. For **Primary**, enter `#fd9431`. For **Secondary**, enter `#297372`. Click **Save**. |
| 135 | + |
| 136 | +  |
| 137 | + |
| 138 | + [View a larger version of this image](/images/enterprise-portal-settings-colors.png) |
| 139 | + |
| 140 | +1. Go to the **Knowledge base** tab. For **Helm Post-Install Instructions**, enter the following markdown: |
| 141 | + |
| 142 | + ```mdx |
| 143 | + Congratulations! For more information about getting started with SlackerNews, see the docs at [https://docs.slackernews.io/](https://docs.slackernews.io/). |
| 144 | + ``` |
| 145 | + |
| 146 | +  |
| 147 | + |
| 148 | + [View a larger version of this image](/images/enterprise-portal-settings-post-install.png) |
| 149 | + |
| 150 | +1. Click **Save Changes**. |
| 151 | + |
| 152 | +### Create a Customer |
| 153 | + |
| 154 | +Create a test customer: |
| 155 | + |
| 156 | +1. In the Vendor Portal, go to **Customers > Create customer**. |
| 157 | + |
| 158 | + The **Create a new customer** page opens: |
| 159 | + |
| 160 | +  |
| 161 | + |
| 162 | + [View a larger version of this image](/images/create-customer.png) |
| 163 | + |
| 164 | +1. For **Customer name**, enter a name for the customer. For example, `Example Customer`. |
| 165 | + |
| 166 | +1. 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. |
| 167 | + |
| 168 | +1. For **Assigned Channel**, select **Unstable**. This allows the customer to install releases promoted to the Unstable channel. |
| 169 | + |
| 170 | +1. For **Customer type**, select **Development**. |
| 171 | + |
| 172 | +1. For **Install types**, enable **Existing Cluster (Helm CLI)**. |
| 173 | + |
| 174 | +1. Click **Save Changes**. |
| 175 | + |
| 176 | +### Access the Customer's Enterprise Portal |
| 177 | + |
| 178 | +Log in to the Enterprise Portal for the customer to get the Helm CLI installation instructions: |
| 179 | + |
| 180 | +1. On the customer's page, go to the **Enterprise Portal Access** tab. |
| 181 | + |
| 182 | +1. Enable the **Enable Enterprise Portal for this customer** toggle. |
| 183 | + |
| 184 | +  |
| 185 | + |
| 186 | + [View a larger version of this image](/images/customer-enterprise-portal-access-toggle.png) |
| 187 | + |
| 188 | + :::note |
| 189 | + The Enterprise Portal is beta. By default, customers have access to the Replicated Download Portal. For more information, see [Comparison to the Download Portal](/vendor/enterprise-portal-about#comparison-to-the-download-portal) in _About the Enterprise Portal_. |
| 190 | + ::: |
| 191 | + |
| 192 | +1. In the **Invite users** dialog that opens automatically, click **Cancel** to close the dialog. |
| 193 | + |
| 194 | + For your production application, this is where you could send initations to customers so they can access the Enterprise Portal. |
| 195 | + |
| 196 | +1. Click **Login to portal** to generate a one-time login and open the Enterprise Portal for the customer. |
| 197 | + |
| 198 | +  |
| 199 | + |
| 200 | + [View a larger version of this image](/images/enterprise-portal-one-time-login.png) |
| 201 | + |
| 202 | + The Enterprise Portal dashboard opens. |
| 203 | + |
| 204 | +1. Go to the Enterprise Portal **Install** tab. |
| 205 | + |
| 206 | +  |
| 207 | + |
| 208 | + [View a larger version of this image](/images/enterprise-portal-install-tab.png) |
| 209 | + |
| 210 | +1. On the **Installation Guide** page, if multiple installation options are displayed, select **Helm**. |
| 211 | + |
| 212 | + :::note |
| 213 | + The installation options that are displayed in the Enterprise Portal depend on the **Install types** enabled for the customer. |
| 214 | + ::: |
| 215 | + |
| 216 | +1. For **Instance Name**, enter a nickname for the instance. |
| 217 | + |
| 218 | +1. 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**. |
| 219 | + |
| 220 | +1. For **Cluster Network Availability**, select **Outbound requests allowed**. |
| 221 | + |
| 222 | +1. For **Registry Access**, select **My workstation can access the internet, the registry AND the cluster**. |
| 223 | + |
| 224 | +1. Click **Next**. |
| 225 | + |
| 226 | +### Install |
| 227 | + |
| 228 | +Install SlackerNews in a cluster: |
| 229 | + |
| 230 | +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: |
| 231 | + |
| 232 | + 1. Create a kind cluster with version 1.34.0 of Kubernetes: |
| 233 | + |
| 234 | + ```bash |
| 235 | + replicated cluster create --distribution kind --instance-type r1.small --disk 50 --version 1.34.0 |
| 236 | + ``` |
| 237 | + |
| 238 | + 1. Watch for the cluster to have a `running` status: |
| 239 | + |
| 240 | + ```bash |
| 241 | + replicated cluster ls --watch |
| 242 | + ``` |
| 243 | + |
| 244 | + 1. After the cluster status is `running`, run the following command to set your kubectl context to the cluster: |
| 245 | + |
| 246 | + ```bash |
| 247 | + replicated cluster shell CLUSTER_ID |
| 248 | + ``` |
| 249 | + Where `CLUSTER_ID` is the ID of the cluster provided in the output of `replicated cluster ls`. |
| 250 | + |
| 251 | + :::note |
| 252 | + You can also copy the shell command for the cluster from the **Compatibility Matrix** page in the Vendor Portal. |
| 253 | + ::: |
| 254 | + |
| 255 | +1. Go back to the install wizard in the Enterprise Portal. |
| 256 | + |
| 257 | +  |
| 258 | + |
| 259 | + [View a larger version of this image](/images/enterprise-portal-helm-online-install-slackernews.png) |
| 260 | + |
| 261 | +1. On the **Helm Online Install**, for **Select a version**, ensure that the version you promoted (`1.0.1`) is selected. |
| 262 | + |
| 263 | +1. For **Export credential and log in**, run the command to log in to the Replicated registry. |
| 264 | + |
| 265 | +1. Run the next command to install the preflight plugin. |
| 266 | + |
| 267 | +1. Run preflight checks against the cluster. |
| 268 | + |
| 269 | +1. 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. |
| 270 | + |
| 271 | +1. Copy the install command provided and make the following changes: |
| 272 | + * Remove the `--values my-values.yaml` flag. |
| 273 | + * Add `--namespace slackernews --create-namespace` to install the application in the slackernews namespace. |
| 274 | + |
| 275 | + **Example:** |
| 276 | + |
| 277 | + ```bash |
| 278 | + helm install slackernews oci://registry.replicated.com/slackernews/unstable/slackernews --version 1.0.1 --namespace slackernews --create-namespace |
| 279 | + ``` |
| 280 | + |
| 281 | +1. Watch the SlackerNews deployment: |
| 282 | + |
| 283 | + ```bash |
| 284 | + kubectl get all --namespace slackernews --watch |
| 285 | + ``` |
| 286 | + |
| 287 | +1. 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: |
| 288 | + |
| 289 | + ```bash |
| 290 | + kubectl port-forward --namespace slackernews svc/slackernews-nginx 8080:8080 |
| 291 | + ``` |
| 292 | + |
| 293 | +1. In a browser, go to `localhost:8080`. The SlackerNews application landing page opens. |
| 294 | + |
| 295 | +  |
| 296 | + |
| 297 | + [View a larger version of this image](/images/slackernews-landing-page.png) |
| 298 | + |
| 299 | +1. 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. |
| 300 | + |
| 301 | +  |
| 302 | + |
| 303 | + [View a larger version of this image](/images/enterprise-portal-post-installation.png) |
| 304 | + |
| 305 | +1. Return to the Vendor Portal, select the SlackerNews application, and go to **Customers**. Under the name of the customer, confirm that you can see an active instance. |
| 306 | + |
| 307 | +1. (Optional) Under Instance ID, click on the ID to view additional insights including the versions of Kubernetes and the Replicated SDK running in the cluster where you installed the application. |
| 308 | + |
| 309 | +## Summary |
| 310 | + |
| 311 | +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. |
| 312 | + |
| 313 | +For more information about Helm CLI installations for applications distributed with Replicated, see [About Helm Installations with Replciated](/vendor/helm-install-overview). |
0 commit comments