blob: aeb10c0e454759126c7d2e566eecd565cc656fcc [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
tmeneaucf41dc32017-10-16 15:23:05 -040094See the [pillar.example](pillar.example) for a documented example pillar file.
95
96Example Configurations
97======================
98
99_The following examples demonstrate configuring the formula for different
100use cases._
101
tmeneau0f7e6d42017-10-16 17:18:29 -0400102The default pillar configuration will install the helm client on the target
103node, and Tiller to the Kubernetes cluster (assuming kubectl config or local
104cluster endpoint have already been configured.
Yuriy Taraday434490c2017-08-22 17:40:01 +0400105
106Change version of helm being downloaded and installed:
107
108.. code-block:: yaml
109
110 helm:
111 client:
tmeneaucf41dc32017-10-16 15:23:05 -0400112 version: 2.6.0 # defaults to 2.6.2 currently
Yuriy Taraday434490c2017-08-22 17:40:01 +0400113 download_hash: sha256=youneedtocalculatehashandputithere
114
115Don't install tiller and use existing one exposed on some well-known address:
116
117.. code-block:: yaml
118
119 helm:
120 client:
121 tiller:
122 install: false
123 host: 10.11.12.13:14151
124
125Change namespace where tiller is isntalled and looked for:
126
127.. code-block:: yaml
128
129 helm:
130 client:
131 tiller:
132 namespace: not-kube-system # kube-system is default
133
134Install Mirantis repository and deploy zookeper chart from it:
135
136.. code-block:: yaml
137
138 helm:
139 client:
140 repos:
141 mirantisworkloads: https://mirantisworkloads.storage.googleapis.com/
142 releases:
143 zoo1:
144 name: my-zookeeper
145 chart: mirantisworkloads/zookeeper # we reference installed repo
146 version: 1.2.0 # select any available version
147 values:
148 logLevel: INFO # any values used by chart can specified here
149
150Delete that release:
151
152.. code-block:: yaml
153
154 helm:
155 client:
156 repos:
157 mirantisworkloads: https://mirantisworkloads.storage.googleapis.com/
158 releases:
159 zoo1:
160 enabled: false
161
162Install kubectl and manage remote cluster:
163
164.. code-block:: yaml
165
166 helm:
167 client:
168 kubectl:
169 install: true # installs kubectl 1.6.7 by default
170 config:
tmeneaucf41dc32017-10-16 15:23:05 -0400171 # directly translated to cluster definition in kubeconfig
172 cluster:
Yuriy Taraday434490c2017-08-22 17:40:01 +0400173 server: https://kubernetes.example.com
174 certificate-authority-data: base64_of_ca_certificate
tmeneaucf41dc32017-10-16 15:23:05 -0400175 cluster_name: kubernetes.example
176 # directly translated to user definition in kubeconfig
177 user:
Yuriy Taraday434490c2017-08-22 17:40:01 +0400178 username: admin
179 password: uberadminpass
tmeneaucf41dc32017-10-16 15:23:05 -0400180 user_name: admin
Yuriy Taraday434490c2017-08-22 17:40:01 +0400181
182Change kubectl download URL and use it with GKE-based cluster:
183
184.. code-block:: yaml
185
186 helm:
187 client:
188 kubectl:
189 install: true
190 download_url: https://dl.k8s.io/v1.6.7/kubernetes-client-linux-amd64.tar.gz
191 download_hash: sha256=calculate_hash_here
192 config:
tmeneaucf41dc32017-10-16 15:23:05 -0400193 # directly translated to cluster definition in kubeconfig
194 cluster:
Yuriy Taraday434490c2017-08-22 17:40:01 +0400195 server: https://3.141.59.265
196 certificate-authority-data: base64_of_ca_certificate
tmeneaucf41dc32017-10-16 15:23:05 -0400197 # directly translated to user definition in kubeconfig
Yuriy Taraday434490c2017-08-22 17:40:01 +0400198 user:
199 auth-provider:
200 name: gcp
tmeneaucf41dc32017-10-16 15:23:05 -0400201 user_name: gce_user
Yuriy Taraday434490c2017-08-22 17:40:01 +0400202 gce_service_token: base64_of_json_token_downloaded_from_cloud_console
Yuriy Taraday131227e2017-06-22 15:09:34 +0400203
tmeneaud92f4742017-10-18 09:57:19 -0400204Known Issues
205============
206
2071. Unable to remove all user supplied values
208
209If a release previously has had user supplied value overrides (via the
210release's `values` key in the pillar), subsequently removing all `values`
211overrides (so that there is no more `values` key for the release in the
212pillar) will not actually update the Helm deployment. To get around this,
213specify a fake key/value pair in the release's pillar; Tiller will override
214all previously user-supplied values with the new fake key and value. For
215example:
216
217
218.. code-block:: yaml
219 helm:
220 client:
221 releases:
222 zoo1:
223 enabled: true
224 ...
225 values:
226 fake_key: fake_value
227
Yuriy Taraday131227e2017-06-22 15:09:34 +0400228
Ales Komarekba180382017-09-14 09:42:03 +0200229More Information
230================
Yuriy Taraday131227e2017-06-22 15:09:34 +0400231
Ales Komarekba180382017-09-14 09:42:03 +0200232* https://github.com/kubernetes/charts
233* https://fabric8.io/helm/
Yuriy Taraday131227e2017-06-22 15:09:34 +0400234
235
Ales Komarekba180382017-09-14 09:42:03 +0200236Documentation and Bugs
237======================
Yuriy Taraday131227e2017-06-22 15:09:34 +0400238
Ales Komarekba180382017-09-14 09:42:03 +0200239To learn how to install and update salt-formulas, consult the documentation
240available online at:
Yuriy Taraday131227e2017-06-22 15:09:34 +0400241
Ales Komarekba180382017-09-14 09:42:03 +0200242 http://salt-formulas.readthedocs.io/
243
244In the unfortunate event that bugs are discovered, they should be reported to
245the appropriate issue tracker. Use Github issue tracker for specific salt
246formula:
247
248 https://github.com/salt-formulas/salt-formula-helm/issues
249
250For feature requests, bug reports or blueprints affecting entire ecosystem,
251use Launchpad salt-formulas project:
252
253 https://launchpad.net/salt-formulas
254
255You can also join salt-formulas-users team and subscribe to mailing list:
256
257 https://launchpad.net/~salt-formulas-users
258
259Developers wishing to work on the salt-formulas projects should always base
260their work on master branch and submit pull request against specific formula.
261
262 https://github.com/salt-formulas/salt-formula-home-assistant
263
264Any questions or feedback is always welcome so feel free to join our IRC
265channel:
266
267 #salt-formulas @ irc.freenode.net