Skip to content

Instantly share code, notes, and snippets.

@stepanstipl
Last active October 24, 2019 17:42
Show Gist options
  • Save stepanstipl/a4823dfb0a757bc1ac2d74faceb70060 to your computer and use it in GitHub Desktop.
Save stepanstipl/a4823dfb0a757bc1ac2d74faceb70060 to your computer and use it in GitHub Desktop.
Helm - crd-install hook behaviour
bash-4.4# kubectl get crd | grep test
bash-4.4#
bash-4.4# helm install /charts/test/
NAME:   xrayed-ladybug
LAST DEPLOYED: Thu Oct 24 17:38:10 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ServiceAccount
NAME  SECRETS  AGE
test  1        1s


bash-4.4# kubectl get crd | grep test
tests.test.io                                  2019-10-24T17:38:10Z
bash-4.4#
bash-4.4# helm delete xrayed-ladybug
release "xrayed-ladybug" deleted
bash-4.4#
bash-4.4# kubectl get crd | grep test
tests.test.io
name: test-crd
version: v0.0.1
appVersion: v0.0.1
# This si just because of another Helm issue
# it will fail release if only resources with hooks are present
apiVersion: v1
kind: ServiceAccount
metadata:
name: test
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tests.test.io
annotations:
"helm.sh/hook": crd-install
spec:
group: test.io
version: v1alpha1
scope: Namespaced
names:
kind: Test
plural: tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment