community.okd.openshift_route – Expose a Service as an OpenShift Route.¶
Note
This plugin is part of the community.okd collection (version 1.0.0).
To install it use: ansible-galaxy collection install community.okd
.
To use it in a playbook, specify: community.okd.openshift_route
.
New in version 0.3.0: of community.okd
Synopsis¶
Looks up a Service and creates a new Route based on it.
Analogous to oc expose and oc create route for creating Routes, but does not support creating Services.
For creating Services from other resources, see community.kubernetes.k8s_expose
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
openshift >= 0.11.0
PyYAML >= 3.11
Parameters¶
Notes¶
Note
The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit https://github.com/openshift/openshift-restclient-python
To avoid SSL certificate validation errors when
validate_certs
is True, the full certificate chain for the API server must be provided viaca_cert
or in the kubeconfig file.
Examples¶
- name: Create hello-world deployment
community.okd.k8s:
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-kubernetes
namespace: default
spec:
replicas: 3
selector:
matchLabels:
app: hello-kubernetes
template:
metadata:
labels:
app: hello-kubernetes
spec:
containers:
- name: hello-kubernetes
image: paulbouwer/hello-kubernetes:1.8
ports:
- containerPort: 8080
- name: Create Service for the hello-world deployment
community.okd.k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: hello-kubernetes
namespace: default
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: hello-kubernetes
- name: Expose the insecure hello-world service externally
community.okd.openshift_route:
service: hello-kubernetes
namespace: default
insecure_policy: allow
register: route
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Fabian von Feilitzsch (@fabianvf)