Kubernetes Install
  • Updated on 12 Sep 2019
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Kubernetes Install

  • Print
  • Share
  • Dark
    Light

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: extensions/v1beta1
kind: DaemonSet
metadata:
  name: stackify-retrace
spec:
  template:
    metadata:
      labels:
        app: stackify-retrace
    spec:
      serviceAccountName: stackify
      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.

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)

Application Setup

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

Limitations

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

  • Apache/Nginx/PHP/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

Stackify offers an advanced installation path to avoid some of these limitations by installing on the host system. See Kubernetes Install on Host.

Was this article helpful?