Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda