apiVersion: v1
kind: ReplicationController
metadata:
  name: hollow-node
  namespace: kubesim
  labels:
    name: hollow-node
spec:
  replicas: 1
  selector:
    name: hollow-node
  template:
    metadata:
      labels:
        name: hollow-node
    spec:
      initContainers:
      - name: init-inotify-limit
        image: busybox
        imagePullPolicy: IfNotPresent
        command: ['sysctl', '-w', 'fs.inotify.max_user_instances=1000']
        securityContext:
          privileged: true
      volumes:
      - name: kubeconfig-volume
        secret:
          secretName: kubeconfig
      - name: kernelmonitorconfig-volume
        configMap:
          name: node-configmap
      - name: logs-volume
        hostPath:
          path: /var/log
      - name: no-serviceaccount-access-to-real-master
        emptyDir: {}
      - name: kubesim-node
        configMap:
          name: kubesim-node-cm
      - name: kubesim-sink
        configMap:
          name: kubesim-sink-cm
      containers:
      - name: hollow-kubelet
        image: volcanosh/vc-kubesim:latest
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 4194
        - containerPort: 10250
        - containerPort: 10255
        env:
        - name: CONTENT_TYPE
          valueFrom:
            configMapKeyRef:
              name: node-configmap
              key: content.type
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        command: [
          "/kubesim",
          "--morph=kubelet",
          "--name=$(NODE_NAME)",
          "--kubeconfig=/kubeconfig/kubelet.kubeconfig",
          "$(CONTENT_TYPE)",
          "--log-file=/var/log/kubelet-$(NODE_NAME).log",
          "--logtostderr=false",
          "--alsologtostderr",
          "--v=2",
          "--node-resource-file=/kubesim-node/config.yaml",
          "--node-resource-name=large",
          "--sink-config=/kubesim-sink/config.yaml"
        ]
        volumeMounts:
        - name: kubeconfig-volume
          mountPath: /kubeconfig
          readOnly: true
        - name: logs-volume
          mountPath: /var/log
        - name: kubesim-node
          mountPath: /kubesim-node
        - name: kubesim-sink
          mountPath: /kubesim-sink
        resources:
          requests:
            cpu: 100m
        securityContext:
          privileged: true
      - name: hollow-proxy
        image: volcanosh/vc-kubesim:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: CONTENT_TYPE
          valueFrom:
            configMapKeyRef:
              name: node-configmap
              key: content.type
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        command: [
          "/kubesim",
          "--morph=proxy",
          "--name=$(NODE_NAME)",
          "--kubeconfig=/kubeconfig/kubeproxy.kubeconfig",
          "$(CONTENT_TYPE)",
          "--log-file=/var/log/kubeproxy-$(NODE_NAME).log",
          "--logtostderr=false",
          "--alsologtostderr",
          "--v=2"
        ]
        volumeMounts:
        - name: kubeconfig-volume
          mountPath: /kubeconfig
          readOnly: true
        - name: logs-volume
          mountPath: /var/log
        resources:
          requests:
            cpu: 100m