kubes 0.7.0 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +7 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +84 -0
  4. data/.github/ISSUE_TEMPLATE/documentation.md +12 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +64 -0
  6. data/.github/ISSUE_TEMPLATE/question.md +14 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +50 -0
  8. data/CHANGELOG.md +18 -0
  9. data/README.md +2 -0
  10. data/docs/_docs/config/reference.md +1 -1
  11. data/docs/_docs/dsl/multiple-resources.md +14 -17
  12. data/docs/_docs/intro/concepts.md +8 -9
  13. data/docs/_docs/intro/docker-image.md +2 -2
  14. data/docs/_docs/intro/ordering.md +9 -10
  15. data/docs/_docs/patterns/multiple-envs.md +6 -6
  16. data/docs/_docs/resources/role.md +8 -9
  17. data/docs/_docs/yaml.md +4 -5
  18. data/docs/_docs/yaml/multiple-files.md +6 -7
  19. data/docs/_docs/yaml/multiple-resources.md +13 -14
  20. data/docs/_includes/commands.html +8 -9
  21. data/docs/_includes/header.html +7 -0
  22. data/docs/_includes/vs/kubes/structure.md +12 -13
  23. data/docs/_sass/theme.scss +92 -0
  24. data/docs/search/data.json +44 -0
  25. data/docs/search/index.html +30 -0
  26. data/docs/search/lunr.js +3475 -0
  27. data/docs/search/search.js +247 -0
  28. data/docs/search/tips.md +48 -0
  29. data/lib/kubes.rb +1 -0
  30. data/lib/kubes/cli/compile.rb +1 -1
  31. data/lib/kubes/command.rb +1 -0
  32. data/lib/kubes/compiler/decorator/base.rb +2 -2
  33. data/lib/kubes/compiler/dsl/core/base.rb +2 -6
  34. data/lib/kubes/compiler/dsl/core/fields.rb +1 -1
  35. data/lib/kubes/compiler/dsl/syntax/resource.rb +2 -3
  36. data/lib/kubes/compiler/shared/helpers.rb +4 -2
  37. data/lib/kubes/compiler/shared/runtime_helpers.rb +78 -0
  38. data/lib/kubes/compiler/strategy/dispatcher.rb +4 -3
  39. data/lib/kubes/compiler/strategy/erb.rb +2 -7
  40. data/lib/kubes/config.rb +1 -1
  41. data/lib/kubes/core.rb +6 -0
  42. data/lib/kubes/docker/strategy/image_name.rb +7 -3
  43. data/lib/kubes/version.rb +1 -1
  44. metadata +15 -6
  45. data/lib/kubes/compiler/shared/custom_helpers.rb +0 -17
  46. data/lib/kubes/compiler/shared/custom_variables.rb +0 -38
  47. data/lib/kubes/compiler/shared/plugin_helpers.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c708370f432e482b105a766bd174dd52f89c790256ea91063a8045af1d970f39
4
- data.tar.gz: 3b4aef7f7450776cf35b9db54ff7d326a6444e948ab7cf81fac1a7659fca9649
3
+ metadata.gz: 5d1ec1d6ee1348fc20d3e56bca7f82275510eee4b6d7cc2d6830aa0ae21016a1
4
+ data.tar.gz: 2edc8e10565bbeba2551e8b1463ebe2ea122c8c089413bbc41283daefb9eeceb
5
5
  SHA512:
6
- metadata.gz: f157bfaa51b24e2f23327ab02075abdeb331564c28cdcbe0710eeefb8ba2cd7910ea2719e28e1cdedb3b5b2873be902734c27254089ba5e1bc4083e13d33a10f
7
- data.tar.gz: 48594a55badaba62e2ef7cfe436bc32640a5723221278f7d42c307144a00c300ca9a9c07d1501bc9a10204ff629929272171d8a4fc1cfe878b91bc951f46ba96
6
+ metadata.gz: 7d7ef397578596e7dc9c9225447073eb2d0dedd21b6429d6ee1febd1b5d45cebcea69171fd5d4ed1de1a45772824d919e9287a43306c0796e8d33c295eb250ce
7
+ data.tar.gz: a3fc1e2e6ba21cbb820ccf290acda1f353bc536be0a72c769467314057a25dd83a1de93bac2aee461b5c3cb70abf59cb60ce83c5250a2e48f28197a311b46d64
@@ -0,0 +1,7 @@
1
+ Please fill out one of the templates on https://github.com/boltops-tools/kubes/issues/new/choose
2
+
3
+ If you want to ask a question please do so on sites like StackOverflow.
4
+
5
+ To be sensitive to everyone's time, we may close issues asking questions without comment. Here are some additional options also https://kubes.guru/support/ 👌
6
+
7
+ Thank you!
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: Reproducible Bug Report
3
+ about: Is something not working as expected?
4
+ title: ''
5
+ labels: 'bug'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ Hi! Thanks for considering to file a bug with Kubes. Please take the time to
12
+ answer the basic questions. Please try to be as detailed as possible.
13
+ To be sensitive to everyone's time, if not enough details are provided, the
14
+ issue may be closed without comment. If you repeatedly fail to provide enough
15
+ details, you may be blocked from ever submitting issues to Kubes again.
16
+ Please use your best judgment. 👍
17
+
18
+ If you are unsure this is a bug in Kubes, please consider asking your question at sites like StackOverflow.
19
+
20
+ Thanks!
21
+ -->
22
+
23
+ ## Checklist
24
+
25
+ <!--
26
+ Make sure that you've done all of these. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
27
+ -->
28
+
29
+ - [ ] Upgrade Kubes: Are you using the latest version of Kubes? This allows Kubes to fix issues fast.
30
+ - [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on StackOverflow.
31
+ - [ ] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
32
+
33
+ ## My Environment
34
+
35
+ <!-- Please fill out the table below with debugging info to help: -->
36
+
37
+ | Software | Version |
38
+ | ---------------- | ------- |
39
+ | Operating System | |
40
+ | Kubes | |
41
+ | kubectl | |
42
+ | Ruby | |
43
+
44
+ ---
45
+
46
+ ## Expected Behaviour
47
+
48
+ <!--
49
+ What is it you expected to happen? This should be a description of how the functionality you tried to use is supposed to work. Try to keep this to one-paragraph.
50
+ -->
51
+
52
+ ## Current Behavior
53
+
54
+ <!--
55
+ Describe the details of the bug. Try to keep this to one-paragraph.
56
+ -->
57
+
58
+ ## Step-by-step reproduction instructions
59
+
60
+ <!--
61
+ Be sure to include any steps you took for the problem to exist. This is likely the longest part of the report.
62
+
63
+ Please include any logs you think relevant here. If the logs are long (more than 50 lines) please make a gist of the logs and link to it. https://gist.github.com
64
+
65
+ With long logs, you can also use the <details> tag to keep the report readable. Example:
66
+
67
+ <details>
68
+ <summary>Summary Goes Here</summary>
69
+
70
+ ...this is hidden, collapsable content. start with a blank line to get terminal output to format right...
71
+ </details>
72
+ -->
73
+
74
+ ## Code Sample
75
+
76
+ <!--
77
+ Please provide a code repository, gist, code snippet or sample files to reproduce the issue.
78
+ -->
79
+
80
+ ## Solution Suggestion
81
+
82
+ <!--
83
+ Please provide possible solutions. If you can't think of anything, feel free to omit. Please be kind and add helpful possible solutions. For example, "Fix it!" is not a helpful solution suggestion. We are mere mortals. Please be constructive.
84
+ -->
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: Documentation
3
+ about: Found a typo or something that isn't crystal clear in the docs?
4
+ title: ''
5
+ labels: docs
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ The Kubes Docs are in the [kubes repo](https://github.com/boltops-tools/kubes/tree/master/docs). Please submit a PR there. Thanks!
11
+
12
+ For documentation changes to the kubes code base itself, like code comments. Please submit a PR here. Thanks!
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: New Feature Suggestion
3
+ about: Want to add a feature to Kubes?
4
+ title: ''
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ Hi! Thanks for considering to file a feature request with Kubes. Please take the time to answer the basic questions. Please try to be as detailed as possible.
12
+
13
+ Thanks!
14
+ -->
15
+
16
+ ## Summary
17
+
18
+ <!--
19
+ A one-paragraph explanation of the feature.
20
+ -->
21
+
22
+ ## Motivation
23
+
24
+ <!--
25
+ Why do you want to see this feature in Kubes? What use cases does it support?
26
+
27
+ How the feature would be relevant to 80% or more of Kubes users.
28
+ -->
29
+
30
+ ## Guide-level explanation
31
+
32
+ <!--
33
+ Explain the proposal as if it was already included in the project and you were teaching it to another programmer. That generally means:
34
+
35
+ - Introducing new named concepts.
36
+ - Explaining the feature largely in terms of examples.
37
+ - If applicable, provide sample error messages, deprecation warnings, or upgrade guidance.
38
+
39
+ If this is a small feature, you may omit this section.
40
+ -->
41
+
42
+ ## Reference-level explanation
43
+
44
+ <!--
45
+ This is the technical portion of the feature request. Explain the design in sufficient detail that:
46
+
47
+ - Its interaction with other features is clear.
48
+ - It is reasonably clear how the feature would be implemented.
49
+ - Corner cases are dissected by example.
50
+
51
+ If you do not know how to answer this, you can omit it. No worries!
52
+ -->
53
+
54
+ ## Drawbacks
55
+
56
+ <!--
57
+ Why should we *not* do this?
58
+ -->
59
+
60
+ ## Unresolved Questions
61
+
62
+ <!--
63
+ What related issues do you consider out of scope for this feature that could be addressed in the future independently of the solution that comes out of this feature?
64
+ -->
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Question
3
+ about: Have any questions about how Kubes works?
4
+ title: ''
5
+ labels: 'question'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ The Kubes issue tracker IS NOT for usage questions! Please post your question at sites like StackOverflow.
11
+
12
+ To be sensitive to everyone's time, we may close issues asking questions without comment. If you repeatedly post questions in the issues tracker, you may be blocked from ever submitting issues to Kubes again. Please use your best judgment. 👍
13
+
14
+ Here are some additional options also https://kubes.guru/support/ 😁
@@ -0,0 +1,50 @@
1
+ <!--
2
+ Thanks for creating a Pull Request! Before you submit, please make sure you've done the following:
3
+
4
+ - I read the contributing document at https://kubes.guru/docs/contributing/
5
+ -->
6
+
7
+ <!--
8
+ Make our lives easier! Choose one of the following by uncommenting it:
9
+ -->
10
+
11
+ <!-- This is a 🐞 bug fix. -->
12
+ <!-- This is a 🙋‍♂️ feature or enhancement. -->
13
+ <!-- This is a 🧐 documentation change. -->
14
+
15
+ <!--
16
+ Before you submit this pull request, make sure to have a look at the following checklist. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
17
+
18
+ If you don't know how to do some of these, that's fine! Submit your pull request and we will help you out on the way.
19
+ -->
20
+
21
+ - [ ] I've added tests (if it's a bug, feature or enhancement)
22
+ - [ ] I've adjusted the documentation (if it's a feature or enhancement)
23
+ - [ ] The test suite passes (run `bundle exec rspec` to verify this)
24
+
25
+ ## Summary
26
+
27
+ <!--
28
+ Provide a description of what your pull request changes.
29
+ -->
30
+
31
+ ## Context
32
+
33
+ <!--
34
+ Is this related to any GitHub issue(s) or another relevant link?
35
+ -->
36
+
37
+ ## How to Test
38
+
39
+ <!--
40
+ Please provide instructions on how to test the fix. This speeds up reviewing the PR. If testing requires a demo Kubes project, please provide an example repo.
41
+ -->
42
+
43
+
44
+ ## Version Changes
45
+
46
+ <!--
47
+ Which semantic version change would you recommend?
48
+ If you don't know, feel free to omit it.
49
+ -->
50
+
data/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
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.7.5] - 2021-06-03
7
+ - [#47](https://github.com/boltops-tools/kubes/pull/47) add search
8
+ - [#48](https://github.com/boltops-tools/kubes/pull/48) use deep_merge overwrite_arrays option fixes #45
9
+
10
+ ## [0.7.4] - 2021-03-02
11
+ - [#46](https://github.com/boltops-tools/kubes/pull/46) call run method to respect config.suffix_hash
12
+
13
+ ## [0.7.3] - 2020-12-24
14
+ - [#44](https://github.com/boltops-tools/kubes/pull/44) require singleton
15
+
16
+ ## [0.7.2] - 2020-12-04
17
+ - [#43](https://github.com/boltops-tools/kubes/pull/43) store docker image name in env based folder
18
+ - fix kubes help
19
+
20
+ ## [0.7.1] - 2020-11-16
21
+ - [#42](https://github.com/boltops-tools/kubes/pull/42) load helpers for dsl properly
22
+ - fix merge layer
23
+
6
24
  ## [0.7.0] - 2020-11-16
7
25
  - [#41](https://github.com/boltops-tools/kubes/pull/41) multiple resources yaml support
8
26
 
data/README.md CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  Kubernetes Deployment Tool: build docker image, compile Kubernetes YAML files, and apply them.
12
12
 
13
+ Please **watch/star** this repo to help grow and support the project.
14
+
13
15
  Official Docs Site: [kubes.guru](https://kubes.guru)
14
16
 
15
17
  Kubes will:
@@ -18,5 +18,5 @@ logger.level | Logger level. Can also be set with `KUBES_LOG_LEVEL` env var | in
18
18
  repo | The Docker repo to use. Required to be set. | nil
19
19
  repo_auto_auth | Whether or not to try to auth authorize docker repo registry if not yet logged in. Can also be set with env var `KUBES_REPO_AUTO_AUTO` | true
20
20
  skip | List of resources to skip. Can also be set with the `KUBES_SKIP` env var. `KUBES_SKIP` should be a list of strings separated by spaces. It adds onto the `config.skip` option. | []
21
- state.docker_image_path | Where to store the state file with the last build Docker image. | .kubes/state/docker_image.txt
21
+ state.path | Where to store the state file with the last build Docker image. | .kubes/state/KUBES_ENV/data.json
22
22
  suffix_hash | Whether or not to append suffix hash to ConfigMap and Secret | true
@@ -4,11 +4,10 @@ title: DSL Multiple Resources
4
4
 
5
5
  Kubes encourages a structure with files that matches the resource kind. Example:
6
6
 
7
- .kubes
8
- └── resources
9
- └── web
10
- ├── deployment.rb
11
- └── service.rb
7
+ .kubes/resources
8
+ └── web
9
+ ├── deployment.rb
10
+ └── service.rb
12
11
 
13
12
  This structure is nicely organized and covers 80% of use cases. An astute user may point out that this struture assumes one resource of each kind.
14
13
 
@@ -18,13 +17,12 @@ Next, we'll cover different ways to create multiple resource of the same kinds.
18
17
 
19
18
  You can create multiple resources of same kind by appending a dash followed by anything. Example:
20
19
 
21
- .kubes
22
- └── resources
23
- └── web
24
- ├── deployment-1.rb
25
- ├── deployment-2.rb
26
- ├── service-1.rb
27
- └── service-2.rb
20
+ .kubes/resources
21
+ └── web
22
+ ├── deployment-1.rb
23
+ ├── deployment-2.rb
24
+ ├── service-1.rb
25
+ └── service-2.rb
28
26
 
29
27
  Only words before the dash are used to infer the resource kind.
30
28
 
@@ -43,9 +41,8 @@ You can also use a block form to create multiple resources. The multiple resour
43
41
 
44
42
  You name the resource files with plural names. An example helps explain:
45
43
 
46
- .kubes
47
- └── resources
48
- └── deployments.rb
44
+ .kubes/resources
45
+ └── deployments.rb
49
46
 
50
47
  .kubes/resources/web/deployments.rb
51
48
 
@@ -86,8 +83,8 @@ You can declare deployment, service, and other resource kinds multiple times.
86
83
 
87
84
  Layering works for both simple and block form. Just create a folder with the corresponding name.
88
85
 
89
- * The layering definitions for the prelayers are in singular form.
90
- * The layering definitions for the post layers are in a folder with plural form.
86
+ * The layering definitions for the pre layers are in singular form.
87
+ * The layering definitions for the post layers are in a folder with plural form, but the overrides are defined in singular form still.
91
88
  * Resources in the main "middle" layer are the only ones that are allowed multiple resource definitions.
92
89
 
93
90
  Simple form layering:
@@ -6,15 +6,14 @@ title: Kubes Concepts
6
6
 
7
7
  The `.kubes/resources` where you organized Kubernetes resources. Different subfolders within the resources folder represent your app. Example:
8
8
 
9
- .kubes
10
- └── resources
11
- ├── clock
12
- │ └── deployment.yaml
13
- ├── worker
14
- └── deployment.yaml
15
- └── web
16
- ├── deployment.yaml
17
- └── service.yaml
9
+ .kubes/resources
10
+ ├── clock
11
+ │ └── deployment.yaml
12
+ ├── worker
13
+ │ └── deployment.yaml
14
+ └── web
15
+ ├── deployment.yaml
16
+ └── service.yaml
18
17
 
19
18
  Each folder contains your Kubernetes deployment definition, either in [YAML]({% link _docs/yaml.md %}) or [DSL]({% link _docs/dsl.md %}) form. Both can be used together.
20
19
 
@@ -16,7 +16,7 @@ Kubes uses the image from the `--image` option if specified. It's a quick way to
16
16
 
17
17
  kubes deploy --image repo/image:tag
18
18
 
19
- When the `--image` option is set, Kubes skips the Docker build phase.
19
+ When the `--image` option is set, Kubes skips the Docker build phase. You can also set `config.image = false` to simply disable image building.
20
20
 
21
21
  ## 2. Kubes Config
22
22
 
@@ -30,7 +30,7 @@ Kubes.configure do |config|
30
30
  end
31
31
  ```
32
32
 
33
- When `config.image` is set, Kubes skips the Docker build phase.
33
+ When `config.image` is set, Kubes skips the Docker build phase. You can also set `config.image = false` to simply disable image building.
34
34
 
35
35
  ## 3. Built Docker Image
36
36
 
@@ -37,16 +37,15 @@ Kubes will delete in the reverse order.
37
37
 
38
38
  Resources in the `shared` folder will be applied first. Example:
39
39
 
40
- .kubes
41
- └── resources
42
- ├── clock
43
- │ └── deployment.yaml
44
- ├── web
45
- ├── deployment.yaml
46
- └── service.yaml
47
- └── shared
48
- ├── config_map.yaml
49
- └── secret.yaml
40
+ .kubes/resources
41
+ ├── clock
42
+ │ └── deployment.yaml
43
+ ├── web
44
+ ├── deployment.yaml
45
+ └── service.yaml
46
+ └── shared
47
+ ├── config_map.yaml
48
+ └── secret.yaml
50
49
 
51
50
  Results in:
52
51
 
@@ -1,14 +1,14 @@
1
1
  ---
2
- title: Multiple Enviroments with Layering
3
- nav_text: Multiple Enviroments
2
+ title: Multiple Environments with Layering
3
+ nav_text: Multiple Environments
4
4
  categories: patterns
5
5
  ---
6
6
 
7
- You can use Kubes to easily create multiple enviroments with the same YAML configs. This is thanks to [Kubes Layering]({% link _docs/layering.md %}). We'll walk through an example to help understand how it works.
7
+ You can use Kubes to easily create multiple environments with the same YAML configs. This is thanks to [Kubes Layering]({% link _docs/layering.md %}). We'll walk through an example to help understand how it works.
8
8
 
9
- ## Creating Multiple Enviroments
9
+ ## Creating Multiple Environments
10
10
 
11
- To create multiple enviroments like dev and prod just change KUBES_ENV. Example:
11
+ To create multiple environments like dev and prod just change KUBES_ENV. Example:
12
12
 
13
13
  KUBES_ENV=dev kubes deploy
14
14
  KUBES_ENV=prod kubes deploy
@@ -17,7 +17,7 @@ Different env files will be layered and merged to produce YAML files specific to
17
17
 
18
18
  ## Project Structure
19
19
 
20
- Here's an example structure, so we can understand how layering works to create multiple enviroments.
20
+ Here's an example structure, so we can understand how layering works to create multiple environments.
21
21
 
22
22
  .kubes/resources/
23
23
  ├── base