Install StackState
Install StackState on Kubernetes

Before you start

Extra notes for installing on:
Before you start the installation of StackState:
  • Check the requirements to make sure that your Kubernetes environment fits the setup that you will use (recommended, minimal or non- high availability).
  • Check that you have the required permissions.
  • Request access credentials to pull the StackState Docker images from StackState support.
  • Add the StackState helm repository to the local helm client:
1
helm repo add stackstate https://helm.stackstate.io
2
helm repo update
Copied!

Install StackState

Create namespace

Start by creating the namespace where you want to install StackState and deploy the secret in that namespace. In our walkthrough we will use the namespace stackstate:
1
kubectl create namespace stackstate
Copied!

Generate values.yaml

The values.yaml file is required to deploy StackState with Helm. It contains your StackState license key, API key and other important information.
Before you continue: Make sure you have the latest version of the Helm chart with helm repo update.
The generate_values.sh script in the installation directory of the Helm chart will guide you through generating a values.yaml file that can be used to deploy StackState. You can run the generate_values.sh script in two ways:
  • Interactive mode: When the script is run without any arguments, it will guide you through the required configuration items.
    1
    ./generate_values.sh
    Copied!
  • Non-interactive mode: Run the script with the flag -n to pass configuration on the command line, this is useful for scripting.
    1
    ./generate_values.sh -n <configuration items>
    Copied!
The script requires the following configuration items:
Configuration
Flag
Description
Base URL
-b
The external URL for StackState that users and agents will use to connect. For example https://stackstate.internal. If you haven't decided on an Ingress configuration yet, use http://localhost:8080. This can be updated later in the generated file.
Username and password**
-u -p
The username and password used by StackState to pull images from quay.io/stackstate repositories.
License key
-l
The StackState license key.
Admin API password
-a
The password for the admin API. Note that this API contains system maintenance functionality and should only be accessible by the maintainers of the StackState installation. This can be omitted from the command line, the script will prompt for it.
Default password
-d
The password for the default user (admin) to access StackState's UI. This can be omitted from the command line, the script will prompt for it.
Kubernetes cluster name
-k
StackState will use this name to identify the cluster. In non-interactive mode, specifying -k will both enable automatic Kubernetes support and set the cluster name. In interactive mode, you will first be asked if you want to automatically install the Kubernetes StackPack.
Store the generated values.yaml file somewhere safe. You can reuse this file for upgrades, which will save time and (more importantly) will ensure that StackState continues to use the same API key. This is desirable as it means agents and other data providers for StackState will not need to be updated.

Deploy StackState with Helm

The recommended deployment of StackState is a production ready, high availability setup with many services running redundantly. If required, it is also possible to run StackState in a non-redundant setup, where each service has only a single replica.
The non-high availability setup is only suitable for situations that do not require high availability.
High availability setup
Non-high availability setup
To deploy StackState in a high availability setup on Kubernetes:
  1. 2.
    Deploy the latest StackState version to the stackstate namespace with the following command:
1
helm upgrade \
2
--install \
3
--namespace stackstate \
4
--values values.yaml \
5
stackstate \
6
stackstate/stackstate
Copied!
To deploy StackState in a non-high availability setup on Kubernetes:
  1. 2.
    Deploy the latest StackState version to the stackstate namespace with the following command:
1
helm upgrade \
2
--install \
3
--namespace stackstate \
4
--values values.yaml \
5
--values nonha_values.yaml \
6
stackstate \
7
stackstate/stackstate
Copied!
After the install, the StackState release should be listed in the StackState namespace and all pods should be running:
1
# Check the release is listed
2
helm list --namespace stackstate
3
4
# Check pods are running
5
# It may take some time for all pods to be installed or available
6
kubectl get pods --namespace stackstate
Copied!

Access the StackState UI

After StackState has been deployed you can check if all pods are up and running:
1
kubectl get pods --namespace stackstate
Copied!
When all pods are up, you can enable a port-forward:
1
kubectl port-forward service/stackstate-router 8080:8080 --namespace stackstate
Copied!
StackState will now be available in your browser at https://localhost:8080. Log in with the username admin and the default password provided in the values.yaml file.
Next steps are

Automatic Kubernetes support

StackState has built-in support for Kubernetes by means of the Kubernetes StackPack. To get started quickly, the StackState installation can automate installation of this StackPack and the required agent for the cluster that StackState itself will be installed on. This is not required and can always be done later from the StackPacks page of the StackState UI for StackState's cluster or any other Kuberenetes cluster.
The only required information is a name for the Kubernetes cluster that will distinguish it from the other Kubernetes clusters monitored by StackState. A good choice usually is the same name that is used in the kube context configuration. This will then automatically install the StackPack and install a Daemonset for the agent and a deployment for the so called cluster agent. For the full details, read the Kubernetes StackPack page.
Last modified 11d ago