The Stackify Retrace Container helps with installing Retrace in docker container setups where you are unable to install the Stackify Linux Agent on the Docker host systems.
YOUR_ACTIVATION_KEY, YOUR_ENVIRONMENT_NAME and YOUR_KUBERNETES_CLUSTER_NAME.image: stackify/retrace-arm64 may need to be updated to point to your own repository.
---
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-arm64
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
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)
Setup the appropriate Stackify Profiler for your application.
Note: Disregard the Install Retrace Step.
Adjust your application pod configuration to include the stackify volume and volumeMounts sections.
For each pod define the stackify volume:
volumes:
- name: stackify
hostPath:
path: /var/stackify
type: DirectoryOrCreate
For each container define a volumeMount to the stackify volume:
volumeMounts:
- mountPath: /usr/local/stackify
name: stackify
Example pod configuration:
apiVersion: v1
kind: ReplicationController
metadata:
name: pod-name
spec:
replicas: 1
selector:
app: app-name
template:
metadata:
name: template-name
labels:
app: app-name
spec:
containers:
- name: container-name
image: application-image
volumeMounts:
- mountPath: /usr/local/stackify
name: stackify
volumes:
- name: stackify
hostPath:
path: /var/stackify
type: DirectoryOrCreate
Make requests against your application; verify results in the Retrace dashboard.
Add a stackify volume.
docker volume create stackify
docker run -d --restart always \
-e "STACKIFY_KEY=YOUR_ACTIVATION_KEY" \
-e "STACKIFY_ENV=YOUR_ENVIRONMENT_NAME" \
-v stackify:/var/stackify \
-v /:/hostfs:ro \
--user 0:0 \
stackify/retrace-arm64:latest
Note: Replace YOUR_ACTIVATION_KEY and YOUR_ENVIRONMENT_NAME.
Setup the appropriate Stackify Profiler for your application.
Note: Disregard the Install Retrace Step.
Configure you Application Container to include the stackify volume.
docker run -v stackify:/usr/local/stackify [application-image]
Make requests against your application; verify results in the Retrace dashboard.
Content type
Image
Digest
sha256:ec503c9de…
Size
446.6 MB
Last updated
about 1 month ago
docker pull stackify/retrace-arm64