Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
Specify nodeport when creating deployment in Minikube

This requirement is primarily for a development environment.

As I update a docker image using which a deployment is created and exposed through Minikube, I have to delete and re-create this deployment and service. However, I'd like to maintain the same nodeport that was assigned to that particular service. I know that if left to Minikube, a random port is assigned. But can I specify the NodePort?

I create the deployment using the following Yaml file and expose the service through the expose command.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: dpl_name
spec:
  template:
    metadata:
      labels:
        app: app_name
    spec:
      containers:
      - name: ctr_name
        image: 192.168.42.22:80/imagename:latest
        ports:
        - containerPort: 8090
        volumeMounts:
        - mountPath: /var/containerdata
          name: vlm
      volumes:
        - name: vlm
          hostPath:
            path: '/data/vlm'
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can expose the deployment by creating a service of type NodePort and specifying the nodePort value in that .yaml configuration:

kind: Service
apiVersion: v1
metadata:
  name: app_name
  labels:
    app: app_name
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 8090
    nodePort: 30000 # <--
  selector:
    app: app_name

This will specify to always use the nodePort value: 30000

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda