Skip to content

Commit

Permalink
Fixes geerlingguy#164: Kubernetes example says load cluster.k8s.test …
Browse files Browse the repository at this point in the history
…but there is nothing there by default.
  • Loading branch information
geerlingguy committed Aug 23, 2019
1 parent c98a3f2 commit 062e694
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ Note: *If there are any errors during the course of running `vagrant up`, and it
### 3 - Configure your host machine to access the VM.

1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.84.3 cluster.k8s.test` so you can connect to the VM.
2. Open your browser and access [http://cluster.k8s.test](http://cluster.k8s.test).

### 4 - Deploy applications to the Kubernetes cluster

For details on how to deploy all these examples, please refer to chapter 14 in Ansible for DevOps. One quick example you can test locally:

1. cd into the 'examples' directory, and run the `k8s-module.yml` playbook, which creates an Nginx deployment and service on the cluster: `ansible-playbook -i ../inventory k8s-module.yml`
2. Copy the nodePort from the final task output in that playbook; this is the port on which Nginx is accessible.
3. Open your browser and access [http://cluster.k8s.test:32474/](http://cluster.k8s.test:32474/) (assuming nodePort is `32474`).

## Notes

Expand Down
4 changes: 2 additions & 2 deletions kubernetes/examples/k8s-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
app: nginx

- name: Get the details of the a4d-nginx Service.
k8s:
k8s_info:
api_version: v1
kind: Service
name: a4d-nginx
Expand All @@ -49,4 +49,4 @@

- name: Print the NodePort of the a4d-nginx Service.
debug:
var: a4d_nginx_service.result.spec.ports[0].nodePort
var: a4d_nginx_service.resources[0].spec.ports[0].nodePort

0 comments on commit 062e694

Please sign in to comment.