I have a kubernetes file that looks like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: <some_name>
spec:
replicas: 1
template:
spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
containers:
- image: <some_image>
imagePullPolicy: Always
name: <some_name>
env:
- name: ES_HOST
value: blahblah.us-west-2.es.amazonaws.com
- name: ES_PORT
value: "443"
- name: DATALOADER_QUEUE
value: some_sqs_queue
- name: AWS_DEFAULT_REGION
value: us-west-2
...<bunch of variable>
limits: &main_limits
cpu: 500m
memory: 256Mi
requests: *main_limits
If I wanted to expose this to the outside world traffic because say my application exposes app metrics using prometheus on a port.. how do I expose that port to the outside world?
my application has these two lines that starts an http server that needs to be exposed:
METRICS_PORT=9100
start_http_server(METRICS_PORT)
that's a prometheus server