Tunnel-edge

Tunnel-edge sample config

tunnel/tunnel-edge.yaml

  1. ---
  2. kind: ClusterRole
  3. apiVersion: rbac.authorization.k8s.io/v1
  4. metadata:
  5. name: tunnel-edge
  6. rules:
  7. - apiGroups: [""]
  8. resources: ["configmaps"]
  9. verbs: ["get"]
  10. ---
  11. apiVersion: rbac.authorization.k8s.io/v1
  12. kind: ClusterRoleBinding
  13. metadata:
  14. name: tunnel-edge
  15. roleRef:
  16. apiGroup: rbac.authorization.k8s.io
  17. kind: ClusterRole
  18. name: tunnel-edge
  19. subjects:
  20. - kind: ServiceAccount
  21. name: tunnel-edge
  22. namespace: edge-system
  23. ---
  24. apiVersion: v1
  25. kind: ServiceAccount
  26. metadata:
  27. name: tunnel-edge
  28. namespace: edge-system
  29. ---
  30. apiVersion: v1
  31. kind: ConfigMap
  32. metadata:
  33. name: tunnel-edge-conf
  34. namespace: edge-system
  35. data:
  36. tunnel_edge.toml: |
  37. [mode]
  38. [mode.edge]
  39. [mode.edge.stream]
  40. [mode.edge.stream.client]
  41. token = "{{.TunnelCloudEdgeToken}}"
  42. cert = "/etc/superedge/tunnel/certs/cluster-ca.crt"
  43. dns = "tunnel.cloud.io"
  44. servername = "{{.MasterIP}}:{{.TunnelPersistentConnectionPort}}"
  45. logport = 51010
  46. [mode.edge.https]
  47. cert= "/etc/superedge/tunnel/certs/apiserver-kubelet-client.crt"
  48. key= "/etc/superedge/tunnel/certs/apiserver-kubelet-client.key"
  49. ---
  50. apiVersion: v1
  51. data:
  52. cluster-ca.crt: '{{.KubernetesCaCert}}'
  53. apiserver-kubelet-client.crt: '{{.KubeletClientCrt}}'
  54. apiserver-kubelet-client.key: '{{.KubeletClientKey}}'
  55. kind: Secret
  56. metadata:
  57. name: tunnel-edge-cert
  58. namespace: edge-system
  59. type: Opaque
  60. ---
  61. apiVersion: apps/v1
  62. kind: DaemonSet
  63. metadata:
  64. name: tunnel-edge
  65. namespace: edge-system
  66. spec:
  67. selector:
  68. matchLabels:
  69. app: tunnel-edge
  70. template:
  71. metadata:
  72. labels:
  73. app: tunnel-edge
  74. spec:
  75. hostNetwork: true
  76. containers:
  77. - name: tunnel-edge
  78. image: superedge/tunnel:v0.3.0
  79. imagePullPolicy: IfNotPresent
  80. livenessProbe:
  81. httpGet:
  82. path: /edge/healthz
  83. port: 51010
  84. initialDelaySeconds: 10
  85. periodSeconds: 180
  86. timeoutSeconds: 3
  87. successThreshold: 1
  88. failureThreshold: 3
  89. resources:
  90. limits:
  91. cpu: 20m
  92. memory: 40Mi
  93. requests:
  94. cpu: 10m
  95. memory: 10Mi
  96. command:
  97. - /usr/local/bin/tunnel
  98. env:
  99. - name: NODE_NAME
  100. valueFrom:
  101. fieldRef:
  102. apiVersion: v1
  103. fieldPath: spec.nodeName
  104. args:
  105. - --m=edge
  106. - --c=/etc/superedge/tunnel/conf/tunnel_edge.toml
  107. - --log-dir=/var/log/tunnel
  108. - --alsologtostderr
  109. volumeMounts:
  110. - name: certs
  111. mountPath: /etc/superedge/tunnel/certs
  112. - name: conf
  113. mountPath: /etc/superedge/tunnel/conf
  114. volumes:
  115. - secret:
  116. secretName: tunnel-edge-cert
  117. name: certs
  118. - configMap:
  119. name: tunnel-edge-conf
  120. name: conf

Last modified June 15, 2021 : Fixed error links and paths (fef537b)