-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a replicas configuration option for kustomize #11650
Comments
Sounds great to me. Want to open a PR? |
@crenshaw-dev |
I would love to do this with ApplicationSet as well @toyamagu-2021 ApplicationSet Example YamlapiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
namespace: argocd
spec:
generators:
- list:
elements:
- namespace: guestbook-qa
url: https://kubernetes.default.svc
values:
frontend:
replicas: 1
- namespace: guestbook-e2e
url: https://kubernetes.default.svc
values:
frontend:
replicas: 2
- namespace: guestbook-stage
url: https://kubernetes.default.svc
values:
frontend:
replicas: 3
- namespace: guestbook-prod
url: https://kubernetes.default.svc
values:
frontend:
replicas: 5
template:
metadata:
name: '{{namespace}}'
spec:
project: gitops
source:
repoURL: https://gitlab.com/kubernetes-practice/my-k8s/kia.git
targetRevision: HEAD
path: gitops-and-kubernetes/guestbook
kustomize:
replicas:
- name: frontend
count: '{{values.frontend.replicas}}'
destination:
server: '{{url}}'
namespace: '{{namespace}}'
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true |
@maltewhiite applicationset.yamlapiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
namespace: argocd
spec:
generators:
- list:
elements:
- namespace: guestbook-qa
url: https://kubernetes.default.svc
values:
replicas: "1"
- namespace: guestbook-e2e
url: https://kubernetes.default.svc
values:
replicas: "2"
- namespace: guestbook-stage
url: https://kubernetes.default.svc
values:
replicas: "3"
- namespace: guestbook-prod
url: https://kubernetes.default.svc
values:
replicas: "5"
template:
metadata:
name: '{{namespace}}'
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: HEAD
path: kustomize-guestbook
kustomize:
replicas:
- name: kustomize-guestbook-ui
count: '{{values.replicas}}'
destination:
server: '{{url}}'
namespace: '{{namespace}}'
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true Please let me know if there is any misunderstanding. |
@toyamagu-2021 Looks great! Thank you very much. Ideally my team would use auto-scalers, but this will help for sure. |
* codes Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * codegen Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * docs Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * refactor Signed-off-by: toyamagu <toyamagu2021@gmail.com> * fix omitenmpty Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * fix typos and add tests Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * codegen Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * chainge KustomizeReplica.counts type from int to intstr.IntOrString Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * add namespace to zero-check Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> Signed-off-by: toyamagu <toyamagu2021@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* codes Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * codegen Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * docs Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * refactor Signed-off-by: toyamagu <toyamagu2021@gmail.com> * fix omitenmpty Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * fix typos and add tests Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * codegen Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * chainge KustomizeReplica.counts type from int to intstr.IntOrString Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> * add namespace to zero-check Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com> Signed-off-by: toyamagu <toyamagu2021@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Summary
Currently, kustomize configuration options are available only for
namePrefix
,nameSuffix
,images
,commonLabels
,commonAnnotations
according to argocd-doc.I would like to see a replicas transformer to change a number of replicas kustomize-doc.
Motivation
I would like to change the number of replicas in
application.yaml
. Like,Proposal
I think it is straightforward.
kustomize edit set replicas deployment-name=5
.argo-cd/util/kustomize/kustomize.go
Line 87 in b4c1281
The text was updated successfully, but these errors were encountered: