kubes 0.7.10 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/docs/Gemfile +1 -0
- data/docs/_config.yml +6 -0
- data/docs/_docs/config/app-overrides.md +7 -0
- data/docs/_docs/config/boot.md +46 -0
- data/docs/_docs/config/env.md +29 -2
- data/docs/_docs/config/reference.md +2 -2
- data/docs/_docs/config/skip.md +22 -0
- data/docs/_docs/helpers/aws/secret_data.md +55 -0
- data/docs/_docs/helpers/builtin/config-map-files.md +63 -0
- data/docs/_docs/helpers/builtin.md +16 -0
- data/docs/_docs/helpers/google/secret_data.md +55 -0
- data/docs/_docs/helpers.md +3 -12
- data/docs/{_includes/intro/install.md → _docs/install/dependencies.md} +4 -5
- data/docs/_docs/install/gem/custom-version.md +70 -0
- data/docs/_docs/install/gem.md +6 -0
- data/docs/_docs/install/standalone/centos.md +70 -0
- data/docs/_docs/install/standalone/details/permissions.md +44 -0
- data/docs/_docs/install/standalone/details/uninstall.md +16 -0
- data/docs/_docs/install/standalone/details.md +20 -0
- data/docs/_docs/install/standalone/macosx.md +45 -0
- data/docs/_docs/install/standalone/ubuntu.md +48 -0
- data/docs/_docs/install/standalone.md +43 -0
- data/docs/_docs/install.md +8 -0
- data/docs/_docs/learn/dsl/install.md +1 -1
- data/docs/_docs/learn/yaml/install.md +1 -1
- data/docs/_docs/patterns/central-deployer.md +38 -0
- data/docs/_docs/variables/advanced.md +32 -1
- data/docs/_docs/variables/basic.md +1 -0
- data/docs/_docs/vs/custom.md +2 -0
- data/docs/_docs/vs/helm.md +2 -0
- data/docs/_docs/vs/kustomize.md +2 -0
- data/docs/_docs/vs.md +2 -0
- data/docs/_docs/yaml/erb-comment.md +89 -0
- data/docs/_includes/config/app-overrides-cheatsheet.md +44 -0
- data/docs/_includes/content.html +1 -1
- data/docs/_includes/install/gem.md +7 -0
- data/docs/_includes/install/wrapper.md +9 -0
- data/docs/_includes/layering/layers.md +3 -0
- data/docs/_includes/sidebar.html +38 -4
- data/docs/_includes/videos/learn/vs.md +4 -0
- data/docs/_includes/videos/learn.md +12 -0
- data/docs/_includes/videos/youtube.md +1 -0
- data/docs/_layouts/default.html +1 -0
- data/docs/_sass/theme.scss +11 -0
- data/docs/js/scripts.js +7 -0
- data/kubes.gemspec +2 -2
- data/lib/kubes/booter.rb +26 -0
- data/lib/kubes/cli/init.rb +0 -1
- data/lib/kubes/command.rb +1 -1
- data/lib/kubes/compiler/layering.rb +9 -0
- data/lib/kubes/compiler/shared/helpers/config_map_helper.rb +35 -0
- data/lib/kubes/compiler/shared/helpers/docker_helper.rb +23 -0
- data/lib/kubes/compiler/shared/helpers/extra_helper.rb +12 -0
- data/lib/kubes/compiler/shared/helpers/secret_helper.rb +29 -0
- data/lib/kubes/compiler/shared/helpers.rb +4 -37
- data/lib/kubes/compiler/shared/runtime_helpers.rb +7 -0
- data/lib/kubes/compiler/strategy/erb/comment.rb +46 -0
- data/lib/kubes/compiler/strategy/erb.rb +4 -0
- data/lib/kubes/compiler/strategy/result.rb +13 -1
- data/lib/kubes/compiler.rb +2 -0
- data/lib/kubes/config.rb +6 -2
- data/lib/kubes/core.rb +4 -0
- data/lib/kubes/kubectl/ordering.rb +9 -6
- data/lib/kubes/version.rb +1 -1
- data/lib/kubes.rb +2 -0
- metadata +40 -10
- data/docs/_docs/intro/install.md +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abdaace0c3b6e26fb4e1ec508f6495821f53dd91874adef0957b18d4dd7d26ef
|
4
|
+
data.tar.gz: bc026da9756049bee53a4a0041e54f8696912aec29ce98d7ead5dd7df87ae5a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de24256a61e96baef7ae15831474638e262dc30667f461af8929a420405b1413c30cdb21f750f3eb9377ea112aedbf82561677a730599d492d4597973eca8847
|
7
|
+
data.tar.gz: 45892fec7a9af86fdf69fd91d8508874ec18918eedecd6fad8f3622bd12c70f7487ffe532c246877427bedf0b6578210f70389a5f9b13fb4a86d4e8821c62e71
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
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.8.3] - 2022-02-16
|
7
|
+
- [#60](https://github.com/boltops-tools/kubes/pull/60) Config files
|
8
|
+
|
9
|
+
## [0.8.2] - 2022-02-07
|
10
|
+
- improve gem dependency version specifiers
|
11
|
+
|
12
|
+
## [0.8.1] - 2022-02-06
|
13
|
+
- allow --version command to run outside project
|
14
|
+
|
15
|
+
## [0.8.0] - 2022-02-06
|
16
|
+
- [#58](https://github.com/boltops-tools/kubes/pull/58) standalone install docs
|
17
|
+
- [#59](https://github.com/boltops-tools/kubes/pull/59) central deployer support
|
18
|
+
|
6
19
|
## [0.7.10] - 2021-12-18
|
7
20
|
- [#56](https://github.com/boltops-tools/kubes/pull/56) New hook generator
|
8
21
|
- [#57](https://github.com/boltops-tools/kubes/pull/57) Fix activesupport require
|
data/docs/Gemfile
CHANGED
data/docs/_config.yml
CHANGED
@@ -70,4 +70,10 @@ defaults:
|
|
70
70
|
plugins_dir:
|
71
71
|
# - jekyll-gzip - GitHub pages does not support this plugin.
|
72
72
|
|
73
|
+
# List of supported plugins:
|
74
|
+
# https://pages.github.com/versions.json
|
75
|
+
# https://github.com/github/pages-gem/issues/171
|
76
|
+
plugins:
|
77
|
+
- jekyll-include-cache # Supported by GitHub pages
|
78
|
+
|
73
79
|
ads_url: "https://ads.boltops.com"
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
title: Boot Hooks
|
3
|
+
---
|
4
|
+
|
5
|
+
If you need to hook into the Kubes boot process super-early on, Kubes boot hooks are designed for that.
|
6
|
+
|
7
|
+
* They run very early in the Kubes boot process.
|
8
|
+
* They are useful for setting shared global values like env vars.
|
9
|
+
* Boot hooks are ruby files that get required. It's nice and simple. There's no interface to learn.
|
10
|
+
|
11
|
+
## Hooks
|
12
|
+
|
13
|
+
Kubes will searches 2 files in the `config` folder. If the files exist, they will be ran in this order.
|
14
|
+
|
15
|
+
1. **.kubes/config/boot.rb**: Always runs.
|
16
|
+
2. **.kubes/config/boot/KUBES_ENV.rb**: Runs based on the env. IE: `KUBES_ENV=dev` => `.kubes/config/boot/dev.rb`
|
17
|
+
|
18
|
+
Both files are required and ran if they both exists. Since the `KUBES_ENV` one runs second, it can be used to override previously set values.
|
19
|
+
|
20
|
+
## Example: Default KUBES_ENV
|
21
|
+
|
22
|
+
If you prefer a different default than `KUBES_ENV=dev`.
|
23
|
+
|
24
|
+
config/boot.rb
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
ENV['KUBES_ENV'] ||= 'development'
|
28
|
+
```
|
29
|
+
|
30
|
+
This changes the default for everyone using the project, but still allows them to control the default by adding `export KUBES_ENV=development` to their `~/.bash_profile`.
|
31
|
+
|
32
|
+
## Example: Auto-Switch AWS_PROFILE
|
33
|
+
|
34
|
+
One useful example is switching `AWS_PROFILE` based on the `KUBES_ENV`. Example:
|
35
|
+
|
36
|
+
config/boot/dev.rb
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
ENV['AWS_PROFILE'] = 'dev'
|
40
|
+
```
|
41
|
+
|
42
|
+
This example is for AWS, but you can can do similiar switch logic with `GOOGLE_APPLICATION_CREDENTIALS`, etc.
|
43
|
+
|
44
|
+
## Boot Source
|
45
|
+
|
46
|
+
Please refer to the boot source code for more details: [kubes/booter.rb](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/booter.rb)
|
data/docs/_docs/config/env.md
CHANGED
@@ -16,7 +16,9 @@ Kubes.configure do |config|
|
|
16
16
|
end
|
17
17
|
```
|
18
18
|
|
19
|
-
##
|
19
|
+
## Config Overrides
|
20
|
+
|
21
|
+
### Env Overrides
|
20
22
|
|
21
23
|
You can override configs on a per-env basis with `config/env` files. Examples:
|
22
24
|
|
@@ -38,7 +40,32 @@ Kubes.configure do |config|
|
|
38
40
|
end
|
39
41
|
```
|
40
42
|
|
41
|
-
|
43
|
+
### App Overrides
|
44
|
+
|
45
|
+
If KUBES_APP is set, app-scoped configs can be used to override settings further. Here are some with `config/env/app` example files:
|
46
|
+
|
47
|
+
.kubes/config/env/app1/dev.rb
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
Kubes.configure do |config|
|
51
|
+
config.repo = "222222222222.dkr.ecr.us-west-2.amazonaws.com/demo"
|
52
|
+
config.kubectl.context = "dev-cluster"
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
.kubes/config/env/app2/prod.rb
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
Kubes.configure do |config|
|
60
|
+
config.repo = "333333333333.dkr.ecr.us-west-2.amazonaws.com/demo"
|
61
|
+
config.kubectl.context = "prod-cluster"
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
This allows you to set specific app-level settings with:
|
66
|
+
|
67
|
+
KUBES_APP=app1 kubes deploy
|
68
|
+
KUBES_APP=app2 kubes deploy
|
42
69
|
|
43
70
|
## Auto-Switching Context
|
44
71
|
|
@@ -8,7 +8,7 @@ auto_prune | Prune and delete old hashed resources like Secret and ConfigMap. |
|
|
8
8
|
builder | What docker build command to use. Can use `docker` or `gcloud` to build the Docker image. | docker
|
9
9
|
image | Set a prebuilt Docker image to use. This is optional. Usually, you want to build an image from the Dockerfile. Setting this will change the `docker_image` helper to use a predefined image. See: [Docker Image]({% link _docs/intro/docker-image.md %}) | nil
|
10
10
|
kubectl.context | What kubectl context to auto-switch to. | nil
|
11
|
-
kubectl.context_keep | Whether or not to keep the context switched |
|
11
|
+
kubectl.context_keep | Whether or not to keep the context switched | false
|
12
12
|
kubectl.exit_on_fail.apply | Whether or not continue if the `kubectl apply` fails. Note, can use `KUBES_EXIT_ON_FAIL=0` env var to set to false. | true
|
13
13
|
kubectl.exit_on_fail.delete | Whether or not continue if the `kubectl delete` fails. | false
|
14
14
|
kubectl.order.kinds | Change ordering for Kubernetes Kinds. | See [source code](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/config.rb#L52)
|
@@ -18,6 +18,6 @@ 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.path | Where to store the state file with the last build Docker image. | .kubes/state/KUBES_ENV/data.json
|
21
|
+
state.path | Where to store the state file with the last build Docker image. | .kubes/state/KUBES_APP/KUBES_ENV/data.json
|
22
22
|
suffix_hash | Whether or not to append suffix hash to ConfigMap and Secret | true
|
23
23
|
merger.options | Merger options that control how Hashes are merged. More info: [Merger Options]({% link _docs/layering/merge-options.md %}) | `{overwrite_arrays: true}`
|
data/docs/_docs/config/skip.md
CHANGED
@@ -56,3 +56,25 @@ You can also us ethe `KUBES_SKIP` env var. It takes list of strings separated by
|
|
56
56
|
KUBES_SKIP="cleanup/job" kubes delete
|
57
57
|
|
58
58
|
This can be useful for one-off use cases.
|
59
|
+
|
60
|
+
## Skip With kubes skip metdata
|
61
|
+
|
62
|
+
You can also skip a resource from being written by using `kubes.skip = true`. This is useful if you want to conditionally not create a resource with a variable. Example:
|
63
|
+
|
64
|
+
.kubes/resources/config_map.yaml
|
65
|
+
|
66
|
+
```yaml
|
67
|
+
<% if @skip %>
|
68
|
+
kubes:
|
69
|
+
skip: true
|
70
|
+
<% end %>
|
71
|
+
metadata:
|
72
|
+
namespace: demo-dev
|
73
|
+
labels:
|
74
|
+
app: demo-dev
|
75
|
+
name: demo-dev-configmap-495c18844b
|
76
|
+
apiVersion: v1
|
77
|
+
kind: ConfigMap
|
78
|
+
```
|
79
|
+
|
80
|
+
If the variable is set to `@skip = true`, then the config_map.yaml will not get created.
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
title: AWS Secrets
|
3
|
+
nav_text: Secrets Data
|
4
|
+
categories: helpers-aws
|
5
|
+
---
|
6
|
+
|
7
|
+
The `aws_secret_data` helper fetches secret data that is one single file from AWS Secrets.
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
For example if you have these secret values stored as one file with multiple values separated by `=`.
|
12
|
+
|
13
|
+
$ aws secretsmanager get-secret-value --secret-id demo-dev-secret-data | jq '.SecretString'
|
14
|
+
KEY1=secretvalue1
|
15
|
+
KEY2=secretvalue2
|
16
|
+
|
17
|
+
Kubes can fetch the secret data and base64 encode the values properly. Example:
|
18
|
+
|
19
|
+
.kubes/resources/shared/secret.yaml
|
20
|
+
|
21
|
+
```yaml
|
22
|
+
apiVersion: v1
|
23
|
+
kind: Secret
|
24
|
+
metadata:
|
25
|
+
name: demo
|
26
|
+
labels:
|
27
|
+
app: demo
|
28
|
+
data:
|
29
|
+
<%= aws_secret_data("demo-dev-secret-data") %>
|
30
|
+
```
|
31
|
+
|
32
|
+
Notice how the text is idented properly by 2 spaces and the values are automatically base64 encoded.
|
33
|
+
|
34
|
+
.kubes/output/shared/secret.yaml
|
35
|
+
|
36
|
+
```yaml
|
37
|
+
metadata:
|
38
|
+
namespace: demo
|
39
|
+
name: demo-2a78a13682
|
40
|
+
labels:
|
41
|
+
app: demo
|
42
|
+
apiVersion: v1
|
43
|
+
kind: Secret
|
44
|
+
data:
|
45
|
+
KEY1: c2VjcmV0dmFsdWUx
|
46
|
+
KEY2: c2VjcmV0dmFsdWUy
|
47
|
+
```
|
48
|
+
|
49
|
+
## Options
|
50
|
+
|
51
|
+
Here's an example of the available options for `aws_secret_data`.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
aws_secret_data("demo-#{Kubes.env}-secret-data", base64: true, ident: 2)
|
55
|
+
```
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
title: Config Map Files
|
3
|
+
nav_text: Config Map Files
|
4
|
+
---
|
5
|
+
|
6
|
+
The `config_map_files` helper allows you to add config map data from a list of files. The files support layerying.
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
Here's how to use it.
|
11
|
+
|
12
|
+
.kubes/resources/shared/config_map.yaml
|
13
|
+
|
14
|
+
```yaml
|
15
|
+
apiVersion: v1
|
16
|
+
kind: ConfigMap
|
17
|
+
metadata:
|
18
|
+
name: demo
|
19
|
+
labels:
|
20
|
+
app: demo
|
21
|
+
data:
|
22
|
+
<%= config_map_files %>
|
23
|
+
```
|
24
|
+
|
25
|
+
You can conveniently set multiple configmap values in files like so:
|
26
|
+
|
27
|
+
.kubes/resources/shared/config_map/base.txt
|
28
|
+
|
29
|
+
KEY1=cmvalue1
|
30
|
+
KEY2=cmvalue2
|
31
|
+
|
32
|
+
.kubes/resources/shared/config_map/dev.txt
|
33
|
+
|
34
|
+
KEY2=cmvalue2-dev-override
|
35
|
+
KEY3=cmvalue3
|
36
|
+
|
37
|
+
The resulting generated ConfigMap will be:
|
38
|
+
|
39
|
+
```yaml
|
40
|
+
---
|
41
|
+
metadata:
|
42
|
+
namespace: demo-dev
|
43
|
+
labels:
|
44
|
+
app: demo
|
45
|
+
name: demo-928146dd24
|
46
|
+
apiVersion: v1
|
47
|
+
kind: ConfigMap
|
48
|
+
data:
|
49
|
+
KEY1: cmvalue1
|
50
|
+
KEY2: cmvalue2-dev-override
|
51
|
+
KEY3: cmvalue3
|
52
|
+
```
|
53
|
+
|
54
|
+
## Layering Details
|
55
|
+
|
56
|
+
Layering for Config Map Files and also supports app-scoped layers.
|
57
|
+
|
58
|
+
Name | Example
|
59
|
+
--- | ---
|
60
|
+
configmap root | .kubes/resources/shared/config_map/{base,dev}.txt
|
61
|
+
configmap app-scoped | .kubes/resources/shared/config_map/app1/{base,dev}.txt
|
62
|
+
|
63
|
+
So if `KUBES_APP=app1`, then the app-scoped layer is also used. This handles the [Central Deployer Pattern]({% link _docs/patterns/central-deployer.md %}).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
title: Core Built-In Helpers
|
3
|
+
---
|
4
|
+
|
5
|
+
Kubes provides some helper methods to help write Kubernetes YAML files. Here's a list of the helper methods. These are available whether you write your resources in YAML or DSL.
|
6
|
+
|
7
|
+
Helper | Description
|
8
|
+
--- | ---
|
9
|
+
decode64 | Base64 decode a string.
|
10
|
+
docker_image | Method refers to the latest Docker image built by Kubes. This spares you from having to update the image manually in the deployment resource. Note, this can be overridden with the `--image` cli option or the `Kubes.config.image` setting. See: [Docker Image]({% link _docs/intro/docker-image.md %})
|
11
|
+
dockerfile_port | Exposed port extracted from the Dockerfile of the project.
|
12
|
+
encode64 | Base64 encode a string. Also available as `base64` method.
|
13
|
+
extra | The `KUBES_EXTRA` value.
|
14
|
+
with_extra | Appends the `KUBES_EXTRA` value to a string if it's set. It's covered in the [Extra Env Docs]({% link _docs/extra-env.md %}).
|
15
|
+
|
16
|
+
Here's also the source code with most of the helpers: [helpers.rb](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/compiler/shared/helpers.rb).
|
@@ -0,0 +1,55 @@
|
|
1
|
+
---
|
2
|
+
title: Google Secrets
|
3
|
+
nav_text: Secrets Data
|
4
|
+
categories: helpers-google
|
5
|
+
---
|
6
|
+
|
7
|
+
The `google_secret_data` helper fetches secret data that is one single file from Google Secrets.
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
For example if you have these secret values stored as one file with multiple values separated by `=`.
|
12
|
+
|
13
|
+
$ gcloud secrets versions access latest --secret demo-dev-secret-data
|
14
|
+
KEY1=secretvalue1
|
15
|
+
KEY2=secretvalue2
|
16
|
+
|
17
|
+
Kubes can fetch the secret data and base64 encode the values properly. Example:
|
18
|
+
|
19
|
+
.kubes/resources/shared/secret.yaml
|
20
|
+
|
21
|
+
```yaml
|
22
|
+
apiVersion: v1
|
23
|
+
kind: Secret
|
24
|
+
metadata:
|
25
|
+
name: demo
|
26
|
+
labels:
|
27
|
+
app: demo
|
28
|
+
data:
|
29
|
+
<%= google_secret_data("demo-dev-secret-data") %>
|
30
|
+
```
|
31
|
+
|
32
|
+
Notice how the text is idented properly by 2 spaces and the values are automatically base64 encoded.
|
33
|
+
|
34
|
+
.kubes/output/shared/secret.yaml
|
35
|
+
|
36
|
+
```yaml
|
37
|
+
metadata:
|
38
|
+
namespace: demo
|
39
|
+
name: demo-2a78a13682
|
40
|
+
labels:
|
41
|
+
app: demo
|
42
|
+
apiVersion: v1
|
43
|
+
kind: Secret
|
44
|
+
data:
|
45
|
+
KEY1: c2VjcmV0dmFsdWUx
|
46
|
+
KEY2: c2VjcmV0dmFsdWUy
|
47
|
+
```
|
48
|
+
|
49
|
+
## Options
|
50
|
+
|
51
|
+
Here's an example of the available options for `google_secret_data`.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
google_secret_data("demo-#{Kubes.env}-secret-data", base64: true, ident: 2)
|
55
|
+
```
|
data/docs/_docs/helpers.md
CHANGED
@@ -2,18 +2,9 @@
|
|
2
2
|
title: Helpers
|
3
3
|
---
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
--- | ---
|
9
|
-
decode64 | Base64 decode a string.
|
10
|
-
docker_image | Method refers to the latest Docker image built by Kubes. This spares you from having to update the image manually in the deployment resource. Note, this can be overridden with the `--image` cli option or the `Kubes.config.image` setting. See: [Docker Image]({% link _docs/intro/docker-image.md %})
|
11
|
-
dockerfile_port | Exposed port extracted from the Dockerfile of the project.
|
12
|
-
encode64 | Base64 encode a string. Also available as `base64` method.
|
13
|
-
extra | The `KUBES_EXTRA` value.
|
14
|
-
with_extra | Appends the `KUBES_EXTRA` value to a string if it's set. It's covered in the [Extra Env Docs]({% link _docs/extra-env.md %}).
|
15
|
-
|
16
|
-
Here's also the source code with most of the helpers: [helpers.rb](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/compiler/shared/helpers.rb).
|
5
|
+
## Built-In Helpers
|
6
|
+
|
7
|
+
Kubes provides core helper methods to help write Kubernetes YAML files. Docs: [Built-In Helpers]({% link _docs/helpers/builtin.md %}).
|
17
8
|
|
18
9
|
## DSL Specific Methods
|
19
10
|
|
@@ -1,10 +1,9 @@
|
|
1
|
-
|
1
|
+
---
|
2
|
+
title: Install Dependencies
|
3
|
+
---
|
2
4
|
|
3
|
-
|
5
|
+
These dependencies are not included with any of the installers. This allows you to install and run the versions you want to use.
|
4
6
|
|
5
|
-
gem install kubes
|
6
|
-
|
7
|
-
Ruby 2.7 and above is recommended.
|
8
7
|
|
9
8
|
## kubectl
|
10
9
|
|
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
title: How to Use Custom Version of Kubes
|
3
|
+
nav_text: Custom Version
|
4
|
+
category: gem
|
5
|
+
order: 1
|
6
|
+
---
|
7
|
+
|
8
|
+
If you want or need to run a forked version of kubes, here's how:
|
9
|
+
|
10
|
+
## Change Version Number
|
11
|
+
|
12
|
+
First, clone down the source and change version number so you can identify that it's a custom version. Clone down the project:
|
13
|
+
|
14
|
+
$ git clone https://github.com/boltops-tools/kubes
|
15
|
+
|
16
|
+
Update [lib/kubes/version.rb](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/version.rb) so you'll be able to tell that it's a custom build. For example:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
module kubes
|
20
|
+
VERSION = "0.8.2.custom"
|
21
|
+
end
|
22
|
+
```
|
23
|
+
|
24
|
+
There are 2 ways to use the custom version:
|
25
|
+
|
26
|
+
1. Gemfile: Forked Git Source
|
27
|
+
2. Gem Package: Build and Install
|
28
|
+
|
29
|
+
## Gemfile: Forked Git Source
|
30
|
+
|
31
|
+
Point `kubes ` to use your repo with the forked version. Example:
|
32
|
+
|
33
|
+
Gemfile:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
source "https://rubygems.org"
|
37
|
+
gem 'kubes', git: 'https://github.com/REPO/kubes', branch: "master"
|
38
|
+
```
|
39
|
+
|
40
|
+
Remember to change `REPO`, to your repo name.
|
41
|
+
|
42
|
+
Then run:
|
43
|
+
|
44
|
+
bundle
|
45
|
+
|
46
|
+
## Gem Package: Build and Install
|
47
|
+
|
48
|
+
Build the gem package:
|
49
|
+
|
50
|
+
$ bundle
|
51
|
+
$ rake build
|
52
|
+
pkg/kubes-0.8.2.custom.gem
|
53
|
+
|
54
|
+
The produced `.gem` file can used to install the gem. You can install it locally:
|
55
|
+
|
56
|
+
$ gem install pkg/kubes-0.8.2.custom.gem
|
57
|
+
$ kubes -v
|
58
|
+
0.8.2.custom
|
59
|
+
|
60
|
+
Or on any machine with Ruby installed. You can copy it to the machine, ssh into it, and install the custom gem:
|
61
|
+
|
62
|
+
$ scp pkg/kubes-0.8.2.custom.gem user@server.com:
|
63
|
+
$ ssh user@server.com
|
64
|
+
$ gem install kubes-0.8.2.custom.gem
|
65
|
+
$ kubes -v
|
66
|
+
0.8.2.custom
|
67
|
+
|
68
|
+
## Contributing
|
69
|
+
|
70
|
+
Learning how to run a forked version of kubes allows you to make changes to the tool. Consider improving kubes by submitting a Pull Request. See: [Contributing]({% link _docs/contributing.md %}).
|
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
title: "Install: CentOS/RedHat/Fedora"
|
3
|
+
nav_text: CentOS
|
4
|
+
category: standalone
|
5
|
+
order: 2
|
6
|
+
---
|
7
|
+
|
8
|
+
This page shows you how to install kubes on CentOS, RedHat, Fedora and other Linux systems that use the yum-based package manager.
|
9
|
+
|
10
|
+
## CentOS/RedHat/Fedora
|
11
|
+
|
12
|
+
Configure repo
|
13
|
+
|
14
|
+
sudo su
|
15
|
+
curl -so /etc/yum.repos.d/boltops.repo https://yum.boltops.com/boltops.repo
|
16
|
+
rpm --import https://yum.boltops.com/boltops-key.public
|
17
|
+
|
18
|
+
Install
|
19
|
+
|
20
|
+
yum install -y kubes
|
21
|
+
|
22
|
+
Upgrade
|
23
|
+
|
24
|
+
yum makecache
|
25
|
+
yum update -y kubes
|
26
|
+
|
27
|
+
Uninstall
|
28
|
+
|
29
|
+
yum remove -y kubes
|
30
|
+
|
31
|
+
{% include install/wrapper.md %}
|
32
|
+
|
33
|
+
## Fedora Notes
|
34
|
+
|
35
|
+
For Fedora, you may also need the libxcrypt-compat package.
|
36
|
+
|
37
|
+
dnf install libxcrypt-compat -y
|
38
|
+
|
39
|
+
Or you'll get this error:
|
40
|
+
|
41
|
+
$ kubes -h
|
42
|
+
/opt/kubes/embedded/bin/ruby: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
|
43
|
+
$
|
44
|
+
|
45
|
+
Fedora is a bleeding edge distro and is quicker about upgrading their system. The `libcrypt.so` has been removed. The libxcrypt-compat package installs it back.
|
46
|
+
|
47
|
+
## Amazon Linux 2 Notes
|
48
|
+
|
49
|
+
The standalone installer does not support Amazon Linux 1. Please use Amazon Linux 2 instead.
|
50
|
+
|
51
|
+
## Rpm Install
|
52
|
+
|
53
|
+
You can also download the rpm package and install it directly. Here are the commands:
|
54
|
+
|
55
|
+
wget https://yum.boltops.com/packages/kubes/kubes-latest.rpm
|
56
|
+
sudo su
|
57
|
+
rpm -ivh kubes-latest.rpm
|
58
|
+
kubes -h
|
59
|
+
|
60
|
+
To upgrade an existing install also use the `-U` flag.
|
61
|
+
|
62
|
+
rpm -Uivh kubes-latest.rpm
|
63
|
+
|
64
|
+
You can check [kubes-latest.rpm.metadata.json](https://yum.boltops.com/packages/kubes/kubes-latest.rpm.metadata.json) to verify the package checksum. Here's the checksum command.
|
65
|
+
|
66
|
+
sha256sum kubes-latest.rpm
|
67
|
+
|
68
|
+
To uninstall
|
69
|
+
|
70
|
+
rpm -e kubes-latest.rpm
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
title: "Standalone Permissions"
|
3
|
+
nav_text: Permissions
|
4
|
+
category: standalone-details
|
5
|
+
---
|
6
|
+
|
7
|
+
The kubes standalone installer will make sure that the owner and permissions of the `/opt/kubes` folder is your user.
|
8
|
+
|
9
|
+
If the `/opt/kubes` folder is not owned by your user for whatever reason, here are the commands to change it:
|
10
|
+
|
11
|
+
For macosx:
|
12
|
+
|
13
|
+
sudo chown -R `whoami`:staff /opt/kubes
|
14
|
+
|
15
|
+
For other Linux OSes, this is generally:
|
16
|
+
|
17
|
+
sudo chown -R `whoami`:`whoami` /opt/kubes
|
18
|
+
|
19
|
+
## Why?
|
20
|
+
|
21
|
+
When the `/opt/kubes` folder is not owned by your user, you won't be able to write to it without sudo. This results in a sudo prompt when kubes calls `bundle` and tries to install new gems. You will see this:
|
22
|
+
|
23
|
+
=> Installing dependencies with: bundle install
|
24
|
+
Following files may not be writable, so sudo is needed:
|
25
|
+
/opt/kubes/embedded/bin
|
26
|
+
/opt/kubes/embedded/lib/ruby/gems/2.7.0
|
27
|
+
/opt/kubes/embedded/lib/ruby/gems/2.7.0/cache
|
28
|
+
/opt/kubes/embedded/lib/ruby/gems/2.7.0/extensions
|
29
|
+
/opt/kubes/embedded/lib/ruby/gems/2.7.0/gems
|
30
|
+
/opt/kubes/embedded/lib/ruby/gems/2.7.0/specifications
|
31
|
+
|
32
|
+
Your user account isn't allowed to install to the system RubyGems.
|
33
|
+
You can cancel this installation and run:
|
34
|
+
|
35
|
+
bundle install --path vendor/bundle
|
36
|
+
|
37
|
+
to install the gems into ./vendor/bundle/, or you can enter your password
|
38
|
+
and install the bundled gems to RubyGems using sudo.
|
39
|
+
|
40
|
+
Password:
|
41
|
+
|
42
|
+
To fix this issue, make sure `/opt/kubes` is owned by your user, instead of repeatedly having to type your password for sudo.
|
43
|
+
|
44
|
+
Also, running `sudo` means you're using bare shell with pretty much none of your environment settings or variables configured. Though there are ways to [preserve](https://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo) environment variables with `--preserve-env`, it's often better to avoid sudo as you'll run into different environmental differences and quirks.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
title: "Uninstall Cleanup"
|
3
|
+
nav_text: Uninstall
|
4
|
+
category: standalone-details
|
5
|
+
order: 4
|
6
|
+
---
|
7
|
+
|
8
|
+
Some packager managers will not clean up the installed files completely. The apt-get and yum package manager generally cleans up everything. Homebrew doesn't seem to clean up currently though.
|
9
|
+
|
10
|
+
To fully clean up and uninstall kubes. First, run the package manger uninstall command and then clean up with:
|
11
|
+
|
12
|
+
rm -rf /opt/kubes
|
13
|
+
|
14
|
+
Then remove the kubes wrappers in `/usr/local/bin`. You can remove them with this command:
|
15
|
+
|
16
|
+
grep -l /opt/kubes /usr/local/bin/* | xargs rm -f
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
title: "Standalone Details"
|
3
|
+
nav_text: Details
|
4
|
+
category: standalone
|
5
|
+
order: 9
|
6
|
+
---
|
7
|
+
|
8
|
+
The standalone installer packages are built within a few minutes of the kubes gem release. This page covers more details on how the standalone installation works.
|
9
|
+
|
10
|
+
## Isolated: /opt/kubes
|
11
|
+
|
12
|
+
The standalone kubes package installs kubes in `/opt/kubes`. This folder contains everything like system libraries, Ruby, and gems needed for kubes to work as a standalone package. Additionally, this also makes it easy to remove kubes.
|
13
|
+
|
14
|
+
## Wrapper: /usr/local/bin
|
15
|
+
|
16
|
+
The installer creates a wrapper script in `/usr/local/bin`.
|
17
|
+
|
18
|
+
/usr/local/bin/kubes
|
19
|
+
|
20
|
+
Most users have `/usr/local/bin` configured in there PATH. So this wrapper should work.
|