I am using Ambassador as the ingress controller for my kubernetes setup. I need to connect to multiple ports on my containers, for example, I have a RethinkDB container and I need to connect to port 8085 for its web-ui, port 28015 for RDB-API and port 29015 for adding nodes to Rethinkdb and clustering.
I tried different configuration but they didn't work. The configurations that I tried: 1- This configuration works for the latest mapping which means if I replace 8085 mapping with 29015 and put it at the end I am able to access the web-ui but not other parts and so on.
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping
prefix: /rethinkdb:28015/
service: rethinkdb:28015
labels:
ambassador:
- request_label:
- rethinkdb:28015
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping
- prefix: /rethinkdb:8085/
service: rethinkdb:8085
labels:
ambassador:
- request_label:
- rethinkdb:8085
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping
prefix: /rethinkdb:29015/
service: rethinkdb:29015
labels:
ambassador:
- request_label:
- rethinkdb:29015
2- This one didn't work at all
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping
- prefix: /rethinkdb:8085/
service: rethinkdb:8085
- prefix: /rethinkdb:29015/
service: rethinkdb:29015
- prefix: /rethinkdb:28015/
service: rethinkdb:28015
How shall I configure Ambassador so I can have access to all ports of my container?
Try to put different names of Mappings like in example below:
apiVersion: v1
kind: Service
metadata:
name: rethinkdb
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping
prefix: /rethinkdb:28015/
service: rethinkdb:28015
labels:
ambassador:
- request_label:
- rethinkdb:28015
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping1
prefix: /rethinkdb:8085/
service: rethinkdb:8085
labels:
ambassador:
- request_label:
- rethinkdb:8085
---
apiVersion: ambassador/v1
kind: Mapping
name: rethinkdb_mapping2
prefix: /rethinkdb:29015/
service: rethinkdb:29015
labels:
ambassador:
- request_label:
- rethinkdb:29015
spec:
type: ClusterIP
clusterIP: None
Remember to put right name of service into service label inside mappings definition.
Note on indents and correct syntax.
I hope it helps.