service 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # flake8: noqa
  2. # pylint: skip-file
  3. DOCUMENTATION = '''
  4. ---
  5. module: oc_service
  6. short_description: Create, modify, and idempotently manage openshift services.
  7. description:
  8. - Manage openshift service objects programmatically.
  9. options:
  10. state:
  11. description:
  12. - State represents whether to create, modify, delete, or list
  13. required: False
  14. default: present
  15. choices: ["present", "absent", "list"]
  16. aliases: []
  17. kubeconfig:
  18. description:
  19. - The path for the kubeconfig file to use for authentication
  20. required: false
  21. default: /etc/origin/master/admin.kubeconfig
  22. aliases: []
  23. debug:
  24. description:
  25. - Turn on debug output.
  26. required: false
  27. default: False
  28. aliases: []
  29. name:
  30. description:
  31. - Name of the object that is being queried.
  32. required: false
  33. default: None
  34. aliases: []
  35. namespace:
  36. description:
  37. - The namespace where the object lives.
  38. required: false
  39. default: default
  40. aliases: []
  41. selector:
  42. description:
  43. - The selector to apply when filtering for services.
  44. required: false
  45. default: None
  46. aliases: []
  47. labels:
  48. description:
  49. - The labels to apply on the service.
  50. required: false
  51. default: None
  52. aliases: []
  53. clusterip:
  54. description:
  55. - The cluster ip address to use with this service.
  56. required: false
  57. default: None
  58. aliases: []
  59. portalip:
  60. description:
  61. - The portal ip(virtual ip) address to use with this service.
  62. - "https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/pods_and_services.html#services"
  63. required: false
  64. default: None
  65. aliases: []
  66. ports:
  67. description:
  68. - A list of the ports that are used for this service. This includes name, port, protocol, and targetPort.
  69. - See examples.
  70. required: false
  71. default: None
  72. aliases: []
  73. session_affinity:
  74. description:
  75. - The type of session affinity to use.
  76. required: false
  77. default: 'None'
  78. aliases: []
  79. service_type:
  80. description:
  81. - The type of service desired. Each option tells the service to behave accordingly.
  82. - https://kubernetes.io/docs/user-guide/services/
  83. required: false
  84. default: ClusterIP
  85. choices:
  86. - ClusterIP
  87. - NodePort
  88. - LoadBalancer
  89. - ExternalName
  90. aliases: []
  91. externalips:
  92. description:
  93. - A list of the external IPs that are exposed for this service.
  94. - https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
  95. required: false
  96. default: None
  97. aliases: []
  98. author:
  99. - "Kenny Woodson <kwoodson@redhat.com>"
  100. extends_documentation_fragment: []
  101. '''
  102. EXAMPLES = '''
  103. - name: get docker-registry service
  104. run_once: true
  105. oc_service:
  106. namespace: default
  107. name: docker-registry
  108. state: list
  109. register: registry_service_out
  110. - name: create the docker-registry service
  111. oc_service:
  112. namespace: default
  113. name: docker-registry
  114. ports:
  115. - name: 5000-tcp
  116. port: 5000
  117. protocol: TCP
  118. targetPort: 5000
  119. selector:
  120. docker-registry: default
  121. session_affinity: ClientIP
  122. service_type: ClusterIP
  123. register: svc_out
  124. notify:
  125. - restart openshift master services
  126. '''