blob: 76c8463fecb4c4fba0fa929f1e62a0f5b3f44b14 [file] [log] [blame]
Yuriy Taraday131227e2017-06-22 15:09:34 +04001
Ales Komarekba180382017-09-14 09:42:03 +02002============
3Helm formula
4============
Yuriy Taraday131227e2017-06-22 15:09:34 +04005
Yuriy Taraday434490c2017-08-22 17:40:01 +04006This formula installs Helm client, installs Tiller on Kubernetes cluster and
tmeneaud92f4742017-10-18 09:57:19 -04007manages releases in it.
8
9Availale States
10===============
11
12The default state applied by this formula (e.g. if just applying `helm`) will
13apply the `helm.releases_managed` state.
14
15`kubectl_installed`
16------------------
17
18Optionally installs the kubectl binary per the configured pillar values,
19such as the version of `kubectl` to instlal and the path where the binary should
20be installed.
21
22`kubectl_configured`
23------------------
24
25Manages a kubectl configuration file and gce_token json file per the configured
26pillar values. Note that the available configuration values allow the path of
27the kube config file to be placed at a different location than the default
28installation path; this is recommended to avoid confusion if the kubectl
29binary on the minion might be manually used with multiple contexts.
30
31**includes**:
32* `kubectl_installed`
33
34`client_installed`
35------------------
36
37Installs the helm client binary per the configured pillar values, such as where
38helm home should be, which version of the helm binary to install and that path
39for the helm binary.
40
41**includes**:
42* `kubectl_installed
43
44`tiller_installed`
45------------------
46
47Optionally installs a Tiller deployment to the kubernetes cluster per the
48`helm:client:tiller:install` pillar value. If the pillar value is set to
49install tiller to the cluster, the version of the tiller installation will
50match the version of the Helm client installed per the `helm:client:version`
51configuration parameter
52
53**includes**:
54* `client_installed`
55* `kubectl_configured`
56
57`repos_managed`
58------------------
59
60Ensures the repositories configured per the pillar (and only those repositories)
61are registered at the configured helm home, and synchronizes the local cache
62with the remote repository with each state execution.
63
64**includes**:
65* `client_installed`
66
67`releases_managed`
68------------------
69
70Ensures the releases configured with the pillar are in the expected state with
71the Kubernetes cluster. This state includes change detection to determine
72whether the pillar configurations match the release's state in the cluster.
73
74Note that changes to an existing release's namespace will trigger a deletion and
75re-installation of the release to the cluster.
76
77**includes**:
78* `client_installed`
79* `tiller_installed`
80* `kubectl_configured`
81* `repos_managed`
82
83Availale Modules
84===============
85
86To view documentation on the available modules, run:
87
88`salt '{{ tgt }}' sys.doc helm`
Yuriy Taraday131227e2017-06-22 15:09:34 +040089
Ales Komarekba180382017-09-14 09:42:03 +020090
Yuriy Taraday131227e2017-06-22 15:09:34 +040091Sample pillars
92==============
93
tmeneau42a2ccd2017-11-01 13:55:49 -040094See the [default reclass pillar configuration](metadata/service/client.yml) for
95a documented example pillar file.
tmeneaucf41dc32017-10-16 15:23:05 -040096
97Example Configurations
98======================
99
100_The following examples demonstrate configuring the formula for different
101use cases._
102
tmeneau0f7e6d42017-10-16 17:18:29 -0400103The default pillar configuration will install the helm client on the target
104node, and Tiller to the Kubernetes cluster (assuming kubectl config or local
105cluster endpoint have already been configured.
Yuriy Taraday434490c2017-08-22 17:40:01 +0400106
107Change version of helm being downloaded and installed:
108
109.. code-block:: yaml
110
111 helm:
112 client:
tmeneaucf41dc32017-10-16 15:23:05 -0400113 version: 2.6.0 # defaults to 2.6.2 currently
Yuriy Taraday434490c2017-08-22 17:40:01 +0400114 download_hash: sha256=youneedtocalculatehashandputithere
115
116Don't install tiller and use existing one exposed on some well-known address:
117
118.. code-block:: yaml
119
120 helm:
121 client:
122 tiller:
123 install: false
124 host: 10.11.12.13:14151
125
126Change namespace where tiller is isntalled and looked for:
127
128.. code-block:: yaml
129
130 helm:
131 client:
132 tiller:
133 namespace: not-kube-system # kube-system is default
134
135Install Mirantis repository and deploy zookeper chart from it:
136
137.. code-block:: yaml
138
139 helm:
140 client:
141 repos:
142 mirantisworkloads: https://mirantisworkloads.storage.googleapis.com/
143 releases:
144 zoo1:
145 name: my-zookeeper
146 chart: mirantisworkloads/zookeeper # we reference installed repo
147 version: 1.2.0 # select any available version
148 values:
149 logLevel: INFO # any values used by chart can specified here
150
151Delete that release:
152
153.. code-block:: yaml
154
155 helm:
156 client:
157 repos:
158 mirantisworkloads: https://mirantisworkloads.storage.googleapis.com/
159 releases:
160 zoo1:
161 enabled: false
162
163Install kubectl and manage remote cluster:
164
165.. code-block:: yaml
166
167 helm:
168 client:
169 kubectl:
170 install: true # installs kubectl 1.6.7 by default
171 config:
tmeneaucf41dc32017-10-16 15:23:05 -0400172 # directly translated to cluster definition in kubeconfig
173 cluster:
Yuriy Taraday434490c2017-08-22 17:40:01 +0400174 server: https://kubernetes.example.com
175 certificate-authority-data: base64_of_ca_certificate
tmeneaucf41dc32017-10-16 15:23:05 -0400176 cluster_name: kubernetes.example
177 # directly translated to user definition in kubeconfig
178 user:
Yuriy Taraday434490c2017-08-22 17:40:01 +0400179 username: admin
180 password: uberadminpass
tmeneaucf41dc32017-10-16 15:23:05 -0400181 user_name: admin
Yuriy Taraday434490c2017-08-22 17:40:01 +0400182
183Change kubectl download URL and use it with GKE-based cluster:
184
185.. code-block:: yaml
186
187 helm:
188 client:
189 kubectl:
190 install: true
191 download_url: https://dl.k8s.io/v1.6.7/kubernetes-client-linux-amd64.tar.gz
192 download_hash: sha256=calculate_hash_here
193 config:
tmeneaucf41dc32017-10-16 15:23:05 -0400194 # directly translated to cluster definition in kubeconfig
195 cluster:
Yuriy Taraday434490c2017-08-22 17:40:01 +0400196 server: https://3.141.59.265
197 certificate-authority-data: base64_of_ca_certificate
tmeneaucf41dc32017-10-16 15:23:05 -0400198 # directly translated to user definition in kubeconfig
Yuriy Taraday434490c2017-08-22 17:40:01 +0400199 user:
200 auth-provider:
201 name: gcp
tmeneaucf41dc32017-10-16 15:23:05 -0400202 user_name: gce_user
Yuriy Taraday434490c2017-08-22 17:40:01 +0400203 gce_service_token: base64_of_json_token_downloaded_from_cloud_console
Yuriy Taraday131227e2017-06-22 15:09:34 +0400204
tmeneaud92f4742017-10-18 09:57:19 -0400205Known Issues
206============
207
2081. Unable to remove all user supplied values
209
210If a release previously has had user supplied value overrides (via the
211release's `values` key in the pillar), subsequently removing all `values`
212overrides (so that there is no more `values` key for the release in the
213pillar) will not actually update the Helm deployment. To get around this,
214specify a fake key/value pair in the release's pillar; Tiller will override
215all previously user-supplied values with the new fake key and value. For
216example:
217
218
219.. code-block:: yaml
220 helm:
221 client:
222 releases:
223 zoo1:
224 enabled: true
225 ...
226 values:
227 fake_key: fake_value
228
Yuriy Taraday131227e2017-06-22 15:09:34 +0400229
Ales Komarekba180382017-09-14 09:42:03 +0200230More Information
231================
Yuriy Taraday131227e2017-06-22 15:09:34 +0400232
Ales Komarekba180382017-09-14 09:42:03 +0200233* https://github.com/kubernetes/charts
234* https://fabric8.io/helm/
Yuriy Taraday131227e2017-06-22 15:09:34 +0400235
236
Ales Komarekba180382017-09-14 09:42:03 +0200237Documentation and Bugs
238======================
Yuriy Taraday131227e2017-06-22 15:09:34 +0400239
Ales Komarekba180382017-09-14 09:42:03 +0200240To learn how to install and update salt-formulas, consult the documentation
241available online at:
Yuriy Taraday131227e2017-06-22 15:09:34 +0400242
Ales Komarekba180382017-09-14 09:42:03 +0200243 http://salt-formulas.readthedocs.io/
244
245In the unfortunate event that bugs are discovered, they should be reported to
246the appropriate issue tracker. Use Github issue tracker for specific salt
247formula:
248
249 https://github.com/salt-formulas/salt-formula-helm/issues
250
251For feature requests, bug reports or blueprints affecting entire ecosystem,
252use Launchpad salt-formulas project:
253
254 https://launchpad.net/salt-formulas
255
256You can also join salt-formulas-users team and subscribe to mailing list:
257
258 https://launchpad.net/~salt-formulas-users
259
260Developers wishing to work on the salt-formulas projects should always base
261their work on master branch and submit pull request against specific formula.
262
263 https://github.com/salt-formulas/salt-formula-home-assistant
264
265Any questions or feedback is always welcome so feel free to join our IRC
266channel:
267
268 #salt-formulas @ irc.freenode.net