Unverified Commit 2e309df0 authored by Matthew Fisher's avatar Matthew Fisher Committed by GitHub

Merge pull request #3836 from bacongobbler/rename-to-crd

rename TPR to CRD
parents 9b16c8d0 f52d0f4f
# Third Party Resources # Custom Resource Definitions
This section of the Best Practices Guide deals with creating and using Third Party Resource This section of the Best Practices Guide deals with creating and using Custom Resource Definition
objects. objects.
When working with Third Party Resources (TPRs), it is important to distinguish When working with Custom Resource Definitions (CRDs), it is important to distinguish
two different pieces: two different pieces:
- There is a declaration of a TPR. This is the YAML file that has the kind `ThirdPartyResource` - There is a declaration of a CRD. This is the YAML file that has the kind `CustomResourceDefinition`
- Then there are resources that _use_ the TPR. Say a TPR defines `foo.example.com/v1`. Any resource - Then there are resources that _use_ the CRD. Say a CRD defines `foo.example.com/v1`. Any resource
that has `apiVersion: example.com/v1` and kind `Foo` is a resource that uses the that has `apiVersion: example.com/v1` and kind `Foo` is a resource that uses the CRD.
TPR.
## Install a TPR Declaration Before Using the Resource ## Install a CRD Declaration Before Using the Resource
Helm is optimized to load as many resources into Kubernetes as fast as possible. Helm is optimized to load as many resources into Kubernetes as fast as possible.
By design, Kubernetes can take an entire set of manifests and bring them all By design, Kubernetes can take an entire set of manifests and bring them all
online (this is called the reconciliation loop). online (this is called the reconciliation loop).
But there's a difference with TPRs. But there's a difference with CRDs.
For a TPR, the declaration must be registered before any resources of that TPRs For a CRD, the declaration must be registered before any resources of that CRDs
kind(s) can be used. And the registration process sometimes takes a few seconds. kind(s) can be used. And the registration process sometimes takes a few seconds.
### Method 1: Separate Charts ### Method 1: Separate Charts
One way to do this is to put the TPR definition in one chart, and then put any One way to do this is to put the CRD definition in one chart, and then put any
resources that use that TPR in _another_ chart. resources that use that CRD in _another_ chart.
In this method, each chart must be installed separately. In this method, each chart must be installed separately.
### Method 2: Pre-install Hooks ### Method 2: Pre-install Hooks
To package the two together, add a `pre-install` hook to the TPR definition so To package the two together, add a `pre-install` hook to the CRD definition so
that it is fully installed before the rest of the chart is executed. that it is fully installed before the rest of the chart is executed.
Note that if you create the TPR with a `pre-install` hook, that TPR definition Note that if you create the CRD with a `pre-install` hook, that CRD definition
will not be deleted when `helm delete` is run. will not be deleted when `helm delete` is run.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment