kubes 0.8.5 → 0.8.8

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: 7d4f55863bc9b85ce81ef58001438359486ff5d04f8659cdb78a9129495e44f5
4
- data.tar.gz: 47028f4b0ea54bdde4cbfc0dce71ace1c7a8a1ffdf895c745a595318120da9cd
3
+ metadata.gz: 1c88d1788b4ecebd40180a69bcf8be5d7f8e8128ee40b1a4d7d862bc279697dd
4
+ data.tar.gz: 8a072ba5a27be585a0e278ec1aaff1b16e3240c9ad8a86caa97536d912832f67
5
5
  SHA512:
6
- metadata.gz: a2b7d7e1d8f50a1c5a2900f2a8114219f79ad1e11b942cf4bc57970b4e44875bc7fe4389c99331396c7173c155fab75822e57044012f6446d4ae14f719177615
7
- data.tar.gz: 4785cb4de213f738fa667f865c36b29636f1919e1dc46093c2d88e3cb8cf2c2472f77f8812279383419e3274da7186897519ccbc4a3107cccbcc67f53a294e26
6
+ metadata.gz: e2fb01f36269bc38b4123bc7321dc5f5787590af8b5ea74429aa0f494915378940ef7a22effd1edf67607c26a04ad040242009b0680b7e46a08747c257b8b357
7
+ data.tar.gz: 5526ece8f8f78d7ca8fe9fac76ee4fb4171b6a9f505003382cafd9239a5d1d828b9c5fd2e61c1c3c3e01d1f7a5336cf72ed3f896128f15f5d46607eba1695a31
@@ -0,0 +1 @@
1
+ github: boltops-tools
data/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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.8] - 2022-08-11
7
+ - add Kubes.extra method
8
+ - update managed_certificate and ingress apiVersion
9
+
10
+ ## [0.8.7] - 2022-06-21
11
+ - [#63](https://github.com/boltops-tools/kubes/pull/63) remove kubes meta from yaml
12
+ - adjust app layer. keep old layer also for now though
13
+
14
+ ## [0.8.6] - 2022-02-16
15
+ - [#62](https://github.com/boltops-tools/kubes/pull/62) config map files: add Kubes.app txt layer
16
+
6
17
  ## [0.8.5] - 2022-02-16
7
18
  - [#61](https://github.com/boltops-tools/kubes/pull/61) add erb support for config_map_files and generic_secret_data helpers
8
19
 
@@ -6,6 +6,13 @@ categories: hooks
6
6
 
7
7
  {% include config/hooks/generator.md type="docker" %}
8
8
 
9
+ ## Docker Hooks
10
+
11
+ Hook | Description
12
+ ---|---
13
+ build | When kubes builds Docker image.
14
+ push | When kubes pushes the Docker image.
15
+
9
16
  Here are some examples of running custom hooks before and after the docker commands.
10
17
 
11
18
  ## Build Hooks
@@ -17,7 +17,7 @@ apply | When kubes runs all the `kubectl apply` commands.
17
17
  delete | When kubes runs all the `kubectl delete` commands.
18
18
  prune | When kubes prunes. IE: To clean old secrets.
19
19
 
20
- ## Lifecycle At Kubes Level
20
+ ## Kubes Lifecyle Level
21
21
 
22
22
  These lifecycle points occur at a higher-level than the `kubectl` commands. Here's an example to help explain:
23
23
 
@@ -53,11 +53,12 @@ data:
53
53
 
54
54
  ## Layering Details
55
55
 
56
- Layering for Config Map Files and also supports app-scoped layers.
56
+ Config Map Files also supports App-Scoped Layering.
57
57
 
58
58
  Name | Example
59
59
  --- | ---
60
60
  configmap root | .kubes/resources/shared/config_map/{base,dev}.txt
61
- configmap app-scoped | .kubes/resources/shared/config_map/app1/{base,dev}.txt
61
+ configmap app file | .kubes/resources/shared/config_map/app1.txt
62
+ configmap app folder | .kubes/resources/shared/config_map/app1/{base,dev}.txt
62
63
 
63
64
  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 %}).
@@ -16,7 +16,7 @@ Now, use `kubectl` directly and apply them in the proper order:
16
16
  kubectl apply -f .kubes/output/web/service.yaml
17
17
  kubectl apply -f .kubes/output/web/deployment.yaml
18
18
 
19
- The deploy command simpifily does all 3 steps: build, compile, and apply.
19
+ The deploy command simply does all 3 steps: build, compile, and apply.
20
20
 
21
21
  kubes deploy
22
22
 
@@ -9,7 +9,7 @@ If you already a project with an existing Dockerfile, you can use that. If you d
9
9
 
10
10
  {% include learn/repos.md %}
11
11
 
12
- Let's generate a starter project:
12
+ Let's initialize a starter kubes project. This is similar to a `git init`.
13
13
 
14
14
  $ kubes init --app demo --repo $REPO --type dsl
15
15
  create .kubes/config.rb
@@ -9,7 +9,7 @@ If you already a project with an existing Dockerfile, you can use that. If you d
9
9
 
10
10
  {% include learn/repos.md %}
11
11
 
12
- Let's generate a starter project:
12
+ Let's initialize a starter kubes project. This is similar to a `git init`.
13
13
 
14
14
  $ kubes init --app demo --repo $REPO
15
15
  create Dockerfile
@@ -1,11 +1,11 @@
1
- * Automation: [Builds the Docker image]({% link _docs/config/docker.md %}) and updates the compiled YAML files
2
- * Syntactic Sugar: Use an [ERB/YAML]({% link _docs/yaml.md %}) or a [DSL]({% link _docs/dsl.md %}) to write your Kubernetes YAML files. You can use a mix of DSL and YAML definitions in the `.kubes/resources` folder.
3
- * Layering: Use the same Kubernetes YAML to build multiple environments like dev and prod with [layering]({% link _docs/layering.md %}).
4
- * Secrets: Use helpers like [aws_secret]({% link _docs/helpers/aws/secrets.md %}), [aws_ssm]({% link _docs/helpers/aws/ssm.md %}), and [google_secret]({% link _docs/helpers/google/secrets.md %}) to build Kubernetes secrets.yaml from secret providers designed for it.
5
- * Generators: Kubes ships with a few generators to help you get building with Kubernetes quickly. See: [Generator Docs]({% link _docs/generators.md %}).
6
- * CLI Customizations: You can customize the [cli args]({% link _docs/config/args/kubectl.md %}).
7
- * Hooks: You can also run [hooks]({% link _docs/config/hooks.md %}) before and after [kubes]({% link _docs/config/hooks/kubes.md %}) and [kubectl]({% link _docs/config/hooks/kubectl.md %}) commands.
8
- * Automated Suffix Hashes: Automatically appends a suffix hash to ConfigMap and Secret resources. More details in [ConfigMap]({% link _docs/dsl/resources/config_map.md %}) and [Secret]({% link _docs/dsl/resources/secret.md %}) docs.
9
- * Kustomize Support: If you're a kustomization user, you can use it with Kubes. More details in [Kustomize Support Docs]({% link _docs/misc/kustomize.md %}).
10
- * Auto Context Switching: Map dev to a specific kubectl context and prod to another kubectl context and Kubes can switch them automatically so you won't have to remember. More details in [Auto Context Docs]({% link _docs/misc/auto-context.md %}).
11
- * Ordering: Kubes run kubectl apply to create resources in the [correct order]({% link _docs/intro/ordering.md %}). For deleting, it kubes will run `kubectl delete` in the correct reverse order. The order is also [customizable]({% link _docs/intro/ordering/custom.md %}).
1
+ * **Automation**: [Builds the Docker image]({% link _docs/config/docker.md %}) and updates the compiled YAML files
2
+ * **Syntactic Sugar**: Use an [ERB/YAML]({% link _docs/yaml.md %}) or a [DSL]({% link _docs/dsl.md %}) to write your Kubernetes YAML files. You can use a mix of DSL and YAML definitions in the `.kubes/resources` folder.
3
+ * **Layering**: Use the same Kubernetes YAML to build multiple environments like dev and prod with [layering]({% link _docs/layering.md %}).
4
+ * **Secrets**: Use helpers like [aws_secret]({% link _docs/helpers/aws/secrets.md %}), [aws_ssm]({% link _docs/helpers/aws/ssm.md %}), and [google_secret]({% link _docs/helpers/google/secrets.md %}) to build Kubernetes secrets.yaml from secret providers designed for it.
5
+ * **Generators**: Kubes ships with a few generators to help you get building with Kubernetes quickly. See: [Generator Docs]({% link _docs/generators.md %}).
6
+ * **CLI Customizations**: You can customize the [cli args]({% link _docs/config/args/kubectl.md %}).
7
+ * **Hooks**: You can also run [hooks]({% link _docs/config/hooks.md %}) before and after [kubes]({% link _docs/config/hooks/kubes.md %}) and [kubectl]({% link _docs/config/hooks/kubectl.md %}) commands.
8
+ * **Automated Suffix Hashes**: Automatically appends a suffix hash to ConfigMap and Secret resources. More details in [ConfigMap]({% link _docs/dsl/resources/config_map.md %}) and [Secret]({% link _docs/dsl/resources/secret.md %}) docs.
9
+ * **Kustomize Support**: If you're a kustomization user, you can use it with Kubes. More details in [Kustomize Support Docs]({% link _docs/misc/kustomize.md %}).
10
+ * **Auto Context Switching**: Map dev to a specific kubectl context and prod to another kubectl context and Kubes can switch them automatically so you won't have to remember. More details in [Auto Context Docs]({% link _docs/misc/auto-context.md %}).
11
+ * **Ordering**: Kubes run kubectl apply to create resources in the [correct order]({% link _docs/intro/ordering.md %}). For deleting, it kubes will run `kubectl delete` in the correct reverse order. The order is also [customizable]({% link _docs/intro/ordering/custom.md %}).
@@ -2,6 +2,8 @@
2
2
 
3
3
  The `config.rb` is where you can configure Kubes settings.
4
4
 
5
+ .kubes/config.rb
6
+
5
7
  ```ruby
6
8
  Kubes.configure do |config|
7
9
  config.repo = "112233445566.dkr.ecr.us-west-2.amazonaws.com/demo" # may be gcr.io/project-123/demo
@@ -13,7 +15,7 @@ end
13
15
 
14
16
  This is where the `--repo` from `kubes init` got saved. The other options are covered in the [Env Config Docs]({% link _docs/config/env.md %}).
15
17
 
16
- ## Dockerfie
18
+ ## Dockerfile
17
19
 
18
20
  The `Dockerfile` is a simple starter example that just runs nginx
19
21
 
@@ -411,6 +411,7 @@ ul.toc {
411
411
  .learn {
412
412
  img {
413
413
  max-width: 600px;
414
+ max-width: 100%;
414
415
  }
415
416
  .note {
416
417
  font-size: 0.9em;
@@ -10,6 +10,7 @@ module Kubes::Compiler::Shared::Helpers
10
10
  ]
11
11
  if Kubes.app
12
12
  layers += [
13
+ [shared_config_map, "#{Kubes.app}.txt"],
13
14
  [shared_config_map, Kubes.app, "base.txt"],
14
15
  [shared_config_map, Kubes.app, "#{Kubes.env}.txt"],
15
16
  ]
@@ -22,6 +22,7 @@ class Kubes::Compiler::Strategy
22
22
 
23
23
  def content
24
24
  data = filter_skip(@data)
25
+ data.each { |item| item.delete('kubes') }
25
26
  return if data.empty?
26
27
  result = data.size == 1 ? data.first : data
27
28
  yaml_dump(result)
data/lib/kubes/config.rb CHANGED
@@ -96,8 +96,12 @@ module Kubes
96
96
  evaluate_file(".kubes/config.rb")
97
97
  evaluate_file(".kubes/config/env/#{Kubes.env}.rb")
98
98
  if Kubes.app
99
+ # TODO: deprecate
99
100
  evaluate_file(".kubes/config/env/#{Kubes.app}.rb")
100
101
  evaluate_file(".kubes/config/env/#{Kubes.app}/#{Kubes.env}.rb")
102
+ # newer
103
+ evaluate_file(".kubes/config/app/#{Kubes.app}.rb")
104
+ evaluate_file(".kubes/config/app/#{Kubes.app}/#{Kubes.env}.rb")
101
105
  end
102
106
  Kubes::Plugin.plugins.each do |klass|
103
107
  # klass: IE: KubesAws, KubesGoogle
data/lib/kubes/core.rb CHANGED
@@ -3,11 +3,15 @@ module Kubes
3
3
  extend Memoist
4
4
 
5
5
  def app
6
- ENV['KUBES_APP']
6
+ ENV['KUBES_APP'] unless ENV['KUBES_APP'].blank?
7
7
  end
8
8
 
9
9
  def env
10
- ENV['KUBES_ENV'] || "dev"
10
+ ENV['KUBES_ENV'].blank? ? "dev" : ENV['KUBES_ENV']
11
+ end
12
+
13
+ def extra
14
+ ENV['KUBES_EXTRA'] unless ENV['KUBES_EXTRA'].blank?
11
15
  end
12
16
 
13
17
  def root
@@ -36,7 +40,7 @@ module Kubes
36
40
  def check_project!
37
41
  return if File.exist?("#{Kubes.root}/.kubes/config.rb")
38
42
  logger.error "ERROR: It doesnt look like this is a kubes project. Are you sure you are in a kubes project?".color(:red)
39
- ENV['TS_TEST'] ? raise : exit(1)
43
+ ENV['KUBES_TEST'] ? raise : exit(1)
40
44
  end
41
45
 
42
46
  # wrapper to ensure we use the same deeper_merge options everywhere
data/lib/kubes/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kubes
2
- VERSION = "0.8.5"
2
+ VERSION = "0.8.8"
3
3
  end
@@ -1,12 +1,10 @@
1
- apiVersion: networking.k8s.io/v1beta1
1
+ apiVersion: networking.k8s.io/v1
2
2
  kind: Ingress
3
3
  metadata:
4
4
  name: <%= role %>
5
5
  spec:
6
- rules:
7
- - http:
8
- paths:
9
- - path: "/*"
10
- backend:
11
- serviceName: <%= role %>
12
- servicePort: 80
6
+ defaultBackend:
7
+ service:
8
+ name: web
9
+ port:
10
+ number: 80
@@ -1,7 +1,9 @@
1
- apiVersion: networking.gke.io/v1beta2
1
+ # Docs: https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs#setting_up_a_google-managed_certificate
2
+ # https://kubes.guru/docs/dsl/resources/managed_certificate/
3
+ apiVersion: networking.gke.io/v1
2
4
  kind: ManagedCertificate
3
5
  metadata:
4
- name: cert1
6
+ name: managed-cert
5
7
  spec:
6
8
  domains:
7
- - cert1.example.com
9
+ - subdomain1.example.com
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -258,6 +258,7 @@ extra_rdoc_files: []
258
258
  files:
259
259
  - ".dockerignore"
260
260
  - ".gcloudignore"
261
+ - ".github/FUNDING.yml"
261
262
  - ".github/ISSUE_TEMPLATE.md"
262
263
  - ".github/ISSUE_TEMPLATE/bug_report.md"
263
264
  - ".github/ISSUE_TEMPLATE/documentation.md"
@@ -851,7 +852,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
851
852
  - !ruby/object:Gem::Version
852
853
  version: '0'
853
854
  requirements: []
854
- rubygems_version: 3.2.32
855
+ rubygems_version: 3.3.12
855
856
  signing_key:
856
857
  specification_version: 4
857
858
  summary: 'Kubernetes Deployment Tool: build docker image, compile Kubernetes YAML