router 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. # flake8: noqa
  2. # pylint: skip-file
  3. DOCUMENTATION = '''
  4. ---
  5. module: oc_adm_router
  6. short_description: Module to manage openshift router
  7. description:
  8. - Manage openshift router programmatically.
  9. options:
  10. state:
  11. description:
  12. - State controls the action that will be taken with resource
  13. - present - create the router
  14. - absent - remove the router
  15. - list - return the current representation of a router
  16. required: false
  17. default: present
  18. choices: ["present", "absent", "list"]
  19. aliases: []
  20. kubeconfig:
  21. description:
  22. - The path for the kubeconfig file to use for authentication
  23. required: false
  24. default: /etc/origin/master/admin.kubeconfig
  25. aliases: []
  26. debug:
  27. description:
  28. - Turn on debug output.
  29. required: false
  30. default: False
  31. aliases: []
  32. name:
  33. description:
  34. - The name of the router
  35. required: false
  36. default: router
  37. aliases: []
  38. namespace:
  39. description:
  40. - The namespace where to manage the router.
  41. required: false
  42. default: default
  43. aliases: []
  44. images:
  45. description:
  46. - The image to base this router on - ${component} will be replaced with --type
  47. required: 'registry.redhat.io/openshift3/ose-${component}:${version}'
  48. default: None
  49. aliases: []
  50. latest_images:
  51. description:
  52. - If true, attempt to use the latest image for the registry instead of the latest release.
  53. required: false
  54. default: False
  55. aliases: []
  56. labels:
  57. description:
  58. - A set of labels to uniquely identify the registry and its components.
  59. required: false
  60. default: None
  61. aliases: []
  62. ports:
  63. description:
  64. - A list of strings in the 'port:port' format
  65. required: False
  66. default:
  67. - 80:80
  68. - 443:443
  69. aliases: []
  70. replicas:
  71. description:
  72. - The replication factor of the registry; commonly 2 when high availability is desired.
  73. required: False
  74. default: 1
  75. aliases: []
  76. selector:
  77. description:
  78. - Selector used to filter nodes on deployment. Used to run routers on a specific set of nodes.
  79. required: False
  80. default: None
  81. aliases: []
  82. service_account:
  83. description:
  84. - Name of the service account to use to run the router pod.
  85. required: False
  86. default: router
  87. aliases: []
  88. router_type:
  89. description:
  90. - The router image to use - if you specify --images this flag may be ignored.
  91. required: false
  92. default: haproxy-router
  93. aliases: []
  94. extended_validation:
  95. description:
  96. - If true, configure the router to perform extended validation on routes before admitting them.
  97. required: false
  98. default: True
  99. aliases: []
  100. external_host:
  101. description:
  102. - If the underlying router implementation connects with an external host, this is the external host's hostname.
  103. required: false
  104. default: None
  105. aliases: []
  106. external_host_vserver:
  107. description:
  108. - If the underlying router implementation uses virtual servers, this is the name of the virtual server for HTTP connections.
  109. required: false
  110. default: None
  111. aliases: []
  112. external_host_insecure:
  113. description:
  114. - If the underlying router implementation connects with an external host
  115. - over a secure connection, this causes the router to skip strict certificate verification with the external host.
  116. required: false
  117. default: False
  118. aliases: []
  119. external_host_partition_path:
  120. description:
  121. - If the underlying router implementation uses partitions for control boundaries, this is the path to use for that partition.
  122. required: false
  123. default: None
  124. aliases: []
  125. external_host_username:
  126. description:
  127. - If the underlying router implementation connects with an external host, this is the username for authenticating with the external host.
  128. required: false
  129. default: None
  130. aliases: []
  131. external_host_password:
  132. description:
  133. - If the underlying router implementation connects with an external host, this is the password for authenticating with the external host.
  134. required: false
  135. default: None
  136. aliases: []
  137. external_host_private_key:
  138. description:
  139. - If the underlying router implementation requires an SSH private key, this is the path to the private key file.
  140. required: false
  141. default: None
  142. aliases: []
  143. author:
  144. - "Kenny Woodson <kwoodson@redhat.com>"
  145. extends_documentation_fragment:
  146. - There are some exceptions to note when doing the idempotency in this module.
  147. - The strategy is to use the oc adm router command to generate a default
  148. - configuration when creating or updating a router. Often times there
  149. - differences from the generated template and what is in memory in openshift.
  150. - We make exceptions to not check these specific values when comparing objects.
  151. - Here are a list of exceptions:
  152. - - DeploymentConfig:
  153. - dnsPolicy
  154. - terminationGracePeriodSeconds
  155. - restartPolicy
  156. - timeoutSeconds
  157. - livenessProbe
  158. - readinessProbe
  159. - terminationMessagePath
  160. - hostPort
  161. - defaultMode
  162. - Service:
  163. - portalIP
  164. - clusterIP
  165. - sessionAffinity
  166. - type
  167. - ServiceAccount:
  168. - secrets
  169. - imagePullSecrets
  170. '''
  171. EXAMPLES = '''
  172. - name: create routers
  173. oc_adm_router:
  174. name: router
  175. service_account: router
  176. replicas: 2
  177. namespace: default
  178. selector: type=infra
  179. cert_file: /etc/origin/master/named_certificates/router.crt
  180. key_file: /etc/origin/master/named_certificates/router.key
  181. cacert_file: /etc/origin/master/named_certificates/router.ca
  182. edits:
  183. - key: spec.strategy.rollingParams
  184. value:
  185. intervalSeconds: 1
  186. maxSurge: 50%
  187. maxUnavailable: 50%
  188. timeoutSeconds: 600
  189. updatePeriodSeconds: 1
  190. action: put
  191. - key: spec.template.spec.containers[0].resources.limits.memory
  192. value: 2G
  193. action: put
  194. - key: spec.template.spec.containers[0].resources.requests.memory
  195. value: 1G
  196. action: put
  197. - key: spec.template.spec.containers[0].env
  198. value:
  199. name: ROUTER_MAX_CONNECTIONS
  200. value: "10000"
  201. action: update
  202. register: router_out
  203. run_once: True
  204. '''