Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.2K
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!