kubes 0.7.8 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/docs/.gitignore +1 -0
  4. data/docs/Gemfile +2 -0
  5. data/docs/_config.yml +8 -0
  6. data/docs/_docs/config/app-overrides.md +7 -0
  7. data/docs/_docs/config/boot.md +46 -0
  8. data/docs/_docs/config/env.md +29 -2
  9. data/docs/_docs/config/hooks/docker.md +2 -0
  10. data/docs/_docs/config/hooks/generator.md +16 -0
  11. data/docs/_docs/config/hooks/kubectl.md +2 -0
  12. data/docs/_docs/config/hooks/kubes.md +2 -0
  13. data/docs/_docs/config/reference.md +2 -2
  14. data/docs/_docs/config/skip.md +22 -0
  15. data/docs/_docs/helpers/aws/iam-role.md +1 -0
  16. data/docs/_docs/helpers/google/gke.md +1 -1
  17. data/docs/_docs/install/dependencies.md +18 -0
  18. data/docs/_docs/install/gem.md +6 -0
  19. data/docs/_docs/install/standalone/centos.md +70 -0
  20. data/docs/_docs/install/standalone/details/permissions.md +44 -0
  21. data/docs/_docs/install/standalone/details/uninstall.md +16 -0
  22. data/docs/_docs/install/standalone/details.md +20 -0
  23. data/docs/_docs/install/standalone/macosx.md +45 -0
  24. data/docs/_docs/install/standalone/ubuntu.md +48 -0
  25. data/docs/_docs/install/standalone.md +43 -0
  26. data/docs/_docs/install.md +8 -0
  27. data/docs/_docs/learn/dsl/install.md +1 -1
  28. data/docs/_docs/learn/yaml/install.md +1 -1
  29. data/docs/_docs/patterns/central-deployer.md +38 -0
  30. data/docs/_docs/variables/advanced.md +32 -1
  31. data/docs/_docs/variables/basic.md +1 -0
  32. data/docs/_docs/vs/custom.md +2 -0
  33. data/docs/_docs/vs/helm.md +2 -0
  34. data/docs/_docs/vs/kustomize.md +3 -1
  35. data/docs/_docs/vs.md +2 -0
  36. data/docs/_docs/yaml/erb-comment.md +89 -0
  37. data/docs/_includes/banner/foot.html +2 -0
  38. data/docs/_includes/banner/head.html +5 -0
  39. data/docs/_includes/config/app-overrides-cheatsheet.md +44 -0
  40. data/docs/_includes/config/hooks/generator.md +6 -0
  41. data/docs/_includes/content.html +1 -1
  42. data/docs/_includes/install/gem.md +7 -0
  43. data/docs/_includes/install/wrapper.md +9 -0
  44. data/docs/_includes/layering/layers.md +3 -0
  45. data/docs/_includes/learn/next-steps.md +11 -0
  46. data/docs/_includes/sidebar.html +28 -3
  47. data/docs/_includes/videos/learn/vs.md +4 -0
  48. data/docs/_includes/videos/learn.md +12 -0
  49. data/docs/_includes/videos/youtube.md +1 -0
  50. data/docs/_layouts/default.html +3 -0
  51. data/docs/_reference/kubes-new-hook.md +30 -0
  52. data/docs/_reference/kubes-new-variable.md +7 -0
  53. data/docs/_reference/kubes-new.md +1 -0
  54. data/docs/_sass/theme.scss +11 -0
  55. data/docs/bin/web +1 -1
  56. data/docs/js/scripts.js +7 -0
  57. data/kubes.gemspec +1 -0
  58. data/lib/kubes/booter.rb +26 -0
  59. data/lib/kubes/cli/help/new/hook.md +9 -0
  60. data/lib/kubes/cli/help/new/variable.md +6 -0
  61. data/lib/kubes/cli/init.rb +0 -1
  62. data/lib/kubes/cli/new/hook.rb +18 -0
  63. data/lib/kubes/cli/new.rb +4 -0
  64. data/lib/kubes/command.rb +1 -1
  65. data/lib/kubes/compiler/decorator/hashable.rb +1 -1
  66. data/lib/kubes/compiler/layering.rb +9 -0
  67. data/lib/kubes/compiler/shared/runtime_helpers.rb +8 -1
  68. data/lib/kubes/compiler/strategy/erb/comment.rb +46 -0
  69. data/lib/kubes/compiler/strategy/erb.rb +4 -0
  70. data/lib/kubes/compiler/strategy/result.rb +13 -1
  71. data/lib/kubes/compiler.rb +2 -0
  72. data/lib/kubes/config.rb +6 -2
  73. data/lib/kubes/core.rb +4 -0
  74. data/lib/kubes/kubectl/ordering.rb +9 -6
  75. data/lib/kubes/version.rb +1 -1
  76. data/lib/kubes.rb +3 -0
  77. data/lib/templates/new/hooks/docker.rb +9 -0
  78. data/lib/templates/new/hooks/kubectl.rb +11 -0
  79. data/lib/templates/new/hooks/kubes.rb +9 -0
  80. data/lib/templates/yaml/.kubes/resources/base/deployment.yaml.tt +2 -0
  81. data/spec/kubes/compiler/decorator/post/deployment_spec.rb +1 -1
  82. metadata +51 -5
  83. data/docs/_docs/intro/install.md +0 -6
  84. data/docs/_includes/intro/install.md +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55d217f4b05371a806a18151034bf36ff420fbc6724f1367c441d337a3ed71ad
4
- data.tar.gz: 31912f0fb17ac8bb91acbc03cbb3cbbcd5f769170535ca7a48ea5dfe61aa0e40
3
+ metadata.gz: 484309e2efc4a2e2aa6b1491320b896b013bd1d963b795e15efe08a0f550337b
4
+ data.tar.gz: cbfab84cc9adca44c14ad5ed3ee1d92417a0a5615981bcaba6a81219a13c6938
5
5
  SHA512:
6
- metadata.gz: da80f1de9af4f31ae3b449261591979e499a70f29c85bea4aa2e87d2c4efba8c63ef6c09cd71a423e5164ed5f8598062d3ffbcb6cc5fb01855484a29794026d8
7
- data.tar.gz: 926c67bb5cdef8be996b8ded90a251f4ef6643ea40aaa1a817ed596d6482dc1cfcecd6f99322730c0a68df5c113e7708b0c1222abdea2e299bcc79779cda2916
6
+ metadata.gz: 6e0d546a1ef39c9da45dca25883e2ea903f205abd49ca982813e13ffb9e4147d7af450ff5c82812e275c1a758d673df71ed3992858eb3da0a24b7bec4918d466
7
+ data.tar.gz: 72ffc9257d4924485968d7006b87f08edb66d02b4b8f358992651a9abda6ce94ffe22a57f6fdc40d84f1c4a43e1cbdf04b326fc9d1221a11a04af56d2be0e527
data/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
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.1] - 2022-02-06
7
+ - allow --version command to run outside project
8
+
9
+ ## [0.8.0] - 2022-02-06
10
+ - [#58](https://github.com/boltops-tools/kubes/pull/58) standalone install docs
11
+ - [#59](https://github.com/boltops-tools/kubes/pull/59) central deployer support
12
+
13
+ ## [0.7.10] - 2021-12-18
14
+ - [#56](https://github.com/boltops-tools/kubes/pull/56) New hook generator
15
+ - [#57](https://github.com/boltops-tools/kubes/pull/57) Fix activesupport require
16
+ - add nokogiri dependency. looks like aws-sdk removed it and its breaking specs
17
+ - hook generator docs
18
+ - new hook generator
19
+
20
+ ## [0.7.9] - 2021-11-07
21
+ - [#55](https://github.com/boltops-tools/kubes/pull/55) make helper methods available in variables files
22
+
6
23
  ## [0.7.8] - 2021-10-29
7
24
  - [#54](https://github.com/boltops-tools/kubes/pull/54) fix configMap and secret hash when not first element in Array
8
25
 
data/docs/.gitignore CHANGED
@@ -3,3 +3,4 @@ _site
3
3
  .jekyll-metadata
4
4
  .jekyll-cache
5
5
  Gemfile.lock
6
+ _config-dev.yml
data/docs/Gemfile CHANGED
@@ -2,11 +2,13 @@ source "https://rubygems.org"
2
2
 
3
3
  gem "html-proofer"
4
4
  gem "jekyll"
5
+ gem "jekyll-include-cache"
5
6
  gem "opal"
6
7
  gem "opal-browser"
7
8
  gem "opal-jquery"
8
9
  gem "rake"
9
10
  gem "rerun"
11
+ gem "webrick"
10
12
 
11
13
  # GitHub pages does not support this plugin.
12
14
  # GitHub pages will not serve zipped assets even if we precompress them before hand.
data/docs/_config.yml CHANGED
@@ -69,3 +69,11 @@ defaults:
69
69
 
70
70
  plugins_dir:
71
71
  # - jekyll-gzip - GitHub pages does not support this plugin.
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
+
79
+ ads_url: "https://ads.boltops.com"
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: App Overrides Cheatsheet
3
+ ---
4
+
5
+ Kubes supports app-level overrides. This is especially useful for the [Central Deployer Pattern]({% link _docs/patterns/central-deployer.md %}).
6
+
7
+ {% include config/app-overrides-cheatsheet.md %}
@@ -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)
@@ -16,7 +16,9 @@ Kubes.configure do |config|
16
16
  end
17
17
  ```
18
18
 
19
- ## Layering
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
- For more details refer to the [Layering Docs]({% link _docs/layering.md %}).
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
 
@@ -4,6 +4,8 @@ nav_text: Docker
4
4
  categories: hooks
5
5
  ---
6
6
 
7
+ {% include config/hooks/generator.md type="docker" %}
8
+
7
9
  Here are some examples of running custom hooks before and after the docker commands.
8
10
 
9
11
  ## Build Hooks
@@ -0,0 +1,16 @@
1
+ ---
2
+ title: Hook Generator
3
+ nav_text: Generator
4
+ categories: hooks
5
+ order: 9
6
+ ---
7
+
8
+ ## Examples
9
+
10
+ $ kubes new hook docker
11
+ create .kubes/config/hooks/docker.rb
12
+ $ kubes new hook kubectl
13
+ create .kubes/config/hooks/kubectl.rb
14
+ $ kubes new hook kubes
15
+ create .kubes/config/hooks/kubes.rb
16
+ $
@@ -4,6 +4,8 @@ nav_text: Kubectl
4
4
  categories: hooks
5
5
  ---
6
6
 
7
+ {% include config/hooks/generator.md type="kubectl" %}
8
+
7
9
  You can use hooks to run scripts at any part of the `kubectl` commands. Here's an example of running a script before and after the `kubectl apply` command for the `web/deployment` resource.
8
10
 
9
11
  .kubes/config/hooks/kubectl.rb
@@ -4,6 +4,8 @@ nav_text: Kubes
4
4
  categories: hooks
5
5
  ---
6
6
 
7
+ {% include config/hooks/generator.md type="kubes" %}
8
+
7
9
  You can use hooks to run scripts at specific steps of the `kubes deploy` lifecycle.
8
10
 
9
11
  ## Lifecycle Hooks
@@ -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 | true
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}`
@@ -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.
@@ -16,6 +16,7 @@ iam_role = KubesAws::IamRole.new(
16
16
  namespace: "demo-#{Kubes.env}", # defaults to APP-ENV when not set. IE: demo-dev
17
17
  managed_policies: ["AmazonS3ReadOnlyAccess", "AmazonSSMReadOnlyAccess"], # defaults to empty when not set
18
18
  inline_policies: [:secrets_read_only], # See Secrets Read Only Inline Policy at the bottom
19
+ # cluster: "eks-cluster-name", # inferred with kubectl when not set
19
20
  )
20
21
  before("apply",
21
22
  label: "create iam role",
@@ -49,7 +49,7 @@ To build kubes as a Docker image entrypoint for [Google CloudBuild Custom Builde
49
49
 
50
50
  Be sure to set GOOGLE_PROJECT to your own project id.
51
51
 
52
- ## Example Codebuild YAML
52
+ ## Example Cloudbuild YAML
53
53
 
54
54
  cloudbuild.yaml:
55
55
 
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: Install Dependencies
3
+ ---
4
+
5
+ These dependencies are not included with any of the installers. This allows you to install and run the versions you want to use.
6
+
7
+
8
+ ## kubectl
9
+
10
+ Kubes calls kubectl. Kubes has been tested with kubectl v1.15+. Generally, it should work with most versions of kubectl.
11
+
12
+ ## docker
13
+
14
+ Kubes calls docker. Kubes has been tested with docker 18.x-ce+. Generally, it should work with most versions of docker.
15
+
16
+ ## gcloud
17
+
18
+ If you are using the [gcloud builder]({% link _docs/config/builder.md %}), set up and configure the [gcloud cli](https://cloud.google.com/sdk/install).
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: Gem Installation
3
+ ---
4
+
5
+ {% include install/gem.md %}
6
+
@@ -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.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: "Install: Mac OSX"
3
+ nav_text: MacOSX
4
+ category: standalone
5
+ order: 1
6
+ ---
7
+
8
+ This page shows you how to install kubes on Mac OSX.
9
+
10
+ Here's a "Mac OSX Homebrew Install" Video:
11
+
12
+ ## Homebrew
13
+
14
+ You can install kubes via homebrew.
15
+
16
+ Install
17
+
18
+ brew tap boltops-tools/software
19
+ brew install kubes
20
+
21
+ Upgrade
22
+
23
+ brew update
24
+ brew install kubes
25
+
26
+ Uninstall
27
+
28
+ brew uninstall kubes
29
+
30
+ Cleanup
31
+
32
+ rm -rf /opt/kubes
33
+ grep -l /opt/kubes /usr/local/bin/* | xargs rm -f
34
+
35
+ {% include install/wrapper.md %}
36
+
37
+ ## DMG
38
+
39
+ You can also download the dmg and install with the Mac OSX GUI installer.
40
+
41
+ Download link: [kubes DMG](https://tap.boltops.com/packages/kubes/kubes-latest.dmg)
42
+
43
+ You can check [kubes-latest.dmg.metadata.json](https://tap.boltops.com/packages/kubes/kubes-latest.dmg.metadata.json) to verify the package checksum. Here's the checksum command.
44
+
45
+ shasum -a 256 kubes-latest.dmg
@@ -0,0 +1,48 @@
1
+ ---
2
+ title: "Install: Ubuntu/Debian"
3
+ nav_text: Ubuntu
4
+ category: standalone
5
+ order: 3
6
+ ---
7
+
8
+ This page shows you how to install kubes on Ubuntu and Debian based linux systems that use the apt package manager.
9
+
10
+ ## Ubuntu/Debian: apt-get install
11
+
12
+ Configure repo
13
+
14
+ sudo su
15
+ echo "deb https://apt.boltops.com stable main" > /etc/apt/sources.list.d/boltops.list
16
+ curl -s https://apt.boltops.com/boltops-key.public | apt-key add -
17
+
18
+ Install
19
+
20
+ apt-get update
21
+ apt-get install -y kubes
22
+
23
+ Upgrade
24
+
25
+ apt-get install -y kubes
26
+
27
+ Remove
28
+
29
+ apt-get remove -y kubes
30
+
31
+ {% include install/wrapper.md %}
32
+
33
+ ## Deb Install
34
+
35
+ You can also download the deb package and install it directly. Here are the commands:
36
+
37
+ Install
38
+
39
+ wget https://apt.boltops.com/packages/kubes/kubes-latest.deb
40
+ dpkg -i kubes-latest.deb
41
+
42
+ You can check [kubes-latest.deb.metadata.json](https://apt.boltops.com/packages/kubes/kubes-latest.deb.metadata.json) to verify the package checksum. Here's the checksum command.
43
+
44
+ sha256sum kubes-latest.deb
45
+
46
+ Uninstall
47
+
48
+ dpkg -r kubes-latest.deb
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Standalone Package Installation
3
+ ---
4
+
5
+ You can install Kubes as a standalone package. The nice thing about this approach is that it is easy. You don't have to have Ruby installed. You don’t have to worry about compatible Ruby versions, gems, or conflicting system packages.
6
+
7
+ Kubes provides the pre-built binaries. Other tools such as [vagrant](https://www.vagrantup.com/), written in ruby, and the [aws cli](https://aws.amazon.com/cli/), written in python, also work the same way.
8
+
9
+ Important: If you're using rvm or rbenv and already have Ruby installed, you should [install kubes as a gem]({% link _docs/install/gem.md %}). Otherwise, different gem dependencies from the two installations can be used and cause all kinds of trouble.
10
+
11
+ Below are quickstart instructions for different OSes.
12
+
13
+ ## Mac OSX
14
+
15
+ brew tap boltops-tools/software
16
+ brew install kubes
17
+
18
+ More info on [Mac OSX Install]({% link _docs/install/standalone/macosx.md %})
19
+
20
+ ## CentOS/RedHat/Fedora
21
+
22
+ sudo su
23
+ curl -so /etc/yum.repos.d/boltops.repo https://yum.boltops.com/boltops.repo
24
+ rpm --import https://yum.boltops.com/boltops-key.public
25
+ yum install -y kubes
26
+
27
+ More info on [CentOS Install]({% link _docs/install/standalone/centos.md %})
28
+
29
+ ## Ubuntu/Debian
30
+
31
+ sudo su
32
+ echo "deb https://apt.boltops.com stable main" > /etc/apt/sources.list.d/boltops.list
33
+ curl -s https://apt.boltops.com/boltops-key.public | apt-key add -
34
+ apt-get update
35
+ apt-get install -y kubes
36
+
37
+ More info on [Ubuntu Install]({% link _docs/install/standalone/ubuntu.md %})
38
+
39
+ {% include install/wrapper.md %}
40
+
41
+ ## How It Works
42
+
43
+ The standalone installer packages are built within a few minutes of the kubes gem release. Here are also details on how the standalone installer works: [Standalone Details]({% link _docs/install/standalone/details.md %}).
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Installation
3
+ ---
4
+
5
+ Here are the ways to install Kubes.
6
+
7
+ 1. [Gem]({% link _docs/install/gem.md %}): This is a great way if you already have Ruby on your system.
8
+ 2. [Standalone Installer]({% link _docs/install/standalone.md %}): This is a great way if you don't yet have Ruby installed, and want a quick and easy way to install Kubes. There are installers for [Mac OSX]({% link _docs/install/standalone/macosx.md %}), [CentOS]({% link _docs/install/standalone/centos.md %}), [Ubuntu]({% link _docs/install/standalone/ubuntu.md %}), etc.
@@ -2,4 +2,4 @@
2
2
  title: Install Kubes
3
3
  ---
4
4
 
5
- {% include intro/install.md %}
5
+ {% include install/gem.md %}
@@ -2,4 +2,4 @@
2
2
  title: Install Kubes
3
3
  ---
4
4
 
5
- {% include intro/install.md %}
5
+ {% include install/gem.md %}
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: Central Deployer Pattern
3
+ nav_text: Central Deployer
4
+ categories: patterns
5
+ ---
6
+
7
+ Kubes can be use as either an app-centric or ops-centric tool.
8
+
9
+ * **app-centric**: Each app repo has it's own `.kubes` settings files. This is useful if your applications are very differently setup.
10
+ * **ops-centric**: Each app repo has pretty much the same `.kubes` settings files. This is useful if your applications are very similarly setup.
11
+
12
+ ## Setup
13
+
14
+ With an ops-centric approach, you use the same `.kubes` settings files for the app repos you want to use. For example:
15
+
16
+ https://github.com/repo/app1
17
+ https://github.com/repo/app2
18
+
19
+ You then also have a
20
+
21
+ https://github.com/repo/.kubes
22
+
23
+ You can simply copy the `.kubes` folder into the app repo folder or even add the `repo/.kubes` as a submodule.
24
+
25
+ You'll end up with something like this:
26
+
27
+ app1/.kubes
28
+ app2/.kubes
29
+
30
+ Then to deploy different app level settings.
31
+
32
+ {% include config/app-overrides-cheatsheet.md %}
33
+
34
+ Also check out: [App Overrides Docs]({% link _docs/config/app-overrides.md %}).
35
+
36
+ The central deployer approach is removes duplication of the kubes config files between projects. Leveraging app-level overrides gives provides a great degree of control.
37
+
38
+ If the settings start to diverge too much, then it probably makes sense to use separate .kubes files in that app specific repo.