Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does k8s set the port number to be used through environment variables #3346

Closed
liuxin638507 opened this issue May 11, 2024 · 3 comments
Closed

Comments

@liuxin638507
Copy link

Describe the feature

Description
question1: this is docker start demo,How does k8s set the port number to be used through environment variables
docker run --rm -it
-e MTX_PROTOCOLS=tcp
-e MTX_WEBRTCADDITIONALHOSTS=192.168.x.x
-p 8554:8554
-p 1935:1935
-p 8888:8888
-p 8889:8889
-p 8890:8890/udp
-p 8189:8189/udp
bluenviron/mediamtx

The environment variable specifies -e MTX_PROTOCOLS=tcp. Is public network access on port 8189 open for tcp or udp?

question 2:
I mounted it with a modified external profile to /mediamtx.yml
error log:
CreateContainerError (Error response from daemon: invalid volume specification: '/var/lib/kubelet/pods/5696e68d-3557-40a7-a008-9bcae27ef4e6/volume-subpaths/mediamtx-config/mediamtx/0:/:ro': invalid mount config for type "bind": invalid specification: destination can't be '/'

        - mountPath: /
          name: mediamtx-config
          subPath: mediamtx.yml
      volumes:
      - configMap:
          name: mediamtx-config
        name: mediamtx-config
@eravellaSC
Copy link

  1. your first question isn't clear: are you using docker to setup a mediamtx container or are you deploying it directly to kubernetes? You can also modify the mediamtx.yml file instead of using environmental variables, so that the configuration of mediamtx is stored in a single place and is easier to read
  2. I think here it's just a path problem: when you mount something to a container you have to specify two paths, one source and one target path, and here you are giving it just '/' for the target one (paths are separated with :). Seems linke you can't do that.

@liuxin638507
Copy link
Author

  1. your first question isn't clear: are you using docker to setup a mediamtx container or are you deploying it directly to kubernetes? You can also modify the mediamtx.yml file instead of using environmental variables, so that the configuration of mediamtx is stored in a single place and is easier to read
  2. I think here it's just a path problem: when you mount something to a container you have to specify two paths, one source and one target path, and here you are giving it just '/' for the target one (paths are separated with :). Seems linke you can't do that.

thanks
i modify the mediamtx.yml file instead of using environmental variables now

  1. i am sorry ,this is ok , - mountPath: /mediamtx.yml
        - mountPath: /mediamtx.yml
          name: mediamtx-config
          subPath: mediamtx.yml
      volumes:
      - configMap:
          name: mediamtx-config
        name: mediamtx-config

@aler9
Copy link
Member

aler9 commented May 13, 2024

Please use "questions" to ask "questions" instead of "feature request" and ask a question at a time as mentioned in the instructions.

@aler9 aler9 closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
@bluenviron bluenviron locked and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants