-
Create a consul pod
- Save its definition under k8s/db/consul-pod.yaml
- Use consul:latest image
- Add a label
app: pets
andtier: db
- Add definition for the following ports
- port 8500 named http
- port 8400 named rpc
- port 8300 named server
-
Run it to see if it works
-
Create a consul service
- Save its definition under k8s/db/consul-svc.yaml
- Use ClusterIP type
- Add a label
app: pets
andtier: db
- Expose pod's port named http as service named port http on port=80
- Use both labels when creating a selector (
app: pets
andtier: db
)
-
Create a service and check it from temporary pod (use
curl consul.AND_THE_REST_OF_FQDN:8500
)