我想通过ansible community.kubernetes.k8s将入口https://projectcontour.io/应用到我的kubernetes集群。
https://docs.ansible.com/ansible/latest/collections/community/kubernetes/k8s_module.html上的示例向我展示了如何应用本地文件,例如
- name: Create a Deployment by reading the definition from a local file
community.kubernetes.k8s:
state: present
src: /testing/deployment.yml
但是我找不到远程文件的例子。
对于kubectl
,轮廓入口的部署可以按如下方式完成:
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml
当我阅读文档时,我没有看到这样做的选项。您可以先下载文件,然后再应用它。
- name: retrieve file
get_url:
url: https://projectcontour.io/quickstart/contour.yaml
dest: /testing/contour.yaml
register: download_contour
- name: create deployment
k8s:
src: /testing/deployment.yml
when: download_contour.changed