Skip to content

Instantly share code, notes, and snippets.

@chaliy
Created March 10, 2021 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaliy/aa6064eb72c7a4b4916bb980828a14fc to your computer and use it in GitHub Desktop.
Save chaliy/aa6064eb72c7a4b4916bb980828a14fc to your computer and use it in GitHub Desktop.
# Flux2 install for Kubernetes v1.15.0
flux install --export --watch-all-namespaces=false -n {{inputs.parameters.namespace}} | \
yq4 e 'select(.kind == "CustomResourceDefinition").apiVersion = "apiextensions.k8s.io/v1beta1"' - | \
yq4 e 'select(.kind == "CustomResourceDefinition").spec.additionalPrinterColumns = select(.kind == "CustomResourceDefinition").spec.versions[0].additionalPrinterColumns' - | \
yq4 e 'del(select(.kind == "CustomResourceDefinition").spec.versions[].additionalPrinterColumns)' - | \
yq4 e 'select(.kind == "CustomResourceDefinition").spec.validation = select(.kind == "CustomResourceDefinition").spec.versions[0].schema' - | \
yq4 e 'del(select(.kind == "CustomResourceDefinition").spec.versions[0].schema)' - | \
yq4 e 'select(.kind == "CustomResourceDefinition").spec.subresources = select(.kind == "CustomResourceDefinition").spec.versions[0].subresources' - | \
yq4 e 'del(select(.kind == "CustomResourceDefinition").spec.versions[0].subresources)' - | \
yq4 e 'del(.. | select(has("default")).default)' - | \
sed 's/jsonPath/JSONPath/' | \
sed 's/^{}//' | kubectl apply -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment