Skip to content
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

Annotation not working argocd.argoproj.io/sync-options: Force=true,Replace=true #578

Open
ybucci opened this issue May 16, 2024 · 0 comments

Comments

@ybucci
Copy link

ybucci commented May 16, 2024

I Using the latest version ArgoCD 2.11, but the annotation not working

error when replacing "/dev/shm/2809239019": EC2NodeClass.karpenter.k8s.aws "aws-node-template" is invalid: spec.role: Invalid value: "string": immutable field changed

apiVersion: karpenter.k8s.aws/v1beta1
kind: EC2NodeClass
metadata:
  annotations:
    argocd.argoproj.io/sync-options: Force=true,Replace=true
  name: aws-node-template
spec:
  amiFamily: Bottlerocket
  blockDeviceMappings:
  - deviceName: /dev/xvda
    ebs:
      deleteOnTermination: true
      encrypted: true
      volumeSize: 4Gi
      volumeType: gp3
  - deviceName: /dev/xvdb
    ebs:
      deleteOnTermination: true
      encrypted: true
      volumeSize: 120Gi
      volumeType: gp3
  metadataOptions:
    httpEndpoint: enabled
    httpProtocolIPv6: disabled
    httpPutResponseHopLimit: 2
    httpTokens: required
  role: XXXXXXXX
  securityGroupSelectorTerms:
  - tags:
      karpenter.sh/discovery: XXXXXXXX
  subnetSelectorTerms:
  - tags:
      Name: '*private*'
  tags:
    karpenter.sh/discovery: XXXXXXXX
{{- if and .Values.karpenterTemplates .Values.karpenterTemplates.enable -}}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: karpenter-templates
  namespace: {{ .Values.argoNamespace | default "argocd" }}
  annotations:
    argocd.argoproj.io/sync-wave: "{{ .Values.karpenterTemplates.syncWave | default '0' }}"
  labels:
    app: "karpenter-templates"
    env: "{{ .Values.environment }}"
    clusterName: "{{ .Values.clusterName }}"
spec:
  project: {{ .Values.argoProject | default "default" }}
  source:
    repoURL: {{ .Values.repoUrl }}
    path: 05-helm/karpenter-templates
    targetRevision: {{ .Values.targetRevision }}
    helm:
      values: |-
{{- toYaml .Values.karpenterTemplates | nindent 8 }}
  destination:
    server: {{ .Values.destinationServer | default "https://kubernetes.default.svc" }}
    namespace: {{ .Values.karpenterTemplates.namespace }}
  syncPolicy:
    automated:
      prune: true
      selfHeal: true 
    syncOptions:
#      - Replace=true
      - CreateNamespace=true
      # - ApplyOutOfSyncOnly=true
      # - ServerSideApply=true
      # - Force=true
    retry:
      limit: 10
      backoff:
        duration: 5s
        factor: 2
        maxDuration: 1m
{{- end -}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant