mirror of https://github.com/helm/helm
commit
ae5d13c5e1
@ -0,0 +1,9 @@
|
|||||||
|
<!-- If you need help or think you have found a bug, please help us with your issue by entering the following information (otherwise you can delete this text): -->
|
||||||
|
|
||||||
|
Output of `helm version`:
|
||||||
|
|
||||||
|
Output of `kubectl version`:
|
||||||
|
|
||||||
|
Cloud Provider/Platform (AKS, GKE, Minikube etc.):
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
# Custom Resource Definitions
|
||||||
|
|
||||||
|
This section of the Best Practices Guide deals with creating and using Custom Resource Definition
|
||||||
|
objects.
|
||||||
|
|
||||||
|
When working with Custom Resource Definitions (CRDs), it is important to distinguish
|
||||||
|
two different pieces:
|
||||||
|
|
||||||
|
- There is a declaration of a CRD. This is the YAML file that has the kind `CustomResourceDefinition`
|
||||||
|
- 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 CRD.
|
||||||
|
|
||||||
|
## Install a CRD Declaration Before Using the Resource
|
||||||
|
|
||||||
|
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
|
||||||
|
online (this is called the reconciliation loop).
|
||||||
|
|
||||||
|
But there's a difference with CRDs.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Method 1: Separate Charts
|
||||||
|
|
||||||
|
One way to do this is to put the CRD definition in one chart, and then put any
|
||||||
|
resources that use that CRD in _another_ chart.
|
||||||
|
|
||||||
|
In this method, each chart must be installed separately.
|
||||||
|
|
||||||
|
### Method 2: Pre-install Hooks
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Note that if you create the CRD with a `pre-install` hook, that CRD definition
|
||||||
|
will not be deleted when `helm delete` is run.
|
@ -1,38 +0,0 @@
|
|||||||
# Third Party Resources
|
|
||||||
|
|
||||||
This section of the Best Practices Guide deals with creating and using Third Party Resource
|
|
||||||
objects.
|
|
||||||
|
|
||||||
When working with Third Party Resources (TPRs), it is important to distinguish
|
|
||||||
two different pieces:
|
|
||||||
|
|
||||||
- There is a declaration of a TPR. This is the YAML file that has the kind `ThirdPartyResource`
|
|
||||||
- Then there are resources that _use_ the TPR. Say a TPR defines `foo.example.com/v1`. Any resource
|
|
||||||
that has `apiVersion: example.com/v1` and kind `Foo` is a resource that uses the
|
|
||||||
TPR.
|
|
||||||
|
|
||||||
## Install a TPR Declaration Before Using the Resource
|
|
||||||
|
|
||||||
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
|
|
||||||
online (this is called the reconciliation loop).
|
|
||||||
|
|
||||||
But there's a difference with TPRs.
|
|
||||||
|
|
||||||
For a TPR, the declaration must be registered before any resources of that TPRs
|
|
||||||
kind(s) can be used. And the registration process sometimes takes a few seconds.
|
|
||||||
|
|
||||||
### Method 1: Separate Charts
|
|
||||||
|
|
||||||
One way to do this is to put the TPR definition in one chart, and then put any
|
|
||||||
resources that use that TPR in _another_ chart.
|
|
||||||
|
|
||||||
In this method, each chart must be installed separately.
|
|
||||||
|
|
||||||
### Method 2: Pre-install Hooks
|
|
||||||
|
|
||||||
To package the two together, add a `pre-install` hook to the TPR definition so
|
|
||||||
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
|
|
||||||
will not be deleted when `helm delete` is run.
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1,3 @@
|
|||||||
# This is a placeholder.
|
# This is a placeholder.
|
||||||
|
|
||||||
|
Goodbye {{.Values.name | default "world"}}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package helm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestNewClient(t *testing.T) {
|
||||||
|
helmClient := NewClient()
|
||||||
|
if helmClient.opts.connectTimeout != 5*time.Second {
|
||||||
|
t.Errorf("expected default timeout duration to be 5 seconds, got %v", helmClient.opts.connectTimeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
helmClient = NewClient(ConnectTimeout(60))
|
||||||
|
if helmClient.opts.connectTimeout != time.Minute {
|
||||||
|
t.Errorf("expected timeout duration to be 1 minute, got %v", helmClient.opts.connectTimeout)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue