#docker pull netsil/collectors:latest      
#docker pull netsil/netsil
apiVersion: v1
kind: Namespace
metadata:
  name: netsil
---
apiVersion: v1
kind: ReplicationController
metadata:
  namespace: netsil
  name: netsil
spec:
  replicas: 1
  selector:
    app: netsil
    component: netsil
  template:
    metadata:
      name: stream-processor
      labels:
        app: netsil
        component: netsil
        version: stable
    spec:
      containers:
      - name: netsil
        image: netsil/netsil
        command:
        - /root/startup.sh
        ports:
        - containerPort: 80
        - containerPort: 443
        - containerPort: 2000
        - containerPort: 2001
        - containerPort: 2003
        - containerPort: 2003
          protocol: UDP
        volumeMounts:
        - name: alerts
          mountPath: /opt/netsil/alerts/data
        - name: ceph-conf
          mountPath: /etc/ceph
        - name: ceph-data
          mountPath: /var/lib/ceph-data
        - name: druid-index-cache
          mountPath: /var/tmp/druid/indexCache
        - name: druid-realtime-segments
          mountPath: /opt/netsil/druid/realtime-segments
        - name: elasticsearch
          mountPath: /usr/share/elasticsearch/data
        - name: kafka-logs
          mountPath: /opt/netsil/kafka/kafka-log-dir
        - name: licenses
          mountPath: /opt/netsil/lite/license-manager/licenses
        - name: mysql
          mountPath: /var/lib/mysql
        - name: redis
          mountPath: /var/lib/redis
        - name: user-persistence
          mountPath: /opt/netsil/user-persistence/data
        - name: zookeeper
          mountPath: /opt/netsil/zookeeper/data
      volumes:
      - name: alerts
        hostPath:
          path: /opt/netsil/lite/alerts/data
      - name: ceph-conf
        hostPath:
          path: /opt/netsil/lite/ceph/conf
      - name: ceph-data
        hostPath:
          path: /opt/netsil/lite/ceph/data
      - name: druid-index-cache
        hostPath:
          path: /var/tmp/druid/indexCache
      - name: druid-realtime-segments
        hostPath:
          path: /opt/netsil/lite/druid/realtime-segments
      - name: elasticsearch
        hostPath:
          path: /opt/netsil/lite/elasticsearch/data
      - name: licenses
        hostPath:
          path: /opt/netsil/lite/license-manager/licenses
      - name: kafka-logs
        hostPath:
          path: /opt/netsil/lite/kafka/kafka-log-dir
      - name: mysql
        hostPath:
          path: /opt/netsil/lite/mysql/data
      - name: redis
        hostPath:
          path: /opt/netsil/lite/redis
      - name: user-persistence
        hostPath:
          path: /opt/netsil/lite/user-persistence/data
      - name: zookeeper
        hostPath:
          path: /opt/netsil/lite/zookeeper/data
---
apiVersion: v1
kind: Service
metadata:
  namespace: netsil
  name: netsil
spec:
  selector:
    app: netsil
    component: netsil
  ports:
    - name: http
      port: 80
    - name: https
      port: 443
      nodePort: 31443
    - name: port2000
      port: 2000
    - name: port2001
      port: 2001
    - name: port2003
      port: 2003
    - name: port2003udp
      port: 2003
      protocol: UDP
  type: NodePort
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  namespace: netsil
  name: collector
  labels:
    app: netsil
    component: collector
spec:
  template:
    metadata:
      labels:
        app: netsil
        component: collector
    spec:
      hostNetwork: true
      containers:
      - name: collector
        image: netsil/collectors:latest
        command: ["/bin/bash","-c","while true ; do NETSIL_SP_HOST=$NETSIL_SERVICE_HOST /opt/netsil/collectors/start.sh ; echo Exiting, possibly to upgrade ; sleep 5 ; done"]
        securityContext:
          capabilities:
            add:
            - NET_RAW
            - NET_ADMIN
        env:
        #- name: NETSIL_SERVICE_HOST
        #  value: '<AOC address here>'
        - name: NETSIL_TRAFFIC_PORT
          value: '2003'
        - name: NETSIL_INFRA_PORT
          value: '2001'
        - name: DEPLOY_ENV
          value: 'docker'
        - name: SAMPLINGRATE
          value: '32'
        volumeMounts:
        - name: cgroup
          mountPath: /host/sys/fs/cgroup/
          readOnly: true
        - name: proc
          mountPath: /host/proc/
          readOnly: true
        - name: docker-sock
          mountPath: /var/run/docker.sock
          readOnly: true
      volumes:
      - name: cgroup
        hostPath:
          path: /sys/fs/cgroup/
      - name: proc
        hostPath:
          path: /proc/
      - name: docker-sock
        hostPath:
          path: /var/run/docker.sock

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code