Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

az k8s-configuration flux create -k 'wait: false' #27747

Closed schdief closed 2 weeks ago

schdief commented 1 year ago

Related command

az k8s-configuration flux create -k

https://learn.microsoft.com/de-de/cli/azure/k8s-configuration/flux?view=azure-cli-latest#az-k8s-configuration-flux-create-optional-parameters

Is your feature request related to a problem? Please describe. Yes, because the kustomization won't finish reconcilation in case a sub-resource fails as the wait option is always true. This is a problem since we have multiple individual deployments within our repo that are synced with a single Kustomization. If any deployment fails, this impacts the reconcilation of all deployments.

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  labels:
    clusterconfig.azure.com/is-managed: 'true'
    clusterconfig.azure.com/name: gitops
    clusterconfig.azure.com/namespace: flux-system
    clusterconfig.azure.com/operation-id: 9d1...
spec:
  force: true
  interval: 8m20s
  path: ./clusters/npi
  postBuild: {}
  prune: true
  retryInterval: 10m0s
  serviceAccountName: flux-applier
  sourceRef:
    kind: GitRepository
    name: gitops
    namespace: flux-system
  timeout: 5m0s
  wait: true

Describe the solution you'd like I would like to set the value of wait to false.

Describe alternatives you've considered We could create individual Kustomizations, but then they won't be part of our repository so a restore would be cumbersome. So the only alternative is not using the aks flux extension.

Additional context

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

NarayanThiru commented 10 months ago

@bavneetsingh16 , can you pl. take a look at this?

bavneetsingh16 commented 9 months ago

@schdief, we are planning a new cli release next month which will have the 'wait' parameter. Currently, it can be done by creating or updating the configuration via ARM template deployment, please find the example in the link below.

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/stable/2023-05-01/examples/CreateFluxConfiguration.json#L31

bavneetsingh16 commented 2 months ago

The release of this cli was delayed as it is going to be released with support for new source - ociRepositories. A new api version has been added for it and it will be introduced in the cli. The new eta for this release is early September.

bavneetsingh16 commented 2 weeks ago

Please update the k8s-configuration cli extension to the latest version to use wait(--disable-health-check) parameter.