netmaker-template.yaml.backup 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: mongo
  5. labels:
  6. name: mongo
  7. spec:
  8. ports:
  9. - port: 27017
  10. targetPort: 27017
  11. clusterIP: None
  12. selector:
  13. role: mongo
  14. ---
  15. apiVersion: apps/v1
  16. kind: StatefulSet
  17. metadata:
  18. name: mongo
  19. spec:
  20. serviceName: "mongo"
  21. replicas: 1
  22. selector:
  23. matchLabels:
  24. role: mongo
  25. template:
  26. metadata:
  27. labels:
  28. app: mongo
  29. role: mongo
  30. spec:
  31. containers:
  32. - name: mongo
  33. image: mongo
  34. env:
  35. - name: MONGO_INITDB_ROOT_USERNAME
  36. value: mongoadmin
  37. - name: MONGO_INITDB_ROOT_PASSWORD
  38. value: mongopass
  39. securityContext:
  40. privileged: true
  41. volumeMounts:
  42. - name: mongovol
  43. mountPath: /data/db
  44. volumes:
  45. - name: mongovol
  46. persistentVolumeClaim:
  47. claimName: mongodb-pvc
  48. ---
  49. apiVersion: v1
  50. kind: PersistentVolumeClaim
  51. metadata:
  52. name: mongodb-pvc
  53. spec:
  54. accessModes:
  55. - ReadWriteOnce
  56. resources:
  57. requests:
  58. storage: 7Gi
  59. storageClassName: microk8s-hostpath
  60. apiVersion: apps/v1
  61. kind: Deployment
  62. metadata:
  63. name: netmaker-backend
  64. labels:
  65. app: netmaker-backend
  66. spec:
  67. selector:
  68. matchLabels:
  69. app: netmaker-backend
  70. replicas: 1
  71. template:
  72. metadata:
  73. labels:
  74. app: netmaker-backend
  75. spec:
  76. containers:
  77. - name: netmaker-backend
  78. image: gravitl/netmaker:v0.5.7
  79. ports:
  80. - containerPort: 8081
  81. volumeMounts:
  82. - name: nm-pvc
  83. mountPath: /root/config/dnsconfig
  84. env:
  85. - name: SERVER_API_CONN_STRING
  86. value: "api.NETMAKER_BASE_DOMAIN:443"
  87. - name: COREDNS_ADDR
  88. value: "10.152.183.53"
  89. - name: SERVER_HTTP_HOST
  90. value: "api.NETMAKER_BASE_DOMAIN"
  91. - name: API_PORT
  92. value: "8081"
  93. - name: CLIENT_MODE
  94. value: "off"
  95. - name: MASTER_KEY
  96. value: "Unkn0wn!"
  97. - name: MASTER_KEY
  98. value: "secretkey"
  99. - name: CORS_ALLOWED_ORIGIN
  100. value: "*"
  101. - name: DISABLE_REMOTE_IP_CHECK
  102. value: "on"
  103. - name: MONGO_ADMIN
  104. value: "mongoadmin"
  105. - name: MONGO_PASS
  106. value: "mongopass"
  107. - name: MONGO_HOST
  108. value: "mongo-0.mongo"
  109. - name: MONGO_OPTS
  110. value: "/?authSource=admin"
  111. volumes:
  112. - name: nm-pvc
  113. persistentVolumeClaim:
  114. claimName: nm-pvc
  115. ---
  116. apiVersion: v1
  117. kind: PersistentVolumeClaim
  118. metadata:
  119. name: nm-pvc
  120. spec:
  121. accessModes:
  122. - ReadWriteMany
  123. resources:
  124. requests:
  125. storage: 128Mi
  126. storageClassName: microk8s-hostpath
  127. ---
  128. apiVersion: v1
  129. kind: Service
  130. metadata:
  131. labels:
  132. app: netmaker-backend
  133. name: netmaker-api
  134. spec:
  135. ports:
  136. - port: 8081
  137. protocol: TCP
  138. targetPort: 8081
  139. selector:
  140. app: netmaker-backend
  141. sessionAffinity: None
  142. type: ClusterIP
  143. ---
  144. apiVersion: v1
  145. kind: Service
  146. metadata:
  147. labels:
  148. app: netmaker-backend
  149. name: netmaker-grpc
  150. spec:
  151. ports:
  152. - port: 443
  153. protocol: TCP
  154. targetPort: 443
  155. selector:
  156. app: netmaker-backend
  157. sessionAffinity: None
  158. type: ClusterIP
  159. apiVersion: apps/v1
  160. kind: Deployment
  161. metadata:
  162. name: netmaker-dns
  163. labels:
  164. app: netmaker-dns
  165. spec:
  166. selector:
  167. matchLabels:
  168. app: netmaker-dns
  169. replicas: 1
  170. template:
  171. metadata:
  172. labels:
  173. app: netmaker-dns
  174. spec:
  175. containers:
  176. - args:
  177. - -conf
  178. - /root/dnsconfig/Corefile
  179. image: coredns/coredns
  180. imagePullPolicy: Always
  181. name: netmaker-dns
  182. ports:
  183. - containerPort: 53
  184. name: dns
  185. protocol: UDP
  186. - containerPort: 53
  187. name: dns-tcp
  188. protocol: TCP
  189. volumeMounts:
  190. - mountPath: /root/dnsconfig
  191. name: nm-pvc
  192. readOnly: true
  193. securityContext:
  194. allowPrivilegeEscalation: false
  195. capabilities:
  196. add:
  197. - NET_BIND_SERVICE
  198. drop:
  199. - all
  200. dnsPolicy: "None"
  201. dnsConfig:
  202. nameservers:
  203. - 127.0.0.1
  204. volumes:
  205. - name: nm-pvc
  206. persistentVolumeClaim:
  207. claimName: nm-pvc
  208. ---
  209. apiVersion: v1
  210. kind: Service
  211. metadata:
  212. labels:
  213. app: netmaker-dns
  214. name: netmaker-dns
  215. spec:
  216. ports:
  217. - port: 53
  218. protocol: UDP
  219. targetPort: 53
  220. name: udp
  221. - port: 53
  222. protocol: TCP
  223. targetPort: 53
  224. name: tcp
  225. selector:
  226. app: netmaker-dns
  227. sessionAffinity: None
  228. type: ClusterIP
  229. clusterIP: 10.152.183.53
  230. apiVersion: apps/v1
  231. kind: Deployment
  232. metadata:
  233. name: netmaker-ui
  234. labels:
  235. app: netmaker-ui
  236. spec:
  237. selector:
  238. matchLabels:
  239. app: netmaker-ui
  240. replicas: 1
  241. template:
  242. metadata:
  243. labels:
  244. app: netmaker-ui
  245. spec:
  246. containers:
  247. - name: netmaker-ui
  248. image: gravitl/netmaker-ui:v0.5
  249. ports:
  250. - containerPort: 80
  251. env:
  252. - name: BACKEND_URL
  253. value: "https://api.NETMAKER_BASE_DOMAIN"
  254. ---
  255. apiVersion: v1
  256. kind: Service
  257. metadata:
  258. labels:
  259. app: netmaker-ui
  260. name: netmaker-ui
  261. spec:
  262. ports:
  263. - port: 80
  264. protocol: TCP
  265. targetPort: 80
  266. selector:
  267. app: netmaker-ui
  268. sessionAffinity: None
  269. type: ClusterIP
  270. apiVersion: networking.k8s.io/v1
  271. kind: Ingress
  272. metadata:
  273. name: nm-api-ingress-nginx
  274. annotations:
  275. nginx.ingress.kubernetes.io/rewrite-target: /
  276. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  277. nginx.ingress.kubernetes.io/ssl-redirect: 'true'
  278. spec:
  279. ingressClassName: public
  280. tls:
  281. - hosts:
  282. - api.NETMAKER_BASE_DOMAIN
  283. secretName: nm-api-tls
  284. rules:
  285. - host: api.NETMAKER_BASE_DOMAIN
  286. http:
  287. paths:
  288. - path: /
  289. pathType: Prefix
  290. backend:
  291. service:
  292. name: netmaker-api
  293. port:
  294. number: 8081
  295. apiVersion: networking.k8s.io/v1
  296. kind: Ingress
  297. metadata:
  298. name: nm-grpc-ingress-nginx
  299. annotations:
  300. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  301. nginx.ingress.kubernetes.io/ssl-redirect: 'true'
  302. nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
  303. spec:
  304. ingressClassName: public
  305. tls:
  306. - hosts:
  307. - grpc.NETMAKER_BASE_DOMAIN
  308. secretName: nm-grpc-tls
  309. rules:
  310. - host: grpc.NETMAKER_BASE_DOMAIN
  311. http:
  312. paths:
  313. - path: /
  314. pathType: Prefix
  315. backend:
  316. service:
  317. name: netmaker-grpc
  318. port:
  319. number: 443
  320. apiVersion: networking.k8s.io/v1
  321. kind: Ingress
  322. metadata:
  323. name: nm-ui-ingress-nginx
  324. annotations:
  325. nginx.ingress.kubernetes.io/rewrite-target: /
  326. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  327. nginx.ingress.kubernetes.io/ssl-redirect: 'true'
  328. spec:
  329. ingressClassName: public
  330. tls:
  331. - hosts:
  332. - dashboard.NETMAKER_BASE_DOMAIN
  333. secretName: nm-ui-tls
  334. rules:
  335. - host: dashboard.NETMAKER_BASE_DOMAIN
  336. http:
  337. paths:
  338. - path: /
  339. pathType: Prefix
  340. backend:
  341. service:
  342. name: netmaker-ui
  343. port:
  344. number: 80