kubes 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb0b62ecd7b432896bd1fbafc3aeae759f858bcbfb0f2ca9a02ecb60d91fcff3
4
- data.tar.gz: 7faf78784573d6d1058fb3641e47356bf725c683cdfc53b081d8926bf2799249
3
+ metadata.gz: ce0d27f928a17e1013e97242990213cd4b375aee110dc14d3effc9aa8df2d490
4
+ data.tar.gz: 983312b9f64da2641ec8286dc76b9e7582dac9a575f77222ab4e9f9a145d26dd
5
5
  SHA512:
6
- metadata.gz: b7d432057c49947c864594fb2049677b721ff084ccd60403a39e7e360aa2a05157fddef26593004a836eb130d39a2307c6443438861be119affe66a182a05380
7
- data.tar.gz: 4a99ff9b1819db41ad13f1340707242a978c37cc83d7dbe8e10a6cf06cac9c3aa65335d9e6d8fc94a500cd267d3b197940d49ec71f76f4a4cb81c5ab71efff9f
6
+ metadata.gz: 36dc2af17c87d9c58eca05f8f63848f57d95cccdfcd51894ddb467c7424c7eefade4aed9133c871f400f05997143d1f537aeb38c1d8288815ab05558f25ae31c
7
+ data.tar.gz: 3ed8687d0f1af629a7645a002536e7a187057ea2da504e52fb3227da933b4a0c98db8ad0f1170a2a720248cbe517f7206ad8941299467695772d5fca289c1160
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.6.4] - 2020-11-11
7
+ - [#38](https://github.com/boltops-tools/kubes/pull/38) fix auto auth for docker login to registry, docs for secret base64, update dependencies
8
+
6
9
  ## [0.6.3] - 2020-11-11
7
10
  - [#37](https://github.com/boltops-tools/kubes/pull/37) Dockerfile for ci and hook updates
8
11
 
@@ -26,16 +26,4 @@ There are also provider-specific helpers:
26
26
  * [AWS Helpers]({% link _docs/helpers/aws.md %})
27
27
  * [Google Helpers]({% link _docs/helpers/google.md %})
28
28
 
29
- ## Generator
30
-
31
- To help you get started quickly, you can generate starter helper code.
32
-
33
- $ kubes new helper custom
34
- create .kubes/helpers/custom_helper.rb
35
-
36
- .kubes/helpers/custom_helper.rb
37
-
38
- ```ruby
39
- module CustomHelper
40
- end
41
- ```
29
+ {% include helpers/generator.md %}
@@ -45,11 +45,23 @@ data:
45
45
  USER: dGVzdDIK
46
46
  ```
47
47
 
48
- The values are automatically base64 encoded.
48
+ By default, the values are automatically base64 encoded.
49
49
 
50
50
  ## Base64 Option
51
51
 
52
- The value is automatically base64 encoded. You can set the `base64` option to turn on and off the automated base64 encoding.
52
+ By default, the values are automatically base64 encoded. You can change the default behavior with a config option.
53
+
54
+ .kubes/config.rb
55
+
56
+ ```ruby
57
+ KubesAws.configure do |config|
58
+ config.base64_secrets = false
59
+ end
60
+ ```
61
+
62
+ Note: The use of `KubesAws.configure` instead of `Kubes.configure` here.
63
+
64
+ You can also set the `base64` option to turn on and off the automated base64 encoding on a per secret basis.
53
65
 
54
66
  ```ruby
55
67
  aws_secret("demo-#{Kubes.env}-USER", base64: true) # default is base64=true
@@ -44,11 +44,11 @@ data:
44
44
  USER: dGVzdDIK
45
45
  ```
46
46
 
47
- The values are automatically base64 encoded.
47
+ The values are base64 encoded based on the SSM parameter type. When the type is a `SecureString`, Kubes base64 encodes it. Other types are not base64 encoded. You can override this behavior with the base64 option, described next.
48
48
 
49
49
  ## Base64 Option
50
50
 
51
- The value is automatically base64 encoded. You can set the `base64` option to turn on and off the automated base64 encoding.
51
+ The value is automatically base64 encoded based on whether or not the SSM parameter type is a `SecureString`. You can explicitly the `base64` option if needed though. Example:
52
52
 
53
53
  ```ruby
54
54
  aws_ssm("/demo/#{Kubes.env}/USER", base64: true) # default is base64=true
@@ -38,3 +38,4 @@ data:
38
38
  DATABASE_ENDPOINT: <%= database_endpoint %>
39
39
  ```
40
40
 
41
+ {% include helpers/generator.md %}
@@ -23,6 +23,8 @@ KubesGoogle.configure do |config|
23
23
  end
24
24
  ```
25
25
 
26
+ Note: The use of `KubesGoogle.configure` instead of `Kubes.configure` here.
27
+
26
28
  This enables `kubes apply` before and after hooks to add and remove the current machine IP.
27
29
 
28
30
  ## Options
@@ -31,12 +33,7 @@ Here are the `config.gke` settings:
31
33
 
32
34
  Name | Description | Default
33
35
  ---|---|---
34
- cluster_name | GKE cluster name. This is required. | nil
35
- enable_get_credentials | Whether or not to run the hook that calls `gcloud container clusters get-credentials`. This spares you from having to call it manually. | false
36
- enable_hooks | This will be true when the cluster_name is set. So there's no need to set it. The option provides a quick way to override and disable running the hooks. | true
37
- google_project | Google project. Can also be set with the env var `GOOGLE_PROJECT`. `GOOGLE_PROJECT` takes precedence. | nil
38
- google_region | Google region cluster is in. Can also be set with the env var `GOOGLE_REGION`. `GOOGLE_REGION` takes precedence. | nil
39
- whitelist_ip | Explicit IP to whitelist. By default the IP address of the current machine is automatically detected and used. | nil
36
+ {% include plugins/gke-config.md %}
40
37
 
41
38
  ## Build Docker Image
42
39
 
@@ -84,6 +81,12 @@ Important: The "Kubernetes Engine Developer" that is available in the Cloud Buil
84
81
 
85
82
  ## Run CloudBuild
86
83
 
87
- Run cloudbuild with:
84
+ Run cloudbuild to deploy the dev env:
88
85
 
89
86
  gcloud builds submit --config cloudbuild.yaml
87
+
88
+ To deploy the prod env:
89
+
90
+ gcloud builds submit --config cloudbuild.yaml --substitutions _KUBES_ENV=prod
91
+
92
+ See [gcloud builds submit](https://cloud.google.com/sdk/gcloud/reference/builds/submit) reference docs for more options.
@@ -57,7 +57,19 @@ GOOGLE_PROJECT | Google project id. This is required.
57
57
 
58
58
  ## Base64 Option
59
59
 
60
- The value is automatically base64 encoded. You can set the `base64` option to turn on and off the automated base64 encoding.
60
+ By default, the values are automatically base64 encoded. You can change the default behavior with a config option.
61
+
62
+ .kubes/config.rb
63
+
64
+ ```ruby
65
+ KubesGoogle.configure do |config|
66
+ config.base64_secrets = true
67
+ end
68
+ ```
69
+
70
+ Note: The use of `KubesGoogle.configure` instead of `Kubes.configure` here.
71
+
72
+ You can also set the `base64` option to turn on and off the automated base64 encoding on a per secret basis.
61
73
 
62
74
  ```ruby
63
75
  google_secret("demo-#{Kubes.env}-USER", base64: true) # default is base64=true
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: Kubes Plugins
3
+ ---
4
+
5
+ Kubes makes it easier to work with Kubernetes by automating the deployment workflow. Many of the conveniences it adds is done with plugins. For example, `aws_secret`, `aws_ssm`, `google_secret` are implemented with Cloud Provider specific Kubes plugins.
6
+
7
+ ## Baseline Plugins
8
+
9
+ The baseline plugins that currently ship with Kubes are:
10
+
11
+ * [kubes_aws]({% link _docs/plugins/aws.md %})
12
+ * [kubes_google]({% link _docs/plugins/google.md %})
@@ -0,0 +1,17 @@
1
+ ---
2
+ title: AWS Kubes Plugin
3
+ ---
4
+
5
+ The AWS Kubes Plugin adds support helpers like `aws_secret`. You can configure it's behavior. Example:
6
+
7
+ .kubes/config.rb
8
+
9
+ ```ruby
10
+ KubesAws.configure do |config|
11
+ config.base64_secrets = false
12
+ end
13
+ ```
14
+
15
+ Name | Description | Default
16
+ ---|---|---
17
+ base64_secrets | Whether or not to automatically base64 encoded values returned by the `aws_secret` helper. | true
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: Google Kubes Plugin
3
+ ---
4
+
5
+ The Google Kubes Plugin adds support helpers like `google_secret`. You can configure it's behavior. Example:
6
+
7
+ .kubes/config.rb
8
+
9
+ ```ruby
10
+ KubesGoogle.configure do |config|
11
+ config.base64_secrets = true
12
+ end
13
+ ```
14
+
15
+ Name | Description | Default
16
+ ---|---|---
17
+ base64_secrets | Whether or not to automatically base64 encoded values returned by the `google_secret` helper. | true
18
+ {% include plugins/gke-config.md %}
@@ -9,15 +9,4 @@ You can set variables to be made available to the templates. Generally, it is re
9
9
  * [{{ doc.title }}]({{ doc.url }})
10
10
  {% endfor %}
11
11
 
12
- ## Generator
13
-
14
- To help you get started quickly, you can generate starter variable code.
15
-
16
- $ kubes new variable
17
- create .kubes/variables/dev.rb
18
-
19
- .kubes/variables/dev.rb
20
-
21
- ```ruby
22
- @example = "dev-value"
23
- ```
12
+ {% include variables/generator.md %}
@@ -60,3 +60,5 @@ base/KIND/ENV.rb | base/deployment/dev.rb
60
60
  ROLE/KIND.rb | web/deployment.rb
61
61
  ROLE/KIND/base.rb | web/deployment/base.rb
62
62
  ROLE/KIND/ENV.rb | web/deployment/dev.rb
63
+
64
+ {% include variables/generator.md %}
@@ -135,3 +135,5 @@ spec:
135
135
  apiVersion: apps/v1
136
136
  kind: Deployment
137
137
  ```
138
+
139
+ {% include variables/generator.md %}
@@ -0,0 +1,13 @@
1
+ ## Generator
2
+
3
+ To help you get started quickly, you can generate starter helper code.
4
+
5
+ $ kubes new helper custom
6
+ create .kubes/helpers/custom_helper.rb
7
+
8
+ .kubes/helpers/custom_helper.rb
9
+
10
+ ```ruby
11
+ module CustomHelper
12
+ end
13
+ ```
@@ -48,15 +48,13 @@ ROLE/KIND/ENV.{{ include.ext }} | web/deployment/dev.{{ include.ext }}
48
48
  2. Then you can define the core of your resource definition in the `ROLE/KIND.{{ include.ext }}`. Example: `web/deployment.{{ include.ext }}`
49
49
  3. Finally, you can provide environment-specific overrides in the `ROLE/KIND/ENV.{{ include.ext }}`. Example: `web/deployment/dev.{{ include.ext }}`.
50
50
 
51
- Here's an example of the structure:
51
+ Here's a concrete example of layering with the deployment resource kind:
52
52
 
53
- .kubes/resources/
54
- ├── base
55
- │ ├── all.{{ include.ext }}
56
- │ └── deployment.{{ include.ext }}
57
- └── web
58
- ├── deployment
59
- │ ├── dev.{{ include.ext }}
60
- │ └── prod.{{ include.ext }}
61
- ├── deployment.{{ include.ext }}
62
- └── service.{{ include.ext }}
53
+ .kubes/resources/base/all.{{ include.ext }}
54
+ .kubes/resources/base/deployment.{{ include.ext }}
55
+ .kubes/resources/web/deployment.{{ include.ext }}
56
+ .kubes/resources/web/deployment/dev.{{ include.ext }}
57
+
58
+ All of these files get layered and merged together to produce a resulting deployment.{{ include.ext }}
59
+
60
+ .kubes/output/web/deployment.{{ include.ext }}
@@ -0,0 +1,6 @@
1
+ gke.cluster_name | GKE cluster name. This is required when using the [GKE whitelisting feature]({% link _docs/helpers/google/gke.md %}). | nil
2
+ gke.enable_get_credentials | Whether or not to run the hook that calls `gcloud container clusters get-credentials`. This spares you from having to call it manually. | false
3
+ gke.enable_hooks | This will be true when the cluster_name is set. So there's no need to set it. The option provides a quick way to override and disable running the hooks. | true
4
+ gke.google_project | Google project. Can also be set with the env var `GOOGLE_PROJECT`. `GOOGLE_PROJECT` takes precedence. | nil
5
+ gke.google_region | Google region cluster is in. Can also be set with the env var `GOOGLE_REGION`. `GOOGLE_REGION` takes precedence. | nil
6
+ gke.whitelist_ip | Explicit IP to whitelist. By default the IP address of the current machine is automatically detected and used. | nil
@@ -173,6 +173,12 @@
173
173
  <li><a href="{% link _docs/extra-env/dsl.md %}">DSL</a></li>
174
174
  </ul>
175
175
  </li>
176
+ <li><a href="{% link _docs/plugins.md %}">Plugins</a>
177
+ <ul>
178
+ <li><a href="{% link _docs/plugins/aws.md %}">AWS</a></li>
179
+ <li><a href="{% link _docs/plugins/google.md %}">Google</a></li>
180
+ </ul>
181
+ </li>
176
182
  <li>Misc
177
183
  <ul>
178
184
  <li><a href="{% link _docs/misc/kustomize.md %}">Kustomize Support</a></li>
@@ -0,0 +1,12 @@
1
+ ## Generator
2
+
3
+ To help you get started quickly, you can generate starter variable code.
4
+
5
+ $ kubes new variable
6
+ create .kubes/variables/dev.rb
7
+
8
+ .kubes/variables/dev.rb
9
+
10
+ ```ruby
11
+ @example = "dev-value"
12
+ ```
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "zeitwerk"
30
30
 
31
31
  # core helper libs
32
- spec.add_dependency "kubes_aws", "~> 0.2.0"
33
- spec.add_dependency "kubes_google", "~> 0.3.1"
32
+ spec.add_dependency "kubes_aws", "~> 0.3.0"
33
+ spec.add_dependency "kubes_google", "~> 0.3.2"
34
34
 
35
35
  spec.add_development_dependency "bundler"
36
36
  spec.add_development_dependency "byebug"
@@ -24,7 +24,7 @@ module Kubes
24
24
 
25
25
  def auth?
26
26
  if ENV['KUBES_REPO_AUTO_AUTH'].nil?
27
- Kubes.config.repo_auth
27
+ Kubes.config.repo_auto_auth
28
28
  else
29
29
  %w[1 true].include?(ENV['KUBES_REPO_AUTO_AUTH'])
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Kubes
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -142,28 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.2.0
145
+ version: 0.3.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.2.0
152
+ version: 0.3.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: kubes_google
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.3.1
159
+ version: 0.3.2
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.3.1
166
+ version: 0.3.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: bundler
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -362,6 +362,9 @@ files:
362
362
  - docs/_docs/patterns/migrations.md
363
363
  - docs/_docs/patterns/multiple-envs.md
364
364
  - docs/_docs/patterns/secrets.md
365
+ - docs/_docs/plugins.md
366
+ - docs/_docs/plugins/aws.md
367
+ - docs/_docs/plugins/google.md
365
368
  - docs/_docs/resources.md
366
369
  - docs/_docs/resources/base.md
367
370
  - docs/_docs/resources/role.md
@@ -385,6 +388,7 @@ files:
385
388
  - docs/_includes/google_analytics.html
386
389
  - docs/_includes/header.html
387
390
  - docs/_includes/helpers/base64.md
391
+ - docs/_includes/helpers/generator.md
388
392
  - docs/_includes/intro/features.md
389
393
  - docs/_includes/intro/install.md
390
394
  - docs/_includes/js.html
@@ -396,8 +400,10 @@ files:
396
400
  - docs/_includes/learn/repos.md
397
401
  - docs/_includes/learn/review.md
398
402
  - docs/_includes/learn/start.md
403
+ - docs/_includes/plugins/gke-config.md
399
404
  - docs/_includes/reference.md
400
405
  - docs/_includes/sidebar.html
406
+ - docs/_includes/variables/generator.md
401
407
  - docs/_includes/vs/article.md
402
408
  - docs/_includes/vs/kubes/layering.md
403
409
  - docs/_includes/vs/kubes/structure.md