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

1.2K
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 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