hollow-node_template.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. apiVersion: v1
  2. kind: ReplicationController
  3. metadata:
  4. name: hollow-node
  5. labels:
  6. name: hollow-node
  7. {{kubemark_mig_config}}
  8. spec:
  9. replicas: {{numreplicas}}
  10. selector:
  11. name: hollow-node
  12. template:
  13. metadata:
  14. labels:
  15. name: hollow-node
  16. {{kubemark_mig_config}}
  17. spec:
  18. initContainers:
  19. - name: init-inotify-limit
  20. image: busybox
  21. command: ['sysctl', '-w', 'fs.inotify.max_user_instances=1000']
  22. securityContext:
  23. privileged: true
  24. volumes:
  25. - name: kubeconfig-volume
  26. secret:
  27. secretName: kubeconfig
  28. - name: kernelmonitorconfig-volume
  29. configMap:
  30. name: node-configmap
  31. - name: logs-volume
  32. hostPath:
  33. path: /var/log
  34. - name: no-serviceaccount-access-to-real-master
  35. emptyDir: {}
  36. containers:
  37. - name: hollow-kubelet
  38. image: {{kubemark_image_registry}}/kubemark:{{kubemark_image_tag}}
  39. ports:
  40. - containerPort: 4194
  41. - containerPort: 10250
  42. - containerPort: 10255
  43. env:
  44. - name: CONTENT_TYPE
  45. valueFrom:
  46. configMapKeyRef:
  47. name: node-configmap
  48. key: content.type
  49. - name: NODE_NAME
  50. valueFrom:
  51. fieldRef:
  52. fieldPath: metadata.name
  53. command:
  54. - /bin/sh
  55. - -c
  56. - /kubemark --morph=kubelet --name=$(NODE_NAME) {{hollow_kubelet_params}} --kubeconfig=/kubeconfig/kubelet.kubeconfig $(CONTENT_TYPE) --alsologtostderr 1>>/var/log/kubelet-$(NODE_NAME).log 2>&1
  57. volumeMounts:
  58. - name: kubeconfig-volume
  59. mountPath: /kubeconfig
  60. readOnly: true
  61. - name: logs-volume
  62. mountPath: /var/log
  63. resources:
  64. requests:
  65. cpu: 40m
  66. memory: 100M
  67. securityContext:
  68. privileged: true
  69. - name: hollow-proxy
  70. image: {{kubemark_image_registry}}/kubemark:{{kubemark_image_tag}}
  71. env:
  72. - name: CONTENT_TYPE
  73. valueFrom:
  74. configMapKeyRef:
  75. name: node-configmap
  76. key: content.type
  77. - name: NODE_NAME
  78. valueFrom:
  79. fieldRef:
  80. fieldPath: metadata.name
  81. command:
  82. - /bin/sh
  83. - -c
  84. - /kubemark --morph=proxy --name=$(NODE_NAME) {{hollow_proxy_params}} --kubeconfig=/kubeconfig/kubeproxy.kubeconfig $(CONTENT_TYPE) --alsologtostderr 1>>/var/log/kubeproxy-$(NODE_NAME).log 2>&1
  85. volumeMounts:
  86. - name: kubeconfig-volume
  87. mountPath: /kubeconfig
  88. readOnly: true
  89. - name: logs-volume
  90. mountPath: /var/log
  91. resources:
  92. requests:
  93. cpu: {{HOLLOW_PROXY_CPU}}m
  94. memory: {{HOLLOW_PROXY_MEM}}Ki
  95. - name: hollow-node-problem-detector
  96. image: k8s.gcr.io/node-problem-detector:v0.4.1
  97. env:
  98. - name: NODE_NAME
  99. valueFrom:
  100. fieldRef:
  101. fieldPath: metadata.name
  102. command:
  103. - /bin/sh
  104. - -c
  105. - /node-problem-detector --system-log-monitors=/config/kernel.monitor --apiserver-override="https://{{master_ip}}:443?inClusterConfig=false&auth=/kubeconfig/npd.kubeconfig" --alsologtostderr 1>>/var/log/npd-$(NODE_NAME).log 2>&1
  106. volumeMounts:
  107. - name: kubeconfig-volume
  108. mountPath: /kubeconfig
  109. readOnly: true
  110. - name: kernelmonitorconfig-volume
  111. mountPath: /config
  112. readOnly: true
  113. - name: no-serviceaccount-access-to-real-master
  114. mountPath: /var/run/secrets/kubernetes.io/serviceaccount
  115. readOnly: true
  116. - name: logs-volume
  117. mountPath: /var/log
  118. resources:
  119. requests:
  120. cpu: 20m
  121. memory: 20Mi
  122. securityContext:
  123. privileged: true
  124. # Keep the pod running on unreachable node for 15 minutes.
  125. # This time should be sufficient for a VM reboot and should
  126. # avoid recreating a new hollow node.
  127. # See https://github.com/kubernetes/kubernetes/issues/67120 for context.
  128. tolerations:
  129. - key: "node.kubernetes.io/unreachable"
  130. operator: "Exists"
  131. effect: "NoExecute"
  132. tolerationSeconds: 900