github.com/argoproj-labs/argocd-operator@v0.10.0/examples/argocd-resource-customizations.yaml (about)

     1  apiVersion: argoproj.io/v1alpha1
     2  kind: ArgoCD
     3  metadata:
     4    name: argocd
     5  spec:
     6    resourceIgnoreDifferences:
     7      all:
     8        jsonPointers:
     9          - /spec/replicas
    10        managedFieldsManagers:
    11          - kube-controller-manager
    12      resourceIdentifiers:
    13        - group: admissionregistration.k8s.io
    14          kind: MutatingWebhookConfiguration
    15          customization:
    16            jqPathExpressions:
    17              - '.webhooks[]?.clientConfig.caBundle'
    18        - group: apps
    19          kind: Deployment
    20          customization:
    21            managedFieldsManagers:
    22              - kube-controller-manager
    23            jsonPointers:
    24              - /spec/replicas
    25    resourceHealthChecks:
    26      - group: certmanager.k8s.io
    27        kind: Certificate
    28        check: |
    29          hs = {}
    30          if obj.status ~= nil then
    31            if obj.status.conditions ~= nil then
    32              for i, condition in ipairs(obj.status.conditions) do
    33                if condition.type == "Ready" and condition.status == "False" then
    34                  hs.status = "Degraded"
    35                  hs.message = condition.message
    36                  return hs
    37                end
    38                if condition.type == "Ready" and condition.status == "True" then
    39                  hs.status = "Healthy"
    40                  hs.message = condition.message
    41                  return hs
    42                end
    43              end
    44            end
    45          end
    46          hs.status = "Progressing"
    47          hs.message = "Waiting for certificate"
    48          return hs
    49    resourceActions:
    50      - group: apps
    51        kind: Deployment
    52        action: |
    53          discovery.lua: |
    54          actions = {}
    55          actions["restart"] = {}
    56          return actions
    57          definitions:
    58          - name: restart
    59            # Lua Script to modify the obj
    60            action.lua: |
    61              local os = require("os")
    62              if obj.spec.template.metadata == nil then
    63                  obj.spec.template.metadata = {}
    64              end
    65              if obj.spec.template.metadata.annotations == nil then
    66                  obj.spec.template.metadata.annotations = {}
    67              end
    68              obj.spec.template.metadata.annotations["kubectl.kubernetes.io/restartedAt"] = os.date("!%Y-%m-%dT%XZ")
    69              return obj