
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: yarn-timeline
  labels:
    app: yarn
    component: timeline
spec:
  serviceName: yarn-timeline
  replicas: 1
  updateStrategy:
    type: RollingUpdate
  podManagementPolicy: Parallel
  selector:
    matchLabels:
      app: yarn
      component: timeline
  template:
    metadata:
      labels:
        app: yarn
        component: timeline
    spec:
      containers:
      - name: yarn-timeline
        image: flokkr/hadoop
        args:
        - yarn
        - timelineserver
        envFrom:
        - configMapRef:
            name: yarn-config
        - configMapRef:
            name: hdfs-config
        volumeMounts:
        - name: data
          mountPath: /data
        - name: byteman
          mountPath: /opt/byteman
        - name: btm
          mountPath: /opt/btm
        env:
        - name: BYTEMAN_HOME
          value: /opt/byteman
        - name: HADOOP_OPTS
          value: -javaagent:/opt/byteman/lib/byteman.jar=script:/opt/btm/hcfs-write.btm
      volumes:
      - name: data
        emptyDir: {}
      - name: byteman
        emptyDir: {}
      - name: btm
        configMap:
          name: btm
          defaultMode: 493
      initContainers:
      - name: byteman-copy
        image: elek/byteman
        command:
        - bash
        - -c
        - cp -r /tmp/byteman /opt/
        volumeMounts:
        - name: byteman
          mountPath: /opt/byteman
