Skip to content

nixidy -- apply (direct mode, non-ArgoCD mode) may need --server-side option to kubectl apply #83

@brandonros

Description

@brandonros
customresourcedefinition.apiextensions.k8s.io/verticalpodautoscalers.autoscaling.k8s.io unchanged
Error from server (Invalid): error when creating "/nix/store/1giii5hzs084zd6plby95mil88vdcwwy-nixidy-declarative-package-optiplex/crds.yml": CustomResourceDefinition.apiextensions.k8s.io "atlasmigrations.db.atlasgo.io" is invalid: metadata.annotations: Too long: may not be more than 262144 bytes
Error from server (Invalid): error when creating "/nix/store/1giii5hzs084zd6plby95mil88vdcwwy-nixidy-declarative-package-optiplex/crds.yml": CustomResourceDefinition.apiextensions.k8s.io "atlasschemas.db.atlasgo.io" is invalid: metadata.annotations: Too long: may not be more than 262144 bytes
nix-update-optiplex() {
  echo "==> Updating optiplex..."
  ssh -A [email protected] "cd ~/dotfiles/nix && git pull \
    && sudo nixos-rebuild switch --flake .#optiplex \
    && nix run .#nixidy -- apply .#optiplex \
    && nix run .#dns-push \
    && nix run .#pg-push"
}

This is the classic "last-applied-configuration annotation too large" problem. When kubectl apply is used client-side, it stores the entire manifest in the kubectl.kubernetes.io/last-applied-configuration annotation, and the Atlas Operator CRDs are too big for the 256 KiB annotation limit.

The fix is to use server-side apply (kubectl apply --server-side), which doesn't store that annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions