router 5.9 KB

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