This module can manage Kubernetes resources on an existing cluster using the Kubernetes server API. Users can specify in-line API data, or specify an existing Kubernetes YAML file. Currently, this module, Only supports HTTP Basic Auth Only supports ‘strategic merge’ for update, http://goo.gl/fCPYxT SSL certs are not working, use ‘validate_certs=off’ to disable

Certificate Authority data for Kubernetes server. Should be in either standard PEM format or base64 encoded PEM data. Note that certificate verification is broken until ansible supports a version of 'match_hostname' that can match the IP address against the CA data.

file_reference

no

Specify full path to a Kubernets YAML file to send to API endpoint. This option is mutually exclusive with 'inline_data'.

inline_data

yes

The Kubernetes YAML data to send to the API endpoint. This option is mutually exclusive with 'file_reference'.

insecure

no

Reverts the connection to using HTTP instead of HTTPS. This option should only be used when execuing the 'kubernetes' module local to the Kubernetes cluster using the insecure local port (locahost:8080 by default).

state

yes

present

present

absent

update

replace

The desired action to take on the Kubernetes data.

url_password

no

The HTTP Basic Auth password for the API endpoint. This should be set unless using the 'insecure' option.

aliases: password

url_username

no

admin

The HTTP Basic Auth username for the API endpoint. This should be set unless using the 'insecure' option.

aliases: username

validate_certs

no

Enable/disable certificate validation. Note that this is set to false until Ansible can support IP address based certificate hostname matching (exists in >= python3.5.0).

# Create a new namespace with in-line YAML.-name:Create a kubernetes namespacekubernetes:api_endpoint:123.45.67.89url_username:adminurl_password:redactedinline_data:kind:NamespaceapiVersion:v1metadata:name:ansible-testlabels:label_env:productionlabel_ver:latestannotations:a1:value1a2:value2state:present# Create a new namespace from a YAML file.-name:Create a kubernetes namespacekubernetes:api_endpoint:123.45.67.89url_username:adminurl_password:redactedfile_reference:/path/to/create_namespace.yamlstate:present# Do the same thing, but using the insecure localhost port-name:Create a kubernetes namespacekubernetes:api_endpoint:123.45.67.89insecure:truefile_reference:/path/to/create_namespace.yamlstate:present