Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 775 Bytes

11.md

File metadata and controls

19 lines (17 loc) · 775 Bytes

11. Add a database layer

  • Create a consul pod

    • Save its definition under k8s/db/consul-pod.yaml
    • Use consul:latest image
    • Add a label app: pets and tier: 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 and tier: db
    • Expose pod's port named http as service named port http on port=80
    • Use both labels when creating a selector (app: pets and tier: db)
  • Create a service and check it from temporary pod (use curl consul.AND_THE_REST_OF_FQDN:8500)