Cloud / HELM Interview Questions
What are CRDs in Helm and best practices for managing them?
Custom Resource Definitions (CRDs) extend Kubernetes API with custom resources. Helm has special handling for CRDs because they must exist before custom resource instances are created.
CRD directory structure: Place CRD YAML files in crds/ directory at chart root (not in templates/). Helm installs all *.yaml files in crds/ BEFORE rendering any templates - this ensures CRDs exist for any Custom Resource instances defined in templates.
Example CRD (crds/crontab-crd.yaml):
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
names:
kind: CronTab
plural: crontabs
scope: Namespaced
versions:
- name: v1
served: true
storage: true
CRD limitations in Helm:
- CRDs are not upgraded or deleted by Helm (by design - prevents data loss)
- CRDs cannot be templated (no Go template support in crds/)
- CRDs are installed only on install, NOT on upgrade
- If CRD changes, you must manually apply or use hooks
Best practices:
- Use separate "crd-chart" that only contains CRDs (library chart pattern)
- Version CRDs separately from application charts
- For upgrades requiring CRD changes:
kubectl apply -f crds/manually, thenhelm upgrade - Consider using Helm hooks for complex CRD upgrade workflows:
annotations: "helm.sh/hook": pre-install,pre-upgrade - Use
--skip-crdsflag if CRDs are managed externally - Test CRD upgrades in staging first - CRD changes can be irreversible
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
