You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1285 lines
31 KiB

  1. # GENERATED FILE. Use with Kubernetes 1.7+
  2. # TO UPDATE, modify files in install/kubernetes/templates and run install/updateVersion.sh
  3. ################################
  4. # Istio system namespace
  5. ################################
  6. apiVersion: v1
  7. kind: Namespace
  8. metadata:
  9. name: {{ istio_namespace }}
  10. ---
  11. ################################
  12. # Istio RBAC
  13. ################################
  14. # Permissions and roles for istio
  15. # To debug: start the cluster with -vmodule=rbac,3 to enable verbose logging on RBAC DENY
  16. # Also helps to enable logging on apiserver 'wrap' to see the URLs.
  17. # Each RBAC deny needs to be mapped into a rule for the role.
  18. # If using minikube, start with '--extra-config=apiserver.Authorization.Mode=RBAC'
  19. kind: ClusterRole
  20. apiVersion: rbac.authorization.k8s.io/v1beta1
  21. metadata:
  22. name: istio-pilot-istio-system
  23. rules:
  24. - apiGroups: ["config.istio.io"]
  25. resources: ["*"]
  26. verbs: ["*"]
  27. - apiGroups: ["apiextensions.k8s.io"]
  28. resources: ["customresourcedefinitions"]
  29. verbs: ["*"]
  30. - apiGroups: ["istio.io"]
  31. resources: ["istioconfigs", "istioconfigs.istio.io"]
  32. verbs: ["*"]
  33. - apiGroups: ["extensions"]
  34. resources: ["thirdpartyresources", "thirdpartyresources.extensions", "ingresses", "ingresses/status"]
  35. verbs: ["*"]
  36. - apiGroups: [""]
  37. resources: ["configmaps", "endpoints", "pods", "services"]
  38. verbs: ["*"]
  39. - apiGroups: [""]
  40. resources: ["namespaces", "nodes", "secrets"]
  41. verbs: ["get", "list", "watch"]
  42. - apiGroups: ["admissionregistration.k8s.io"]
  43. resources: ["externaladmissionhookconfigurations"]
  44. verbs: ["create", "update", "delete"]
  45. ---
  46. kind: ClusterRole
  47. apiVersion: rbac.authorization.k8s.io/v1beta1
  48. metadata:
  49. name: istio-initializer-istio-system
  50. rules:
  51. - apiGroups: ["*"]
  52. resources: ["deployments", "statefulsets", "jobs", "cronjobs", "daemonsets", "replicasets", "replicationcontrollers"]
  53. verbs: ["initialize", "patch", "watch", "list"]
  54. - apiGroups: ["*"]
  55. resources: ["configmaps"]
  56. verbs: ["get", "list", "watch"]
  57. ---
  58. # Mixer CRD needs to watch and list CRDs
  59. # It also uses discovery API to discover Kinds of config.istio.io
  60. # K8s adapter needs to list pods, services etc.
  61. kind: ClusterRole
  62. apiVersion: rbac.authorization.k8s.io/v1beta1
  63. metadata:
  64. name: istio-mixer-istio-system
  65. rules:
  66. - apiGroups: ["config.istio.io"] # Istio CRD watcher
  67. resources: ["*"]
  68. verbs: ["get", "list", "watch"]
  69. - apiGroups: ["apiextensions.k8s.io"]
  70. resources: ["customresourcedefinitions"]
  71. verbs: ["get", "list", "watch"]
  72. - apiGroups: [""]
  73. resources: ["configmaps", "endpoints", "pods", "services", "namespaces", "secrets"]
  74. verbs: ["get", "list", "watch"]
  75. ---
  76. kind: ClusterRole
  77. apiVersion: rbac.authorization.k8s.io/v1beta1
  78. metadata:
  79. name: istio-ca-istio-system
  80. rules:
  81. - apiGroups: [""]
  82. resources: ["secrets"]
  83. verbs: ["create", "get", "watch", "list", "update"]
  84. - apiGroups: [""]
  85. resources: ["serviceaccounts"]
  86. verbs: ["get", "watch", "list"]
  87. ---
  88. # Permissions for the sidecar proxy.
  89. kind: ClusterRole
  90. apiVersion: rbac.authorization.k8s.io/v1beta1
  91. metadata:
  92. name: istio-sidecar-istio-system
  93. rules:
  94. - apiGroups: ["istio.io"]
  95. resources: ["istioconfigs"]
  96. verbs: ["get", "watch", "list"]
  97. - apiGroups: ["extensions"]
  98. resources: ["thirdpartyresources", "ingresses"]
  99. verbs: ["get", "watch", "list", "update"]
  100. - apiGroups: [""]
  101. resources: ["configmaps", "pods", "endpoints", "services"]
  102. verbs: ["get", "watch", "list"]
  103. ---
  104. # Grant permissions to the Pilot/discovery.
  105. kind: ClusterRoleBinding
  106. apiVersion: rbac.authorization.k8s.io/v1beta1
  107. metadata:
  108. name: istio-pilot-admin-role-binding-istio-system
  109. subjects:
  110. - kind: ServiceAccount
  111. name: istio-pilot-service-account
  112. namespace: {{ istio_namespace }}
  113. roleRef:
  114. kind: ClusterRole
  115. name: istio-pilot-istio-system
  116. apiGroup: rbac.authorization.k8s.io
  117. ---
  118. # Grant permissions to the Sidecar initializer
  119. kind: ClusterRoleBinding
  120. apiVersion: rbac.authorization.k8s.io/v1beta1
  121. metadata:
  122. name: istio-initializer-admin-role-binding-istio-system
  123. subjects:
  124. - kind: ServiceAccount
  125. name: istio-initializer-service-account
  126. namespace: {{ istio_namespace }}
  127. roleRef:
  128. kind: ClusterRole
  129. name: istio-initializer-istio-system
  130. apiGroup: rbac.authorization.k8s.io
  131. ---
  132. # Grant permissions to the CA.
  133. kind: ClusterRoleBinding
  134. apiVersion: rbac.authorization.k8s.io/v1beta1
  135. metadata:
  136. name: istio-ca-role-binding-istio-system
  137. subjects:
  138. - kind: ServiceAccount
  139. name: istio-ca-service-account
  140. namespace: {{ istio_namespace }}
  141. roleRef:
  142. kind: ClusterRole
  143. name: istio-ca-istio-system
  144. apiGroup: rbac.authorization.k8s.io
  145. ---
  146. # Grant permissions to the Ingress controller.
  147. kind: ClusterRoleBinding
  148. apiVersion: rbac.authorization.k8s.io/v1beta1
  149. metadata:
  150. name: istio-ingress-admin-role-binding-istio-system
  151. subjects:
  152. - kind: ServiceAccount
  153. name: istio-ingress-service-account
  154. namespace: {{ istio_namespace }}
  155. roleRef:
  156. kind: ClusterRole
  157. name: istio-pilot-istio-system
  158. apiGroup: rbac.authorization.k8s.io
  159. ---
  160. # Grant permissions to the Egress controller.
  161. kind: ClusterRoleBinding
  162. apiVersion: rbac.authorization.k8s.io/v1beta1
  163. metadata:
  164. name: istio-egress-admin-role-binding-istio-system
  165. subjects:
  166. - kind: ServiceAccount
  167. name: istio-egress-service-account
  168. namespace: {{ istio_namespace }}
  169. roleRef:
  170. kind: ClusterRole
  171. name: istio-pilot-istio-system
  172. apiGroup: rbac.authorization.k8s.io
  173. ---
  174. # Grant permissions to the sidecar.
  175. # TEMPORARY: the istioctl should generate a separate service account for the proxy, and permission
  176. # granted only to that account !
  177. kind: ClusterRoleBinding
  178. apiVersion: rbac.authorization.k8s.io/v1beta1
  179. metadata:
  180. name: istio-sidecar-role-binding-istio-system
  181. subjects:
  182. - kind: ServiceAccount
  183. name: default
  184. namespace: {{ istio_namespace }}
  185. roleRef:
  186. kind: ClusterRole
  187. name: istio-sidecar-istio-system
  188. apiGroup: rbac.authorization.k8s.io
  189. ---
  190. # Grant permissions to Mixer.
  191. kind: ClusterRoleBinding
  192. apiVersion: rbac.authorization.k8s.io/v1beta1
  193. metadata:
  194. name: istio-mixer-admin-role-binding-istio-system
  195. subjects:
  196. - kind: ServiceAccount
  197. name: istio-mixer-service-account
  198. namespace: {{ istio_namespace }}
  199. roleRef:
  200. kind: ClusterRole
  201. name: istio-mixer-istio-system
  202. apiGroup: rbac.authorization.k8s.io
  203. ---
  204. # Mixer
  205. apiVersion: v1
  206. kind: ConfigMap
  207. metadata:
  208. name: istio-mixer
  209. namespace: {{ istio_namespace }}
  210. data:
  211. mapping.conf: |-
  212. ---
  213. apiVersion: v1
  214. kind: Service
  215. metadata:
  216. name: istio-mixer
  217. namespace: {{ istio_namespace }}
  218. labels:
  219. istio: mixer
  220. spec:
  221. ports:
  222. - name: tcp
  223. port: 9091
  224. - name: http-health
  225. port: 9093
  226. - name: configapi
  227. port: 9094
  228. - name: statsd-prom
  229. port: 9102
  230. - name: statsd-udp
  231. port: 9125
  232. protocol: UDP
  233. - name: prometheus
  234. port: 42422
  235. selector:
  236. istio: mixer
  237. ---
  238. apiVersion: v1
  239. kind: ServiceAccount
  240. metadata:
  241. name: istio-mixer-service-account
  242. namespace: {{ istio_namespace }}
  243. ---
  244. apiVersion: extensions/v1beta1
  245. kind: Deployment
  246. metadata:
  247. name: istio-mixer
  248. namespace: {{ istio_namespace }}
  249. annotations:
  250. sidecar.istio.io/inject: "false"
  251. spec:
  252. replicas: 1
  253. template:
  254. metadata:
  255. labels:
  256. istio: mixer
  257. spec:
  258. serviceAccountName: istio-mixer-service-account
  259. containers:
  260. - name: statsd-to-prometheus
  261. image: {{ istio_statsd_image_repo }}:{{ istio_statsd_image_tag }}
  262. imagePullPolicy: IfNotPresent
  263. ports:
  264. - containerPort: 9102
  265. - containerPort: 9125
  266. protocol: UDP
  267. args:
  268. - '-statsd.mapping-config=/etc/statsd/mapping.conf'
  269. volumeMounts:
  270. - name: config-volume
  271. mountPath: /etc/statsd
  272. - name: mixer
  273. image: {{ istio_mixer_image_repo }}:{{ istio_mixer_image_tag }}
  274. imagePullPolicy: IfNotPresent
  275. ports:
  276. - containerPort: 9091
  277. - containerPort: 9094
  278. - containerPort: 42422
  279. args:
  280. - --configStoreURL=fs:///etc/opt/mixer/configroot
  281. - --configStore2URL=k8s://
  282. - --configDefaultNamespace=istio-system
  283. - --traceOutput=http://zipkin:9411/api/v1/spans
  284. - --logtostderr
  285. - -v
  286. - "2"
  287. volumes:
  288. - name: config-volume
  289. configMap:
  290. name: istio-mixer
  291. ---
  292. # Mixer CRD definitions are generated using
  293. # mixs crd all
  294. kind: CustomResourceDefinition
  295. apiVersion: apiextensions.k8s.io/v1beta1
  296. metadata:
  297. name: rules.config.istio.io
  298. labels:
  299. package: istio.io.mixer
  300. istio: core
  301. spec:
  302. group: config.istio.io
  303. names:
  304. kind: rule
  305. plural: rules
  306. singular: rule
  307. scope: Namespaced
  308. version: v1alpha2
  309. ---
  310. kind: CustomResourceDefinition
  311. apiVersion: apiextensions.k8s.io/v1beta1
  312. metadata:
  313. name: attributemanifests.config.istio.io
  314. labels:
  315. package: istio.io.mixer
  316. istio: core
  317. spec:
  318. group: config.istio.io
  319. names:
  320. kind: attributemanifest
  321. plural: attributemanifests
  322. singular: attributemanifest
  323. scope: Namespaced
  324. version: v1alpha2
  325. ---
  326. kind: CustomResourceDefinition
  327. apiVersion: apiextensions.k8s.io/v1beta1
  328. metadata:
  329. name: deniers.config.istio.io
  330. labels:
  331. package: denier
  332. istio: mixer-adapter
  333. spec:
  334. group: config.istio.io
  335. names:
  336. kind: denier
  337. plural: deniers
  338. singular: denier
  339. scope: Namespaced
  340. version: v1alpha2
  341. ---
  342. kind: CustomResourceDefinition
  343. apiVersion: apiextensions.k8s.io/v1beta1
  344. metadata:
  345. name: listcheckers.config.istio.io
  346. labels:
  347. package: listchecker
  348. istio: mixer-adapter
  349. spec:
  350. group: config.istio.io
  351. names:
  352. kind: listchecker
  353. plural: listcheckers
  354. singular: listchecker
  355. scope: Namespaced
  356. version: v1alpha2
  357. ---
  358. kind: CustomResourceDefinition
  359. apiVersion: apiextensions.k8s.io/v1beta1
  360. metadata:
  361. name: memquotas.config.istio.io
  362. labels:
  363. package: memquota
  364. istio: mixer-adapter
  365. spec:
  366. group: config.istio.io
  367. names:
  368. kind: memquota
  369. plural: memquotas
  370. singular: memquota
  371. scope: Namespaced
  372. version: v1alpha2
  373. ---
  374. kind: CustomResourceDefinition
  375. apiVersion: apiextensions.k8s.io/v1beta1
  376. metadata:
  377. name: noops.config.istio.io
  378. labels:
  379. package: noop
  380. istio: mixer-adapter
  381. spec:
  382. group: config.istio.io
  383. names:
  384. kind: noop
  385. plural: noops
  386. singular: noop
  387. scope: Namespaced
  388. version: v1alpha2
  389. ---
  390. kind: CustomResourceDefinition
  391. apiVersion: apiextensions.k8s.io/v1beta1
  392. metadata:
  393. name: prometheuses.config.istio.io
  394. labels:
  395. package: prometheus
  396. istio: mixer-adapter
  397. spec:
  398. group: config.istio.io
  399. names:
  400. kind: prometheus
  401. plural: prometheuses
  402. singular: prometheus
  403. scope: Namespaced
  404. version: v1alpha2
  405. ---
  406. kind: CustomResourceDefinition
  407. apiVersion: apiextensions.k8s.io/v1beta1
  408. metadata:
  409. name: stackdrivers.config.istio.io
  410. labels:
  411. package: stackdriver
  412. istio: mixer-adapter
  413. spec:
  414. group: config.istio.io
  415. names:
  416. kind: stackdriver
  417. plural: stackdrivers
  418. singular: stackdriver
  419. scope: Namespaced
  420. version: v1alpha2
  421. ---
  422. kind: CustomResourceDefinition
  423. apiVersion: apiextensions.k8s.io/v1beta1
  424. metadata:
  425. name: statsds.config.istio.io
  426. labels:
  427. package: statsd
  428. istio: mixer-adapter
  429. spec:
  430. group: config.istio.io
  431. names:
  432. kind: statsd
  433. plural: statsds
  434. singular: statsd
  435. scope: Namespaced
  436. version: v1alpha2
  437. ---
  438. kind: CustomResourceDefinition
  439. apiVersion: apiextensions.k8s.io/v1beta1
  440. metadata:
  441. name: stdios.config.istio.io
  442. labels:
  443. package: stdio
  444. istio: mixer-adapter
  445. spec:
  446. group: config.istio.io
  447. names:
  448. kind: stdio
  449. plural: stdios
  450. singular: stdio
  451. scope: Namespaced
  452. version: v1alpha2
  453. ---
  454. kind: CustomResourceDefinition
  455. apiVersion: apiextensions.k8s.io/v1beta1
  456. metadata:
  457. name: svcctrls.config.istio.io
  458. labels:
  459. package: svcctrl
  460. istio: mixer-adapter
  461. spec:
  462. group: config.istio.io
  463. names:
  464. kind: svcctrl
  465. plural: svcctrls
  466. singular: svcctrl
  467. scope: Namespaced
  468. version: v1alpha2
  469. ---
  470. kind: CustomResourceDefinition
  471. apiVersion: apiextensions.k8s.io/v1beta1
  472. metadata:
  473. name: checknothings.config.istio.io
  474. labels:
  475. package: checknothing
  476. istio: mixer-instance
  477. spec:
  478. group: config.istio.io
  479. names:
  480. kind: checknothing
  481. plural: checknothings
  482. singular: checknothing
  483. scope: Namespaced
  484. version: v1alpha2
  485. ---
  486. kind: CustomResourceDefinition
  487. apiVersion: apiextensions.k8s.io/v1beta1
  488. metadata:
  489. name: listentries.config.istio.io
  490. labels:
  491. package: listentry
  492. istio: mixer-instance
  493. spec:
  494. group: config.istio.io
  495. names:
  496. kind: listentry
  497. plural: listentries
  498. singular: listentry
  499. scope: Namespaced
  500. version: v1alpha2
  501. ---
  502. kind: CustomResourceDefinition
  503. apiVersion: apiextensions.k8s.io/v1beta1
  504. metadata:
  505. name: logentries.config.istio.io
  506. labels:
  507. package: logentry
  508. istio: mixer-instance
  509. spec:
  510. group: config.istio.io
  511. names:
  512. kind: logentry
  513. plural: logentries
  514. singular: logentry
  515. scope: Namespaced
  516. version: v1alpha2
  517. ---
  518. kind: CustomResourceDefinition
  519. apiVersion: apiextensions.k8s.io/v1beta1
  520. metadata:
  521. name: metrics.config.istio.io
  522. labels:
  523. package: metric
  524. istio: mixer-instance
  525. spec:
  526. group: config.istio.io
  527. names:
  528. kind: metric
  529. plural: metrics
  530. singular: metric
  531. scope: Namespaced
  532. version: v1alpha2
  533. ---
  534. kind: CustomResourceDefinition
  535. apiVersion: apiextensions.k8s.io/v1beta1
  536. metadata:
  537. name: quotas.config.istio.io
  538. labels:
  539. package: quota
  540. istio: mixer-instance
  541. spec:
  542. group: config.istio.io
  543. names:
  544. kind: quota
  545. plural: quotas
  546. singular: quota
  547. scope: Namespaced
  548. version: v1alpha2
  549. ---
  550. kind: CustomResourceDefinition
  551. apiVersion: apiextensions.k8s.io/v1beta1
  552. metadata:
  553. name: reportnothings.config.istio.io
  554. labels:
  555. package: reportnothing
  556. istio: mixer-instance
  557. spec:
  558. group: config.istio.io
  559. names:
  560. kind: reportnothing
  561. plural: reportnothings
  562. singular: reportnothing
  563. scope: Namespaced
  564. version: v1alpha2
  565. ---
  566. apiVersion: "config.istio.io/v1alpha2"
  567. kind: attributemanifest
  568. metadata:
  569. name: istioproxy
  570. namespace: {{ istio_namespace }}
  571. spec:
  572. attributes:
  573. origin.ip:
  574. valueType: IP_ADDRESS
  575. origin.uid:
  576. valueType: STRING
  577. origin.user:
  578. valueType: STRING
  579. request.headers:
  580. valueType: STRING_MAP
  581. request.id:
  582. valueType: STRING
  583. request.host:
  584. valueType: STRING
  585. request.method:
  586. valueType: STRING
  587. request.path:
  588. valueType: STRING
  589. request.reason:
  590. valueType: STRING
  591. request.referer:
  592. valueType: STRING
  593. request.scheme:
  594. valueType: STRING
  595. request.size:
  596. valueType: INT64
  597. request.time:
  598. valueType: TIMESTAMP
  599. request.useragent:
  600. valueType: STRING
  601. response.code:
  602. valueType: INT64
  603. response.duration:
  604. valueType: DURATION
  605. response.headers:
  606. valueType: STRING_MAP
  607. response.size:
  608. valueType: INT64
  609. response.time:
  610. valueType: TIMESTAMP
  611. source.uid:
  612. valueType: STRING
  613. source.user:
  614. valueType: STRING
  615. destination.uid:
  616. valueType: STRING
  617. connection.id:
  618. valueType: STRING
  619. connection.received.bytes:
  620. valueType: INT64
  621. connection.received.bytes_total:
  622. valueType: INT64
  623. connection.sent.bytes:
  624. valueType: INT64
  625. connection.sent.bytes_total:
  626. valueType: INT64
  627. connection.duration:
  628. valueType: DURATION
  629. context.protocol:
  630. valueType: STRING
  631. context.timestamp:
  632. valueType: TIMESTAMP
  633. context.time:
  634. valueType: TIMESTAMP
  635. ---
  636. apiVersion: "config.istio.io/v1alpha2"
  637. kind: attributemanifest
  638. metadata:
  639. name: kubernetes
  640. namespace: {{ istio_namespace }}
  641. spec:
  642. attributes:
  643. source.ip:
  644. valueType: IP_ADDRESS
  645. source.labels:
  646. valueType: STRING_MAP
  647. source.name:
  648. valueType: STRING
  649. source.namespace:
  650. valueType: STRING
  651. source.service:
  652. valueType: STRING
  653. source.serviceAccount:
  654. valueType: STRING
  655. destination.ip:
  656. valueType: IP_ADDRESS
  657. destination.labels:
  658. valueType: STRING_MAP
  659. destination.name:
  660. valueType: STRING
  661. destination.namespace:
  662. valueType: STRING
  663. destination.service:
  664. valueType: STRING
  665. destination.serviceAccount:
  666. valueType: STRING
  667. ---
  668. apiVersion: "config.istio.io/v1alpha2"
  669. kind: stdio
  670. metadata:
  671. name: handler
  672. namespace: {{ istio_namespace }}
  673. spec:
  674. outputAsJson: true
  675. ---
  676. apiVersion: "config.istio.io/v1alpha2"
  677. kind: logentry
  678. metadata:
  679. name: accesslog
  680. namespace: {{ istio_namespace }}
  681. spec:
  682. severity: '"Default"'
  683. timestamp: request.time
  684. variables:
  685. sourceIp: source.ip | ip("0.0.0.0")
  686. destinationIp: destination.ip | ip("0.0.0.0")
  687. sourceUser: source.user | ""
  688. method: request.method | ""
  689. url: request.path | ""
  690. protocol: request.scheme | "http"
  691. responseCode: response.code | 0
  692. responseSize: response.size | 0
  693. requestSize: request.size | 0
  694. latency: response.duration | "0ms"
  695. monitored_resource_type: '"UNSPECIFIED"'
  696. ---
  697. apiVersion: "config.istio.io/v1alpha2"
  698. kind: rule
  699. metadata:
  700. name: stdio
  701. namespace: {{ istio_namespace }}
  702. spec:
  703. match: "true" # If omitted match is true.
  704. actions:
  705. - handler: handler.stdio
  706. instances:
  707. - accesslog.logentry
  708. ---
  709. apiVersion: "config.istio.io/v1alpha2"
  710. kind: metric
  711. metadata:
  712. name: requestcount
  713. namespace: {{ istio_namespace }}
  714. spec:
  715. value: "1"
  716. dimensions:
  717. source_service: source.service | "unknown"
  718. source_version: source.labels["version"] | "unknown"
  719. destination_service: destination.service | "unknown"
  720. destination_version: destination.labels["version"] | "unknown"
  721. response_code: response.code | 200
  722. monitored_resource_type: '"UNSPECIFIED"'
  723. ---
  724. apiVersion: "config.istio.io/v1alpha2"
  725. kind: metric
  726. metadata:
  727. name: requestduration
  728. namespace: {{ istio_namespace }}
  729. spec:
  730. value: response.duration | "0ms"
  731. dimensions:
  732. source_service: source.service | "unknown"
  733. source_version: source.labels["version"] | "unknown"
  734. destination_service: destination.service | "unknown"
  735. destination_version: destination.labels["version"] | "unknown"
  736. response_code: response.code | 200
  737. monitored_resource_type: '"UNSPECIFIED"'
  738. ---
  739. apiVersion: "config.istio.io/v1alpha2"
  740. kind: metric
  741. metadata:
  742. name: requestsize
  743. namespace: {{ istio_namespace }}
  744. spec:
  745. value: request.size | 0
  746. dimensions:
  747. source_service: source.service | "unknown"
  748. source_version: source.labels["version"] | "unknown"
  749. destination_service: destination.service | "unknown"
  750. destination_version: destination.labels["version"] | "unknown"
  751. response_code: response.code | 200
  752. monitored_resource_type: '"UNSPECIFIED"'
  753. ---
  754. apiVersion: "config.istio.io/v1alpha2"
  755. kind: metric
  756. metadata:
  757. name: responsesize
  758. namespace: {{ istio_namespace }}
  759. spec:
  760. value: response.size | 0
  761. dimensions:
  762. source_service: source.service | "unknown"
  763. source_version: source.labels["version"] | "unknown"
  764. destination_service: destination.service | "unknown"
  765. destination_version: destination.labels["version"] | "unknown"
  766. response_code: response.code | 200
  767. monitored_resource_type: '"UNSPECIFIED"'
  768. ---
  769. apiVersion: "config.istio.io/v1alpha2"
  770. kind: metric
  771. metadata:
  772. name: tcpbytesent
  773. namespace: {{ istio_namespace }}
  774. labels:
  775. istio-protocol: tcp # needed so that mixer will only generate when context.protocol == tcp
  776. spec:
  777. value: connection.sent.bytes | 0
  778. dimensions:
  779. source_service: source.service | "unknown"
  780. source_version: source.labels["version"] | "unknown"
  781. destination_service: destination.service | "unknown"
  782. destination_version: destination.labels["version"] | "unknown"
  783. monitored_resource_type: '"UNSPECIFIED"'
  784. ---
  785. apiVersion: "config.istio.io/v1alpha2"
  786. kind: metric
  787. metadata:
  788. name: tcpbytereceived
  789. namespace: {{ istio_namespace }}
  790. labels:
  791. istio-protocol: tcp # needed so that mixer will only generate when context.protocol == tcp
  792. spec:
  793. value: connection.received.bytes | 0
  794. dimensions:
  795. source_service: source.service | "unknown"
  796. source_version: source.labels["version"] | "unknown"
  797. destination_service: destination.service | "unknown"
  798. destination_version: destination.labels["version"] | "unknown"
  799. monitored_resource_type: '"UNSPECIFIED"'
  800. ---
  801. apiVersion: "config.istio.io/v1alpha2"
  802. kind: prometheus
  803. metadata:
  804. name: handler
  805. namespace: {{ istio_namespace }}
  806. spec:
  807. metrics:
  808. - name: request_count
  809. instance_name: requestcount.metric.istio-system
  810. kind: COUNTER
  811. label_names:
  812. - source_service
  813. - source_version
  814. - destination_service
  815. - destination_version
  816. - response_code
  817. - name: request_duration
  818. instance_name: requestduration.metric.istio-system
  819. kind: DISTRIBUTION
  820. label_names:
  821. - source_service
  822. - source_version
  823. - destination_service
  824. - destination_version
  825. - response_code
  826. buckets:
  827. explicit_buckets:
  828. bounds: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]
  829. - name: request_size
  830. instance_name: requestsize.metric.istio-system
  831. kind: DISTRIBUTION
  832. label_names:
  833. - source_service
  834. - source_version
  835. - destination_service
  836. - destination_version
  837. - response_code
  838. buckets:
  839. exponentialBuckets:
  840. numFiniteBuckets: 8
  841. scale: 1
  842. growthFactor: 10
  843. - name: response_size
  844. instance_name: responsesize.metric.istio-system
  845. kind: DISTRIBUTION
  846. label_names:
  847. - source_service
  848. - source_version
  849. - destination_service
  850. - destination_version
  851. - response_code
  852. buckets:
  853. exponentialBuckets:
  854. numFiniteBuckets: 8
  855. scale: 1
  856. growthFactor: 10
  857. - name: tcp_bytes_sent
  858. instance_name: tcpbytesent.metric.istio-system
  859. kind: COUNTER
  860. label_names:
  861. - source_service
  862. - source_version
  863. - destination_service
  864. - destination_version
  865. - name: tcp_bytes_received
  866. instance_name: tcpbytereceived.metric.istio-system
  867. kind: COUNTER
  868. label_names:
  869. - source_service
  870. - source_version
  871. - destination_service
  872. - destination_version
  873. ---
  874. apiVersion: "config.istio.io/v1alpha2"
  875. kind: rule
  876. metadata:
  877. name: promhttp
  878. namespace: {{ istio_namespace }}
  879. labels:
  880. istio-protocol: http
  881. spec:
  882. actions:
  883. - handler: handler.prometheus
  884. instances:
  885. - requestcount.metric
  886. - requestduration.metric
  887. - requestsize.metric
  888. - responsesize.metric
  889. ---
  890. apiVersion: "config.istio.io/v1alpha2"
  891. kind: rule
  892. metadata:
  893. name: promtcp
  894. namespace: {{ istio_namespace }}
  895. labels:
  896. istio-protocol: tcp # needed so that mixer will only execute when context.protocol == TCP
  897. spec:
  898. actions:
  899. - handler: handler.prometheus
  900. instances:
  901. - tcpbytesent.metric
  902. - tcpbytereceived.metric
  903. ---
  904. ################################
  905. # Istio configMap cluster-wide
  906. ################################
  907. apiVersion: v1
  908. kind: ConfigMap
  909. metadata:
  910. name: istio
  911. namespace: {{ istio_namespace }}
  912. data:
  913. mesh: |-
  914. # Uncomment the following line to enable mutual TLS between proxies
  915. # authPolicy: MUTUAL_TLS
  916. #
  917. # Set the following variable to true to disable policy checks by the Mixer.
  918. # Note that metrics will still be reported to the Mixer.
  919. disablePolicyChecks: false
  920. # Set enableTracing to false to disable request tracing.
  921. enableTracing: true
  922. #
  923. # To disable the mixer completely (including metrics), comment out
  924. # the following line
  925. mixerAddress: istio-mixer.istio-system:9091
  926. # This is the ingress service name, update if you used a different name
  927. ingressService: istio-ingress
  928. egressProxyAddress: istio-egress.istio-system:80
  929. #
  930. # Along with discoveryRefreshDelay, this setting determines how
  931. # frequently should Envoy fetch and update its internal configuration
  932. # from Istio Pilot. Lower refresh delay results in higher CPU
  933. # utilization and potential performance loss in exchange for faster
  934. # convergence. Tweak this value according to your setup.
  935. rdsRefreshDelay: 1s
  936. #
  937. defaultConfig:
  938. # See rdsRefreshDelay for explanation about this setting.
  939. discoveryRefreshDelay: 1s
  940. #
  941. # TCP connection timeout between Envoy & the application, and between Envoys.
  942. connectTimeout: 10s
  943. #
  944. ### ADVANCED SETTINGS #############
  945. # Where should envoy's configuration be stored in the istio-proxy container
  946. configPath: "/etc/istio/proxy"
  947. binaryPath: "/usr/local/bin/envoy"
  948. # The pseudo service name used for Envoy.
  949. serviceCluster: istio-proxy
  950. # These settings that determine how long an old Envoy
  951. # process should be kept alive after an occasional reload.
  952. drainDuration: 45s
  953. parentShutdownDuration: 1m0s
  954. #
  955. # Port where Envoy listens (on local host) for admin commands
  956. # You can exec into the istio-proxy container in a pod and
  957. # curl the admin port (curl http://localhost:15000/) to obtain
  958. # diagnostic information from Envoy. See
  959. # https://lyft.github.io/envoy/docs/operations/admin.html
  960. # for more details
  961. proxyAdminPort: 15000
  962. #
  963. # Address where Istio Pilot service is running
  964. discoveryAddress: istio-pilot.istio-system:8080
  965. #
  966. # Zipkin trace collector
  967. zipkinAddress: zipkin.istio-system:9411
  968. #
  969. # Statsd metrics collector. Istio mixer exposes a UDP endpoint
  970. # to collect and convert statsd metrics into Prometheus metrics.
  971. statsdUdpAddress: istio-mixer.istio-system:9125
  972. ---
  973. ################################
  974. # Pilot
  975. ################################
  976. # Pilot CRDs
  977. apiVersion: apiextensions.k8s.io/v1beta1
  978. kind: CustomResourceDefinition
  979. metadata:
  980. name: destinationpolicies.config.istio.io
  981. spec:
  982. group: config.istio.io
  983. names:
  984. kind: DestinationPolicy
  985. listKind: DestinationPolicyList
  986. plural: destinationpolicies
  987. singular: destinationpolicy
  988. scope: Namespaced
  989. version: v1alpha2
  990. ---
  991. apiVersion: apiextensions.k8s.io/v1beta1
  992. kind: CustomResourceDefinition
  993. metadata:
  994. name: egressrules.config.istio.io
  995. spec:
  996. group: config.istio.io
  997. names:
  998. kind: EgressRule
  999. listKind: EgressRuleList
  1000. plural: egressrules
  1001. singular: egressrule
  1002. scope: Namespaced
  1003. version: v1alpha2
  1004. ---
  1005. apiVersion: apiextensions.k8s.io/v1beta1
  1006. kind: CustomResourceDefinition
  1007. metadata:
  1008. name: routerules.config.istio.io
  1009. spec:
  1010. group: config.istio.io
  1011. names:
  1012. kind: RouteRule
  1013. listKind: RouteRuleList
  1014. plural: routerules
  1015. singular: routerule
  1016. scope: Namespaced
  1017. version: v1alpha2
  1018. ---
  1019. # Pilot service for discovery
  1020. apiVersion: v1
  1021. kind: Service
  1022. metadata:
  1023. name: istio-pilot
  1024. namespace: {{ istio_namespace }}
  1025. labels:
  1026. istio: pilot
  1027. spec:
  1028. ports:
  1029. - port: 8080
  1030. name: http-discovery
  1031. - port: 443
  1032. name: http-admission-webhook
  1033. selector:
  1034. istio: pilot
  1035. ---
  1036. apiVersion: v1
  1037. kind: ServiceAccount
  1038. metadata:
  1039. name: istio-pilot-service-account
  1040. namespace: {{ istio_namespace }}
  1041. ---
  1042. apiVersion: extensions/v1beta1
  1043. kind: Deployment
  1044. metadata:
  1045. name: istio-pilot
  1046. namespace: {{ istio_namespace }}
  1047. annotations:
  1048. sidecar.istio.io/inject: "false"
  1049. spec:
  1050. replicas: 1
  1051. template:
  1052. metadata:
  1053. labels:
  1054. istio: pilot
  1055. spec:
  1056. serviceAccountName: istio-pilot-service-account
  1057. containers:
  1058. - name: discovery
  1059. image: {{ istio_pilot_image_repo }}:{{ istio_pilot_image_tag }}
  1060. imagePullPolicy: IfNotPresent
  1061. args: ["discovery", "-v", "2", "--admission-service", "istio-pilot-external"]
  1062. ports:
  1063. - containerPort: 8080
  1064. - containerPort: 443
  1065. env:
  1066. - name: POD_NAME
  1067. valueFrom:
  1068. fieldRef:
  1069. apiVersion: v1
  1070. fieldPath: metadata.name
  1071. - name: POD_NAMESPACE
  1072. valueFrom:
  1073. fieldRef:
  1074. apiVersion: v1
  1075. fieldPath: metadata.namespace
  1076. volumeMounts:
  1077. - name: config-volume
  1078. mountPath: /etc/istio/config
  1079. volumes:
  1080. - name: config-volume
  1081. configMap:
  1082. name: istio
  1083. ---
  1084. ################################
  1085. # Istio ingress
  1086. ################################
  1087. apiVersion: v1
  1088. kind: Service
  1089. metadata:
  1090. name: istio-ingress
  1091. namespace: {{ istio_namespace }}
  1092. labels:
  1093. istio: ingress
  1094. spec:
  1095. type: LoadBalancer
  1096. ports:
  1097. - port: 80
  1098. # nodePort: 32000
  1099. name: http
  1100. - port: 443
  1101. name: https
  1102. selector:
  1103. istio: ingress
  1104. ---
  1105. apiVersion: v1
  1106. kind: ServiceAccount
  1107. metadata:
  1108. name: istio-ingress-service-account
  1109. namespace: {{ istio_namespace }}
  1110. ---
  1111. apiVersion: extensions/v1beta1
  1112. kind: Deployment
  1113. metadata:
  1114. name: istio-ingress
  1115. namespace: {{ istio_namespace }}
  1116. annotations:
  1117. sidecar.istio.io/inject: "false"
  1118. spec:
  1119. replicas: 1
  1120. template:
  1121. metadata:
  1122. labels:
  1123. istio: ingress
  1124. spec:
  1125. serviceAccountName: istio-ingress-service-account
  1126. containers:
  1127. - name: istio-ingress
  1128. image: {{ istio_proxy_debug_image_repo }}:{{ istio_proxy_debug_image_tag }}
  1129. args:
  1130. - proxy
  1131. - ingress
  1132. - -v
  1133. - "2"
  1134. - --discoveryAddress
  1135. - istio-pilot:8080
  1136. imagePullPolicy: IfNotPresent
  1137. ports:
  1138. - containerPort: 80
  1139. - containerPort: 443
  1140. env:
  1141. - name: POD_NAME
  1142. valueFrom:
  1143. fieldRef:
  1144. apiVersion: v1
  1145. fieldPath: metadata.name
  1146. - name: POD_NAMESPACE
  1147. valueFrom:
  1148. fieldRef:
  1149. apiVersion: v1
  1150. fieldPath: metadata.namespace
  1151. volumeMounts:
  1152. - name: istio-certs
  1153. mountPath: /etc/certs
  1154. readOnly: true
  1155. - name: ingress-certs
  1156. mountPath: /etc/istio/ingress-certs
  1157. readOnly: true
  1158. volumes:
  1159. - name: istio-certs
  1160. secret:
  1161. secretName: istio.default
  1162. optional: true
  1163. - name: ingress-certs
  1164. secret:
  1165. secretName: istio-ingress-certs
  1166. optional: true
  1167. ---
  1168. ################################
  1169. # Istio egress
  1170. ################################
  1171. apiVersion: v1
  1172. kind: Service
  1173. metadata:
  1174. name: istio-egress
  1175. namespace: {{ istio_namespace }}
  1176. spec:
  1177. ports:
  1178. - port: 80
  1179. selector:
  1180. istio: egress
  1181. ---
  1182. apiVersion: v1
  1183. kind: ServiceAccount
  1184. metadata:
  1185. name: istio-egress-service-account
  1186. namespace: {{ istio_namespace }}
  1187. ---
  1188. apiVersion: extensions/v1beta1
  1189. kind: Deployment
  1190. metadata:
  1191. name: istio-egress
  1192. namespace: {{ istio_namespace }}
  1193. annotations:
  1194. sidecar.istio.io/inject: "false"
  1195. spec:
  1196. replicas: 1
  1197. template:
  1198. metadata:
  1199. labels:
  1200. istio: egress
  1201. spec:
  1202. serviceAccountName: istio-egress-service-account
  1203. containers:
  1204. - name: proxy
  1205. image: {{ istio_proxy_debug_image_repo }}:{{ istio_proxy_debug_image_tag }}
  1206. imagePullPolicy: IfNotPresent
  1207. args:
  1208. - proxy
  1209. - egress
  1210. - -v
  1211. - "2"
  1212. - --discoveryAddress
  1213. - istio-pilot:8080
  1214. env:
  1215. - name: POD_NAME
  1216. valueFrom:
  1217. fieldRef:
  1218. apiVersion: v1
  1219. fieldPath: metadata.name
  1220. - name: POD_NAMESPACE
  1221. valueFrom:
  1222. fieldRef:
  1223. apiVersion: v1
  1224. fieldPath: metadata.namespace
  1225. volumeMounts:
  1226. - name: istio-certs
  1227. mountPath: /etc/certs
  1228. readOnly: true
  1229. volumes:
  1230. - name: istio-certs
  1231. secret:
  1232. secretName: istio.default
  1233. optional: true
  1234. ---
  1235. ################################
  1236. # Istio-CA cluster-wide
  1237. ################################
  1238. # Service account CA
  1239. apiVersion: v1
  1240. kind: ServiceAccount
  1241. metadata:
  1242. name: istio-ca-service-account
  1243. namespace: {{ istio_namespace }}
  1244. ---
  1245. # Istio CA watching all namespaces
  1246. apiVersion: v1
  1247. kind: Deployment
  1248. apiVersion: extensions/v1beta1
  1249. metadata:
  1250. name: istio-ca
  1251. namespace: {{ istio_namespace }}
  1252. annotations:
  1253. sidecar.istio.io/inject: "false"
  1254. spec:
  1255. replicas: 1
  1256. template:
  1257. metadata:
  1258. labels:
  1259. istio: istio-ca
  1260. spec:
  1261. serviceAccountName: istio-ca-service-account
  1262. containers:
  1263. - name: istio-ca
  1264. image: {{ istio_ca_image_repo }}:{{ istio_ca_image_tag }}
  1265. imagePullPolicy: IfNotPresent
  1266. ---