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

1.2K
Vistas
Kubernetes deployment Error: unknown flag: --replicas issue

While creating a deployment using command

kubectl create deploy nginx --image=nginx:1.7.8 --replicas=2 --port=80

I am getting error Error: unknown flag: --replicas

controlplane $ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:58:59Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:50:46Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
controlplane $ kubectl create deploy nginx --image=nginx:1.7.8 --replicas=2 --port=80
Error: unknown flag: --replicas
See 'kubectl create deployment --help' for usage.

Could anyone please help me with the reason for this as this command is working on other Kubernetes clusters?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

It looks like that --replicas and --port flags were added in version 1.19 based on the v1-19 release notes and that's why you are seeing the error.

So, you need the minimum version 1.19 to able to use the replicas and port flags as part of the kubectl create deployment command.

You can however use the kubectl scale/expose command after creating the deployment.

Relevant PR links for replicas and port.

over 4 years ago · Santiago Trujillo Denunciar

0

You may try to put a blank character between -- and the commands For example

kubectl create deploy nginx --image=nginx:1.7.8 -- replicas=2

It's work for me.

over 4 years ago · Santiago Trujillo Denunciar

0

if you trying to update the replica parameter in Azure release pipeline inside the help upgrade command then refer to the following link Overriding Helm chart values

here it explains that you can override the parameters inside the vallues.yaml file with set command like this

helm upgrade $(RELEASE_ENV) --install  \
infravc/manifests/helm/web \
--set namespace=$(NAMESPACE) \
--set replicas=$(replicas) \
--set replicasMax=$(replicasMax) \
--set ingress.envSuffix=$(envSuffix) \
--set ENV.SECRET=$(appSecretNonprod) \
--set ENV.CLIENT_ID=$(clientIdNonprod) \
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