2.0.46 and earlier k8s install instructions

This document contains the recommended approach for installing the Scalyr Agent in a Kubernetes cluster for Scalyr versions 2.0.46 and earlier.

Installation

1. Create a Secret that contains your Write Logs API key. You can find your API key here under "Logs Access Keys". Make sure the key has "write" access.

kubectl create secret generic scalyr-api-key --from-literal=scalyr-api-key="(log in to view API tokens)"

2. Create a ConfigMap that defines your cluster name.

kubectl create configmap scalyr-config --from-literal=k8s_cluster=<your_k8s_cluster_name> 

3. Create a service account that gives the DaemonSet the required privileges to access the Kubernetes API.

kubectl create -f https://raw.githubusercontent.com/scalyr/scalyr-agent-2/release/k8s/scalyr-service-account.yaml

Note: If running on Google Kubernetes Engine v1.11.x and older, you must also execute the following command to circumvent a known permissions issue:

kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user <google_cloud_account>

4. Install the new Scalyr k8s DaemonSet.

kubectl create -f https://raw.githubusercontent.com/scalyr/scalyr-agent-2/release/k8s/scalyr-agent-2.yaml

Upgrading

For upgrading the Scalyr Kubernetes Agent.

1. Create a ConfigMap that defines your cluster name.

kubectl create configmap scalyr-config --from-literal=k8s_cluster=<your k8s_cluster_name> 

2. Create a service account that gives the DaemonSet the required privileges to access the Kubernetes API.

kubectl create -f https://raw.githubusercontent.com/scalyr/scalyr-agent-2/release/k8s/scalyr-service-account.yaml

3. Delete your existing Scalyr k8s DaemonSet. Note: If you used a different yaml for deployment, use that.

kubectl delete -f https://raw.githubusercontent.com/scalyr/scalyr-agent-2/master/k8s/scalyr-agent-2.yaml

4. Install the new Scalyr k8s DaemonSet.

kubectl create -f https://raw.githubusercontent.com/scalyr/scalyr-agent-2/release/k8s/scalyr-agent-2.yaml