---
title: "Kubernetes Install"
slug: "retrace-kubernetes-install"
description: "Install Retrace in Kubernetes environment with ease. Set up a DaemonSet to ensure smooth operation on each server. Configurations provided."
updated: 2025-06-30T13:38:11Z
published: 2025-06-30T13:38:11Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kubernetes Install

This document details how to install **Retrace** in a **Kubernetes** environment.

## Create a DaemonSet

The Stackify Retrace container will run as a DaemonSet to ensure that a single instance is running on each server.

Adjust the following configuration and deploy to your Kubernetes cluster.

`stackify-retrace.yaml`:

```
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: stackify
  namespace: default
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: stackify
rules:
- apiGroups: [""]
  resources:
    - "pods"
    - "services"
  verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: stackify
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: stackify
subjects:
- kind: ServiceAccount
  name: stackify
  namespace: default
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: stackify-retrace
spec:
  selector:
    matchLabels:
      name: stackify-retrace
  template:
    metadata:
      labels:
        name: stackify-retrace
    spec:
      serviceAccountName: stackify
      hostNetwork: true
      containers:
        - name: stackify-retrace
          image: stackify/retrace
          securityContext:
            runAsUser: 0
          env:
            - name: STACKIFY_KEY
              value: "YOUR_ACTIVATION_KEY"
            - name: STACKIFY_ENV
              value: "YOUR_ENVIRONMENT_NAME"
            - name: STACKIFY_K8S_CLUSTER_NAME
              value: "YOUR_KUBERNETES_CLUSTER_NAME"
          volumeMounts:
            - name: hostfs
              mountPath: /hostfs
              readOnly: true
            - name: stackify
              mountPath: /var/stackify
              readOnly: false
      volumes:
        - name: hostfs
          hostPath:
            path: /
        - name: stackify
          hostPath:
            path: /var/stackify
            type: DirectoryOrCreate
```

**Note:** Replace `YOUR_ACTIVATION_KEY`, `YOUR_ENVIRONMENT_NAME` and `YOUR_KUBERNETES_CLUSTER_NAME`. Use Image `stackify/retrace-arm64` if running on an ARM processor.

### Troubleshooting

#### Google Cloud

Ensure that your user has permissions to create a `ServiceAccount`.

`kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user $(gcloud config get-value account)`

#### Kubernetes Version < 1.9

Set **DaemonSet** to use:

```
apiVersion: extensions/v1beta1
```

## Application Setup

The following guides detail how to configure your application containers for APM.

- [.Net Core](https://docs.stackify.com/docs/net-core-apm-with-kubernetes)
- [Java](https://docs.stackify.com/docs/java-apm-with-kubernetes)
- [PHP](https://docs.stackify.com/docs/php-apm-with-kubernetes)
- [Node.js](https://docs.stackify.com/docs/nodejs-apm-with-kubernetes)
- [Ruby](https://docs.stackify.com/docs/ruby-apm-with-kubernetes)
- [Python](https://docs.stackify.com/docs/python-apm-with-kubernetes)

## Limitations

The following are known limitations of Retrace when using the Stackify Retrace container.

- Apache/Nginx/Syslog Log Collectors are disabled
- Auto Agent update is disabled
- Agent restarting via Retrace is disabled
- Server Service listing limited to SystemV (service status will be marked as `UNKNOWN`)
- JMX MBeans is disabled
