I need help in creating an Teamspeak-Pod on an Openshift (OKD 3.11). My problem is after deploying the pod, I don´t know how I´m able to give Ports 9887, 10011 and 30033 for external access.
Only 8080, 8443 and 443 is reachable for webapplications from outside.
Do anyone know what I should do to give external acccess? I think I have to do something with firewalld and port-forwards. But I can´t find anything for this.
Thx, for your help...
By default pods can only communicate within the cluster, so you won't be able to route external traffic to them.
One way to do this is to configure the service as a NodePort. That will map those ports to ports in the range of 30000-32767 across all of the nodes. For example:
If you run,
oc edit service teamspeak
, or whatever your app's service is called, and change the type to NodePort, Openshift will automatically assign a port in the range mentioned above.After your service is setup as a NodePort, you'll need to forward requests for those ports to the new ones that were assigned by Openshift (the 30000 - 32767 range ports), so instead of requests going to 9887, they go to 30036, in the case of our example.
Reference: https://docs.openshift.com/container-platform/3.6/dev_guide/expose_service/expose_internal_ip_nodeport.html
Alternatively, you can define the service as type
LoadBalancer
, which will not only expose your pods to external traffic, but also distribute requests among pods per your configuration. For example,Reference: https://docs.openshift.com/container-platform/3.4/dev_guide/expose_service/expose_internal_ip_load_balancer.html