├── .dockerignore
├── .gcloudignore
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── documentation.md
│ ├── feature_request.md
│ └── question.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .rspec
├── CHANGELOG.md
├── Dockerfile
├── Dockerfile.alpine
├── Gemfile
├── Guardfile
├── LICENSE.txt
├── README.md
├── Rakefile
├── docker
└── install
│ ├── docker.sh
│ ├── gcloud.sh
│ └── kubectl.sh
├── docs
├── .gitignore
├── CNAME
├── Gemfile
├── LICENSE
├── Procfile
├── README.md
├── Rakefile
├── _config.yml
├── _docs
│ ├── ci
│ │ └── cloudbuild.md
│ ├── config.md
│ ├── config
│ │ ├── app-overrides.md
│ │ ├── args.md
│ │ ├── args
│ │ │ ├── docker.md
│ │ │ └── kubectl.md
│ │ ├── boot.md
│ │ ├── builder.md
│ │ ├── docker.md
│ │ ├── env.md
│ │ ├── hooks.md
│ │ ├── hooks
│ │ │ ├── docker.md
│ │ │ ├── generator.md
│ │ │ ├── kubectl.md
│ │ │ ├── kubes.md
│ │ │ └── ruby.md
│ │ ├── kubectl.md
│ │ ├── reference.md
│ │ └── skip.md
│ ├── contributing.md
│ ├── dsl.md
│ ├── dsl
│ │ ├── multiple-resources.md
│ │ ├── resources.md
│ │ └── resources
│ │ │ ├── backend_config.md
│ │ │ ├── config_map.md
│ │ │ ├── daemon_set.md
│ │ │ ├── deployment.md
│ │ │ ├── generic.md
│ │ │ ├── ingress.md
│ │ │ ├── job.md
│ │ │ ├── managed_certificate.md
│ │ │ ├── namespace.md
│ │ │ ├── network_policy.md
│ │ │ ├── pod.md
│ │ │ ├── role.md
│ │ │ ├── role_binding.md
│ │ │ ├── secret.md
│ │ │ ├── service.md
│ │ │ └── service_account.md
│ ├── extra-env.md
│ ├── extra-env
│ │ ├── dsl.md
│ │ └── yaml.md
│ ├── generators.md
│ ├── helpers.md
│ ├── helpers
│ │ ├── aws.md
│ │ ├── aws
│ │ │ ├── advanced.md
│ │ │ ├── advanced
│ │ │ │ ├── secrets.md
│ │ │ │ └── ssm.md
│ │ │ ├── iam-role.md
│ │ │ ├── secret_data.md
│ │ │ ├── secrets.md
│ │ │ └── ssm.md
│ │ ├── builtin.md
│ │ ├── builtin
│ │ │ └── config-map-files.md
│ │ ├── custom.md
│ │ ├── google.md
│ │ └── google
│ │ │ ├── advanced.md
│ │ │ ├── advanced
│ │ │ └── secrets.md
│ │ │ ├── gke.md
│ │ │ ├── secret_data.md
│ │ │ ├── secrets.md
│ │ │ └── service-account.md
│ ├── install.md
│ ├── install
│ │ ├── dependencies.md
│ │ ├── gem.md
│ │ ├── gem
│ │ │ └── custom-version.md
│ │ ├── standalone.md
│ │ └── standalone
│ │ │ ├── centos.md
│ │ │ ├── details.md
│ │ │ ├── details
│ │ │ ├── permissions.md
│ │ │ └── uninstall.md
│ │ │ ├── macosx.md
│ │ │ └── ubuntu.md
│ ├── intro.md
│ ├── intro
│ │ ├── concepts.md
│ │ ├── docker-image.md
│ │ ├── how-kubes-works.md
│ │ ├── ordering.md
│ │ ├── ordering
│ │ │ └── custom.md
│ │ └── structure.md
│ ├── layering.md
│ ├── layering
│ │ ├── debug.md
│ │ ├── dsl.md
│ │ ├── extra.md
│ │ ├── merge-dsl.md
│ │ ├── merge-options.md
│ │ ├── mix.md
│ │ └── yaml.md
│ ├── learn
│ │ ├── dsl.md
│ │ ├── dsl
│ │ │ ├── change.md
│ │ │ ├── cluster.md
│ │ │ ├── delete.md
│ │ │ ├── deploy.md
│ │ │ ├── install.md
│ │ │ ├── new-project.md
│ │ │ ├── next-steps.md
│ │ │ ├── review-project.md
│ │ │ └── update.md
│ │ ├── yaml.md
│ │ └── yaml
│ │ │ ├── change.md
│ │ │ ├── cluster.md
│ │ │ ├── delete.md
│ │ │ ├── deploy.md
│ │ │ ├── install.md
│ │ │ ├── new-project.md
│ │ │ ├── next-steps.md
│ │ │ ├── review-project.md
│ │ │ └── update.md
│ ├── misc
│ │ ├── auto-context.md
│ │ ├── kustomize.md
│ │ └── separate-steps.md
│ ├── next-steps.md
│ ├── patterns.md
│ ├── patterns
│ │ ├── central-deployer.md
│ │ ├── clock-web-worker.md
│ │ ├── migrations.md
│ │ ├── multiple-envs.md
│ │ └── secrets.md
│ ├── plugins.md
│ ├── plugins
│ │ ├── aws.md
│ │ └── google.md
│ ├── resources.md
│ ├── resources
│ │ ├── base.md
│ │ ├── role.md
│ │ └── shared.md
│ ├── variables.md
│ ├── variables
│ │ ├── advanced.md
│ │ └── basic.md
│ ├── vs.md
│ ├── vs
│ │ ├── custom.md
│ │ ├── helm.md
│ │ └── kustomize.md
│ ├── yaml.md
│ └── yaml
│ │ ├── erb-comment.md
│ │ ├── multiple-files.md
│ │ └── multiple-resources.md
├── _includes
│ ├── banner
│ │ ├── foot.html
│ │ └── head.html
│ ├── commands.html
│ ├── config
│ │ ├── app-overrides-cheatsheet.md
│ │ └── hooks
│ │ │ ├── generator.md
│ │ │ └── options.md
│ ├── content.html
│ ├── dsl
│ │ ├── methods.md
│ │ ├── rolling_deployment.md
│ │ └── suffix_hash.md
│ ├── example.html
│ ├── footer.html
│ ├── google_analytics.html
│ ├── header.html
│ ├── helpers
│ │ ├── base64.md
│ │ └── generator.md
│ ├── install
│ │ ├── gem.md
│ │ └── wrapper.md
│ ├── intro
│ │ └── features.md
│ ├── js.html
│ ├── kubes-steps.md
│ ├── layering
│ │ └── layers.md
│ ├── learn
│ │ ├── cluster.md
│ │ ├── next-steps.md
│ │ ├── repo
│ │ ├── repos.md
│ │ ├── review.md
│ │ └── start.md
│ ├── plugins
│ │ └── gke-config.md
│ ├── reference.md
│ ├── sidebar.html
│ ├── variables
│ │ └── generator.md
│ ├── videos
│ │ ├── learn.md
│ │ ├── learn
│ │ │ └── vs.md
│ │ └── youtube.md
│ └── vs
│ │ ├── article.md
│ │ └── kubes
│ │ ├── layering.md
│ │ └── structure.md
├── _layouts
│ └── default.html
├── _reference
│ ├── kubes-apply.md
│ ├── kubes-clean.md
│ ├── kubes-compile.md
│ ├── kubes-completion.md
│ ├── kubes-completion_script.md
│ ├── kubes-delete.md
│ ├── kubes-deploy.md
│ ├── kubes-describe.md
│ ├── kubes-docker-build.md
│ ├── kubes-docker-help.md
│ ├── kubes-docker-push.md
│ ├── kubes-docker.md
│ ├── kubes-exec.md
│ ├── kubes-get.md
│ ├── kubes-init.md
│ ├── kubes-logs.md
│ ├── kubes-new-help.md
│ ├── kubes-new-helper.md
│ ├── kubes-new-hook.md
│ ├── kubes-new-resource.md
│ ├── kubes-new-variable.md
│ ├── kubes-new.md
│ ├── kubes-prune.md
│ └── kubes-version.md
├── _sass
│ ├── bootstrap-overrides.scss
│ ├── buttons.scss
│ ├── caret.scss
│ ├── content.scss
│ ├── cta.scss
│ ├── default.scss
│ ├── footer.scss
│ ├── masthead.scss
│ ├── mixins.scss
│ ├── sidebar.scss
│ ├── syntax.scss
│ ├── table.scss
│ ├── theme.scss
│ └── variables.scss
├── bin
│ ├── build
│ ├── rerun
│ └── web
├── css
│ └── main.scss
├── docs.md
├── getting-started.md
├── img
│ └── logos
│ │ ├── boltops-logo-full.png
│ │ ├── boltops-logo.png
│ │ ├── filler-logo.png
│ │ ├── kubes-black.png
│ │ ├── kubes-sign.png
│ │ └── kubes-white.png
├── index.html
├── js
│ ├── app.js
│ └── scripts.js
├── opal
│ ├── app.rb
│ ├── pager.rb
│ ├── sidebar.rb
│ └── sidebar
│ │ └── expander.rb
├── reference.md
├── search
│ ├── data.json
│ ├── index.html
│ ├── lunr.js
│ ├── search.js
│ └── tips.md
├── support.md
└── vendor
│ ├── bootstrap
│ ├── css
│ │ ├── bootstrap-grid.css
│ │ ├── bootstrap-grid.css.map
│ │ ├── bootstrap-grid.min.css
│ │ ├── bootstrap-grid.min.css.map
│ │ ├── bootstrap-reboot.css
│ │ ├── bootstrap-reboot.css.map
│ │ ├── bootstrap-reboot.min.css
│ │ ├── bootstrap-reboot.min.css.map
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ └── js
│ │ ├── bootstrap.bundle.js
│ │ ├── bootstrap.bundle.js.map
│ │ ├── bootstrap.bundle.min.js
│ │ ├── bootstrap.bundle.min.js.map
│ │ ├── bootstrap.js
│ │ ├── bootstrap.js.map
│ │ ├── bootstrap.min.js
│ │ └── bootstrap.min.js.map
│ ├── font-awesome
│ ├── css
│ │ ├── font-awesome.css
│ │ └── font-awesome.min.css
│ ├── fonts
│ │ ├── FontAwesome.otf
│ │ ├── fontawesome-webfont.eot
│ │ ├── fontawesome-webfont.svg
│ │ ├── fontawesome-webfont.ttf
│ │ ├── fontawesome-webfont.woff
│ │ └── fontawesome-webfont.woff2
│ ├── less
│ │ ├── animated.less
│ │ ├── bordered-pulled.less
│ │ ├── core.less
│ │ ├── fixed-width.less
│ │ ├── font-awesome.less
│ │ ├── icons.less
│ │ ├── larger.less
│ │ ├── list.less
│ │ ├── mixins.less
│ │ ├── path.less
│ │ ├── rotated-flipped.less
│ │ ├── screen-reader.less
│ │ ├── stacked.less
│ │ └── variables.less
│ └── scss
│ │ ├── _animated.scss
│ │ ├── _bordered-pulled.scss
│ │ ├── _core.scss
│ │ ├── _fixed-width.scss
│ │ ├── _icons.scss
│ │ ├── _larger.scss
│ │ ├── _list.scss
│ │ ├── _mixins.scss
│ │ ├── _path.scss
│ │ ├── _rotated-flipped.scss
│ │ ├── _screen-reader.scss
│ │ ├── _stacked.scss
│ │ ├── _variables.scss
│ │ └── font-awesome.scss
│ ├── jquery
│ ├── jquery.js
│ ├── jquery.min.js
│ ├── jquery.min.map
│ ├── jquery.slim.js
│ ├── jquery.slim.min.js
│ └── jquery.slim.min.map
│ └── simple-line-icons
│ ├── css
│ └── simple-line-icons.css
│ ├── fonts
│ ├── Simple-Line-Icons.eot
│ ├── Simple-Line-Icons.svg
│ ├── Simple-Line-Icons.ttf
│ ├── Simple-Line-Icons.woff
│ └── Simple-Line-Icons.woff2
│ ├── less
│ └── simple-line-icons.less
│ └── scss
│ └── simple-line-icons.scss
├── exe
└── kubes
├── kubes.gemspec
├── lib
├── kubes.rb
├── kubes
│ ├── args
│ │ ├── custom.rb
│ │ └── dsl.rb
│ ├── auth.rb
│ ├── auth
│ │ ├── base.rb
│ │ ├── ecr.rb
│ │ └── gcr.rb
│ ├── autoloader.rb
│ ├── aws_services.rb
│ ├── booter.rb
│ ├── cli.rb
│ ├── cli
│ │ ├── apply.rb
│ │ ├── base.rb
│ │ ├── build.rb
│ │ ├── clean.rb
│ │ ├── compile.rb
│ │ ├── delete.rb
│ │ ├── deploy.rb
│ │ ├── describe.rb
│ │ ├── docker.rb
│ │ ├── exec.rb
│ │ ├── get.rb
│ │ ├── help.rb
│ │ ├── help
│ │ │ ├── completion.md
│ │ │ ├── completion_script.md
│ │ │ ├── deploy.md
│ │ │ ├── exec.md
│ │ │ └── new
│ │ │ │ ├── helper.md
│ │ │ │ ├── hook.md
│ │ │ │ ├── resource.md
│ │ │ │ └── variable.md
│ │ ├── init.rb
│ │ ├── logs.rb
│ │ ├── new.rb
│ │ ├── new
│ │ │ ├── helper.rb
│ │ │ ├── hook.rb
│ │ │ ├── resource.rb
│ │ │ └── variable.rb
│ │ ├── prune.rb
│ │ └── sequence.rb
│ ├── command.rb
│ ├── compiler.rb
│ ├── compiler
│ │ ├── decorator
│ │ │ ├── base.rb
│ │ │ ├── hashable.rb
│ │ │ ├── hashable
│ │ │ │ ├── field.rb
│ │ │ │ └── storage.rb
│ │ │ ├── post.rb
│ │ │ └── pre.rb
│ │ ├── dsl
│ │ │ ├── core
│ │ │ │ ├── base.rb
│ │ │ │ ├── blocks.rb
│ │ │ │ ├── fields.rb
│ │ │ │ ├── files.rb
│ │ │ │ ├── helpers.rb
│ │ │ │ └── parser.rb
│ │ │ └── syntax
│ │ │ │ ├── backend_config.rb
│ │ │ │ ├── cluster_role.rb
│ │ │ │ ├── cluster_role_binding.rb
│ │ │ │ ├── config_map.rb
│ │ │ │ ├── daemon_set.rb
│ │ │ │ ├── deployment.rb
│ │ │ │ ├── endpoint.rb
│ │ │ │ ├── ingress.rb
│ │ │ │ ├── job.rb
│ │ │ │ ├── managed_certificate.rb
│ │ │ │ ├── namespace.rb
│ │ │ │ ├── network_policy.rb
│ │ │ │ ├── pod.rb
│ │ │ │ ├── resource.rb
│ │ │ │ ├── role.rb
│ │ │ │ ├── role_binding.rb
│ │ │ │ ├── secret.rb
│ │ │ │ ├── service.rb
│ │ │ │ └── service_account.rb
│ │ ├── layering.rb
│ │ ├── shared
│ │ │ ├── helpers.rb
│ │ │ ├── helpers
│ │ │ │ ├── config_map_helper.rb
│ │ │ │ ├── deprecated.rb
│ │ │ │ ├── docker_helper.rb
│ │ │ │ ├── extra_helper.rb
│ │ │ │ └── secret_helper.rb
│ │ │ └── runtime_helpers.rb
│ │ ├── strategy.rb
│ │ ├── strategy
│ │ │ ├── base.rb
│ │ │ ├── dispatcher.rb
│ │ │ ├── erb.rb
│ │ │ ├── erb
│ │ │ │ ├── comment.rb
│ │ │ │ └── yaml_error.rb
│ │ │ ├── pass.rb
│ │ │ └── result.rb
│ │ └── util
│ │ │ ├── normalize.rb
│ │ │ ├── save_file.rb
│ │ │ └── yaml_dump.rb
│ ├── completer.rb
│ ├── completer
│ │ ├── script.rb
│ │ └── script.sh
│ ├── config.rb
│ ├── core.rb
│ ├── docker.rb
│ ├── docker
│ │ ├── args
│ │ │ └── default.rb
│ │ └── strategy
│ │ │ ├── build
│ │ │ ├── base.rb
│ │ │ ├── docker.rb
│ │ │ └── gcloud.rb
│ │ │ ├── image_name.rb
│ │ │ ├── push
│ │ │ ├── base.rb
│ │ │ ├── docker.rb
│ │ │ └── gcloud.rb
│ │ │ └── utils.rb
│ ├── hooks
│ │ ├── builder.rb
│ │ ├── concern.rb
│ │ ├── dsl.rb
│ │ └── runner.rb
│ ├── kubectl.rb
│ ├── kubectl
│ │ ├── args
│ │ │ ├── base.rb
│ │ │ ├── kustomize.rb
│ │ │ └── standard.rb
│ │ ├── batch.rb
│ │ ├── dispatcher.rb
│ │ ├── fetch
│ │ │ ├── base.rb
│ │ │ ├── deployment.rb
│ │ │ └── pods.rb
│ │ ├── kustomize.rb
│ │ └── ordering.rb
│ ├── logger.rb
│ ├── logging.rb
│ ├── plugin.rb
│ ├── util
│ │ ├── consider.rb
│ │ ├── pretty.rb
│ │ ├── sh.rb
│ │ ├── sure.rb
│ │ └── time.rb
│ └── version.rb
└── templates
│ ├── base
│ └── .kubes
│ │ ├── config.rb.tt
│ │ └── config
│ │ └── env
│ │ ├── dev.rb
│ │ └── prod.rb
│ ├── docker
│ └── Dockerfile
│ ├── dsl
│ └── .kubes
│ │ └── resources
│ │ ├── base
│ │ └── all.rb.tt
│ │ ├── shared
│ │ └── namespace.rb.tt
│ │ └── web
│ │ ├── deployment.rb
│ │ ├── deployment
│ │ ├── dev.rb
│ │ └── prod.rb
│ │ └── service.rb
│ ├── new
│ ├── helper
│ │ └── file.rb
│ ├── hooks
│ │ ├── docker.rb
│ │ ├── kubectl.rb
│ │ └── kubes.rb
│ ├── resource
│ │ ├── dsl
│ │ │ ├── backend_config.rb
│ │ │ ├── config_map.rb
│ │ │ ├── daemon_set.rb
│ │ │ ├── deployment.rb
│ │ │ ├── endpoint.rb
│ │ │ ├── ingress.rb
│ │ │ ├── job.rb
│ │ │ ├── managed_certificate.rb
│ │ │ ├── namespace.rb
│ │ │ ├── network_policy.rb
│ │ │ ├── pod.rb
│ │ │ ├── role.rb
│ │ │ ├── role_binding.rb
│ │ │ ├── secret.rb
│ │ │ ├── service.rb
│ │ │ └── service_account.rb
│ │ └── yaml
│ │ │ ├── backend_config.yaml
│ │ │ ├── config_map.yaml
│ │ │ ├── daemon_set.yaml
│ │ │ ├── deployment.yaml
│ │ │ ├── endpoint.yaml
│ │ │ ├── ingress.yaml
│ │ │ ├── job.yaml
│ │ │ ├── managed_certificate.yaml
│ │ │ ├── namespace.yaml
│ │ │ ├── network_policy.yaml
│ │ │ ├── pod.yaml
│ │ │ ├── role.yaml
│ │ │ ├── role_binding.yaml
│ │ │ ├── secret.yaml
│ │ │ ├── service.yaml
│ │ │ └── service_account.yaml
│ └── variable
│ │ └── file.rb
│ └── yaml
│ └── .kubes
│ └── resources
│ ├── base
│ ├── all.yaml.tt
│ └── deployment.yaml.tt
│ ├── shared
│ └── namespace.yaml.tt
│ └── web
│ ├── deployment.yaml.tt
│ ├── deployment
│ ├── dev.yaml
│ └── prod.yaml
│ └── service.yaml.tt
└── spec
├── cli_spec.rb
├── fixtures
├── artifacts
│ └── demo-web
│ │ ├── deployment.yaml
│ │ └── service.yaml
├── blocks
│ └── deployments.rb
├── decorators
│ ├── deployment
│ │ ├── both
│ │ │ ├── envFrom.yaml
│ │ │ ├── valueFrom.yaml
│ │ │ └── volumes.yaml
│ │ ├── configMap
│ │ │ ├── envFrom.yaml
│ │ │ ├── valueFrom.yaml
│ │ │ ├── volumes-name-first.yaml
│ │ │ ├── volumes-name-second.yaml
│ │ │ └── volumes.yaml
│ │ └── secret
│ │ │ ├── envFrom.yaml
│ │ │ ├── valueFrom.yaml
│ │ │ └── volumes.yaml
│ ├── ingress
│ │ └── tls.yaml
│ └── pod
│ │ ├── configMap
│ │ ├── envFrom.yaml
│ │ ├── valueFrom.yaml
│ │ └── volumes.yaml
│ │ └── secret
│ │ ├── envFrom.yaml
│ │ ├── valueFrom.yaml
│ │ └── volumes.yaml
├── deployments
│ ├── minimum.rb
│ ├── props.rb
│ └── setter
│ │ ├── container.rb
│ │ ├── containers.rb
│ │ ├── metadata.rb
│ │ ├── sidecar.rb
│ │ └── spec.rb
├── multiple-files
│ └── .kubes
│ │ └── resources
│ │ └── web
│ │ ├── deployment-1.rb
│ │ └── deployment-2.rb
├── project
│ ├── .gitignore
│ └── .kubes
│ │ └── resources
│ │ └── web
│ │ ├── deployment.rb
│ │ ├── empty.rb
│ │ └── service.rb
├── prune
│ ├── capture.yaml
│ └── fetch_items.yaml
├── services
│ └── minimum.rb
└── syntax
│ └── .kubes
│ └── resources
│ └── web
│ ├── network_policy.rb
│ └── pod.rb
├── kubes
├── cli
│ └── prune_spec.rb
├── compiler
│ ├── decorator
│ │ └── post
│ │ │ ├── deployment_spec.rb
│ │ │ ├── ingress_spec.rb
│ │ │ └── pod_spec.rb
│ └── strategy
│ │ └── dispatcher_spec.rb
├── compiler_spec.rb
├── dsl
│ ├── daemon_set.rb
│ ├── deployment_spec.rb
│ ├── network_policy_spec.rb
│ ├── pod_spec.rb
│ └── service_spec.rb
└── kubectl
│ └── batch_spec.rb
└── spec_helper.rb
/.dockerignore:
--------------------------------------------------------------------------------
1 | .git
2 | pkg
3 | docs
4 | spec
--------------------------------------------------------------------------------
/.gcloudignore:
--------------------------------------------------------------------------------
1 | *.gem
2 | *.rbc
3 | /.bundle
4 | /.config
5 | /.yardoc
6 | /_yardoc
7 | /coverage
8 | /doc/
9 | /Gemfile.lock
10 | /InstalledFiles
11 | /lib/bundler/man
12 | /pkg
13 | /rdoc
14 | /spec/reports
15 | /test/tmp
16 | /test/version_tmp
17 | /tmp
18 |
19 | .git
20 | pkg
21 | docs
22 | spec
23 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: boltops-tools
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
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!
8 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
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!
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
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/ 😁
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.gem
2 | *.rbc
3 | /.bundle
4 | /.config
5 | /.yardoc
6 | /_yardoc
7 | /coverage
8 | /doc/
9 | /Gemfile.lock
10 | /InstalledFiles
11 | /lib/bundler/man
12 | /pkg
13 | /rdoc
14 | /spec/reports
15 | /test/tmp
16 | /test/version_tmp
17 | /tmp
18 |
--------------------------------------------------------------------------------
/.rspec:
--------------------------------------------------------------------------------
1 | --require spec_helper
2 | --color
3 | --format documentation
4 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ruby:2.7
2 |
3 | COPY docker docker
4 | RUN docker/install/docker.sh
5 | RUN docker/install/gcloud.sh
6 | ENV PATH=/opt/google/google-cloud-sdk/bin/:$PATH
7 | RUN docker/install/kubectl.sh
8 |
9 | WORKDIR /app
10 | ADD . /app
11 | RUN bundle install
12 | RUN rake install
13 |
14 | ENTRYPOINT ["/usr/local/bundle/bin/kubes"]
15 |
--------------------------------------------------------------------------------
/Dockerfile.alpine:
--------------------------------------------------------------------------------
1 | FROM ruby:2.7-alpine
2 |
3 | # This Dockerfile is much lighter but won't work with gke whitelisting. Getting this error when the google gke sdk is called:
4 | #
5 | # Error loading shared library ld-linux-x86-64.so.2: No such file or directory #986
6 | #
7 | # If you don't need gke whitelisting, then this image should work and is lighter.
8 |
9 | RUN apk add --no-cache docker
10 | RUN apk add --no-cache build-base ruby ruby-dev
11 |
12 | RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl
13 | RUN chmod u+x kubectl && mv kubectl /bin/kubectl
14 |
15 | WORKDIR /app
16 | ADD . /app
17 | RUN bundle install
18 | RUN rake install
19 |
20 | ENTRYPOINT ["/usr/local/bundle/bin/kubes"]
21 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | # Specify your gem dependencies in kubes.gemspec
4 | gemspec
5 |
6 | gem "codeclimate-test-reporter", group: :test, require: nil
7 |
--------------------------------------------------------------------------------
/Guardfile:
--------------------------------------------------------------------------------
1 | guard "bundler", cmd: "bundle" do
2 | watch("Gemfile")
3 | watch(/^.+\.gemspec/)
4 | end
5 |
6 | guard :rspec, cmd: "bundle exec rspec" do
7 | require "guard/rspec/dsl"
8 | dsl = Guard::RSpec::Dsl.new(self)
9 |
10 | # RSpec files
11 | rspec = dsl.rspec
12 | watch(rspec.spec_helper) { rspec.spec_dir }
13 | watch(rspec.spec_support) { rspec.spec_dir }
14 | watch(rspec.spec_files)
15 |
16 | # Ruby files
17 | ruby = dsl.ruby
18 | dsl.watch_spec_files_for(ruby.lib_files)
19 | end
20 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require "bundler/gem_tasks"
2 | require "rspec/core/rake_task"
3 |
4 | task default: :spec
5 |
6 | RSpec::Core::RakeTask.new
7 |
8 | require_relative "lib/kubes"
9 | require "cli_markdown"
10 | desc "Generates cli reference docs as markdown"
11 | task :docs do
12 | mkdir_p "docs/_includes"
13 | CliMarkdown::Creator.create_all(cli_class: Kubes::CLI, cli_name: "kubes")
14 | end
15 |
--------------------------------------------------------------------------------
/docker/install/docker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | apt-get update
4 | apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
5 | curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
6 | add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
7 | apt-get update
8 | apt-get install docker-ce docker-ce-cli containerd.io -y
9 |
--------------------------------------------------------------------------------
/docker/install/gcloud.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -eu
2 |
3 | [ -e /opt/google ] && exit
4 |
5 | mkdir -p /opt/google
6 |
7 | cd /opt/google
8 | wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-318.0.0-linux-x86_64.tar.gz
9 | tar zxf google-cloud-sdk*.tar.gz
10 | rm -f google-cloud-sdk*.tar.gz
11 |
12 | /opt/google/google-cloud-sdk/install.sh -q
13 |
14 | cat << FOE >> ~/.bash_profile
15 |
16 | source /opt/google/google-cloud-sdk/completion.bash.inc
17 | source /opt/google/google-cloud-sdk/path.bash.inc
18 | FOE
19 |
--------------------------------------------------------------------------------
/docker/install/kubectl.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wget https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl
4 | chmod u+x kubectl && mv kubectl /bin/kubectl
5 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | _site
2 | .sass-cache
3 | .jekyll-metadata
4 | .jekyll-cache
5 | Gemfile.lock
6 | _config-dev.yml
7 |
--------------------------------------------------------------------------------
/docs/CNAME:
--------------------------------------------------------------------------------
1 | kubes.guru
--------------------------------------------------------------------------------
/docs/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem "html-proofer"
4 | gem "jekyll"
5 | gem "jekyll-include-cache"
6 | gem "opal"
7 | gem "opal-browser"
8 | gem "opal-jquery"
9 | gem "rake"
10 | gem "rerun"
11 | gem "webrick"
12 |
13 | # GitHub pages does not support this plugin.
14 | # GitHub pages will not serve zipped assets even if we precompress them before hand.
15 | # Leaving comment as a note:
16 | # group :jekyll_plugins do
17 | # gem 'jekyll-gzip'
18 | # end
--------------------------------------------------------------------------------
/docs/Procfile:
--------------------------------------------------------------------------------
1 | web: bin/web
2 | opal: bin/rerun
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # kubes Documentation
2 |
3 | This project powers the kubes documementation website: [https://kubes.guru](https://kubes.guru). It is a static website generated by [Jekyll](https://jekyllrb.com/).
4 |
5 | ## Contributing
6 |
7 | For minor changes like typos, you can click **Suggest an edit to this page**, located at the bottom of each article. This will take you to the source file on GitHub, where you can submit a pull request for your change through the UI.
8 |
9 | ## Local Setup
10 |
11 | For larger fixes, you can run the site locally with the following:
12 |
13 | git clone https://github.com/boltops-tools/kubes
14 | cd kubes/docs
15 | bundle
16 | foreman start
17 |
18 | You'll be able to view the site on [http://localhost:4000](http://localhost:4000).
19 |
20 | ## Html Proofer
21 |
22 | Run it locally once in a while. Sometimes external sites are intermittently down, even GitHub.
23 |
24 | bundle exec rake html:proof
25 |
--------------------------------------------------------------------------------
/docs/Rakefile:
--------------------------------------------------------------------------------
1 | # server-side require
2 | require 'opal'
3 | require 'opal-jquery'
4 | require 'opal-browser'
5 |
6 |
7 | # Note the jekyll-opal plugin loads a minimum baseline of opal that doesnt including extra side-side requires
8 | # So we'll compile our own version instead.
9 |
10 | namespace :opal do
11 | desc "Build our app to app.js"
12 | task :build do
13 | puts "build opal files"
14 | Opal.append_path "./opal"
15 | compiled = Opal::Builder.build("app").to_s
16 | IO.write("js/app.js", compiled)
17 | end
18 | end
19 |
20 | require 'html-proofer'
21 |
22 | namespace :html do
23 | desc "proof read the html links"
24 | task :proof do
25 | system "bundle exec jekyll build"
26 | HTMLProofer.check_directory(
27 | "./_site",
28 | # hacks to get html proof to pass links we wanted ignored
29 | check_html: true,
30 | # check_favicon: true,
31 | only_4xx: true,
32 | allow_hash_href: true,
33 | empty_alt_ignore: true,
34 | ).run
35 | end
36 | end
37 |
38 | task :default => ["opal:build", "html:proof"]
39 |
--------------------------------------------------------------------------------
/docs/_docs/config.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Config
3 | ---
4 |
5 | You can customize the behavior of Kubes with configs. There are different types of configs:
6 |
7 | * [Docker]({% link _docs/config/docker.md %}): Used to customize the docker command.
8 | * [Env]({% link _docs/config/env.md %}): Used to override `config.rb` settings on a `KUBES_ENV` basis.
9 | * [Kubectl]({% link _docs/config/env.md %}): Used to customize the kubectl command.
10 |
--------------------------------------------------------------------------------
/docs/_docs/config/app-overrides.md:
--------------------------------------------------------------------------------
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 %}
8 |
--------------------------------------------------------------------------------
/docs/_docs/config/args.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Args
3 | ---
4 |
5 | Kubes supports customizing the args passed to the `docker` and `kubectl` commands:
6 |
7 | {% assign docs = site.docs | where: "categories","args" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.title }}]({{ doc.url }})
10 | {% endfor %}
11 |
--------------------------------------------------------------------------------
/docs/_docs/config/args/docker.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Docker Args
3 | nav_text: Docker
4 | categories: args
5 | ---
6 |
7 | Here are some examples of customizing the docker args.
8 |
9 | .kubes/config/args/docker.rb
10 |
11 | ```ruby
12 | command("build",
13 | args: ["--quiet"],
14 | )
15 |
16 | command("push",
17 | args: ["--disable-content-trust"],
18 | )
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/_docs/config/args/kubectl.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Kubectl Args
3 | nav_text: Kubectl
4 | categories: args
5 | ---
6 |
7 | Here are some examples of customizing the kubectl args.
8 |
9 | .kubes/config/kubectl/args.rb
10 |
11 | ```ruby
12 | command("apply",
13 | args: ["--validate=true"],
14 | )
15 |
16 | command("delete",
17 | args: ["--grace-period=-1"],
18 | )
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/_docs/config/docker.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Docker Config
3 | ---
4 |
5 | ## General
6 |
7 | Kubes builds docker images by calling the docker build commands. Example:
8 |
9 | kubes docker build
10 |
11 | To push:
12 |
13 | kubes docker push
14 |
15 | ## Deploy
16 |
17 | While building the docker image as a separate step can be useful, you can just use the deploy command, and kubes will automatically build the Docker image for you. Example:
18 |
19 | kubes deploy web
20 |
21 | If you want to skip the `docker build` phase of the deploy, you can run:
22 |
23 | kubes deploy web --no-build
24 |
25 | Also, kubes apply another way to skip the docker build:
26 |
27 | kubes apply web
28 |
29 | ## Customizing Args and Hooks
30 |
31 | See:
32 |
33 | * [Docker Args Docs]({% link _docs/config/args/docker.md %})
34 | * [Docker Hooks Docs]({% link _docs/config/hooks/docker.md %})
35 |
--------------------------------------------------------------------------------
/docs/_docs/config/hooks.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hooks
3 | ---
4 |
5 | Kubes supports a variety of hooks. They can be used to customize and finely control the kubes deploy process.
6 |
7 | {% assign docs = site.docs | where: "categories","hooks" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.title }}]({{ doc.url }})
10 | {% endfor %}
11 |
--------------------------------------------------------------------------------
/docs/_docs/config/hooks/generator.md:
--------------------------------------------------------------------------------
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 | $
--------------------------------------------------------------------------------
/docs/_docs/config/kubectl.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Kubectl Customizations
3 | ---
4 |
5 | ## General
6 |
7 | Kubes calls out the `kubectl` command. You can customize the command.
8 |
9 | * [Args]({% link _docs/config/args/kubectl.md %}): Customize the CLI args.
10 | * [Hooks]({% link _docs/config/hooks/kubectl.md %}): Run hooks before and after the kubectl commands.
11 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Resources
3 | ---
4 |
5 | Here's a list of the resources supported by the Kubes DSL.
6 |
7 | {% assign docs = site.docs | where: "categories","dsl" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.title }}]({{ doc.url }})
10 | {% endfor %}
11 |
12 | For resources, that are not supported, you can use the [Generic resource]({% link _docs/dsl/resources/generic.md %}) or use [YAML]({% link _docs/yaml.md %}) instead. You can use a mix of DSL and YAML definitions in the `.kubes/resources` folder.
13 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/backend_config.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: BackendConfig
3 | categories: dsl
4 | ---
5 |
6 | A [BackendConfig](https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#create_backendconfig) is [custom resource definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) that allow you to further customize the load balancer.
7 |
8 | Here's an example of a BackendConfig.
9 |
10 | .kubes/resources/web/backend-config.rb
11 |
12 | ```ruby
13 | name "backendconfig"
14 | spec(
15 | timeoutSec: 40,
16 | connectionDraining: {
17 | drainingTimeoutSec: 60,
18 | },
19 | sessionAffinity: {
20 | affinityType: "CLIENT_IP",
21 | }
22 | )
23 | ```
24 |
25 | Produces:
26 |
27 | .kubes/output/web/backend-config.yaml
28 |
29 | ```yaml
30 | ---
31 | apiVersion: cloud.google.com/v1
32 | kind: BackendConfig
33 | metadata:
34 | name: my-bsc-backendconfig
35 | spec:
36 | timeoutSec: 40
37 | connectionDraining:
38 | drainingTimeoutSec: 60
39 | sessionAffinity:
40 | affinityType: CLIENT_IP
41 | ```
42 |
43 | ## DSL Methods
44 |
45 | {% include dsl/methods.md name="backend_config" %}
46 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/daemon_set.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: DaemonSet
3 | categories: dsl
4 | ---
5 |
6 | ## Example
7 |
8 | Here's an example of a DaemonSet.
9 |
10 | .kubes/resources/shared/daemon_set.rb
11 |
12 | ```ruby
13 | name "calico-node"
14 | namespace "kube-system"
15 | labels("k8s-app": "calico-node")
16 | updateStrategy(
17 | type: "RollingUpdate",
18 | rollingUpdate: {
19 | maxUnavailable: 1
20 | }
21 | )
22 | annotations(
23 | "*scheduler**.alpha.kubernetes.io/critical-pod": '*'
24 | )
25 | ```
26 |
27 | Produces:
28 |
29 | .kubes/output/shared/daemon_set.yaml
30 |
31 | ```yaml
32 | apiVersion: apps/v1
33 | kind: DaemonSet
34 | metadata:
35 | annotations:
36 | "*scheduler**.alpha.kubernetes.io/critical-pod": "*"
37 | name: calico-node
38 | labels:
39 | k8s-app: calico-node
40 | namespace: kube-system
41 | spec:
42 | updateStrategy:
43 | type: RollingUpdate
44 | rollingUpdate:
45 | maxUnavailable: 1
46 | ```
47 |
48 | ## DSL Methods
49 |
50 | Here's a list of more common methods:
51 |
52 | * minReadySeconds
53 | * revisionHistoryLimit
54 | * selector
55 | * template
56 | * updateStrategy
57 |
58 | {% include dsl/methods.md name="daemon_set" %}
59 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/generic.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Generic
3 | categories: dsl
4 | ---
5 |
6 | The generic DSL allows you to create any Kubernetes resource kind with the Kubes DSL. It is useful for resources with no pretty Kubes DSL wrappers yet. It still has some pretty powerful helper methods.
7 |
8 | ## Example 1
9 |
10 | Here's an example of an example of a make-believe SomeKind resource.
11 |
12 | .kubes/resources/web/some_kind.rb
13 |
14 | ```ruby
15 | name "some-kind"
16 | labels(role: "web")
17 | spec(
18 | spec1: "v1"
19 | )
20 | field(:data,
21 | k1: "v1",
22 | k2: "v2"
23 | )
24 | ```
25 |
26 | Produces:
27 |
28 | .kubes/output/web/some_kind.yaml
29 |
30 | ```yaml
31 | data:
32 | k1: v1
33 | k2: v2
34 | kind: SomeKind
35 | metadata:
36 | name: some-kind
37 | labels:
38 | role: web
39 | spec:
40 | spec1: v1
41 | ```
42 |
43 | ## DSL Methods
44 |
45 | Here's a list of common methods:
46 |
47 | Top-level and special fields:
48 |
49 | * apiVersion
50 | * kind
51 | * metadata
52 | * resource
53 | * spec
54 | * annotations
55 | * labels
56 | * namespace
57 |
58 | {% include dsl/methods.md name="resource" %}
59 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/job.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Job
3 | categories: dsl
4 | ---
5 |
6 | ## Example 1
7 |
8 | Here's an example of an job.
9 |
10 | .kubes/resources/migrate/job.rb
11 |
12 | ```ruby
13 | name "<%= app %>"
14 | image(docker_image)
15 | ```
16 |
17 | Produces:
18 |
19 | .kubes/output/migrate/job.yaml
20 |
21 | ```yaml
22 | ---
23 | apiVersion: batch/v1
24 | kind: Job
25 | metadata:
26 | name: demo
27 | labels:
28 | app: demo
29 | namespace: demo-dev
30 | spec:
31 | template:
32 | metadata:
33 | labels:
34 | app: demo
35 | spec:
36 | containers:
37 | - image: 111111111111.dkr.ecr.us-west-2.amazonaws.com/demo:kubes-2020-10-26T20-25-43
38 | name: demo
39 | ```
40 |
41 | ## DSL Methods
42 |
43 | Here's a list of more common methods:
44 |
45 | job.spec.template.spec.containers fields:
46 |
47 | * args
48 | * command
49 | * env
50 | * envFrom
51 | * image
52 | * imagePullPolicy
53 | * lifecycle
54 | * livenessProbe
55 | * containerName
56 | * ports
57 | * readinessProbe
58 | * volumeDevices
59 | * volumeMounts
60 | * workingDir
61 |
62 | {% include dsl/methods.md name="job" %}
63 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/managed_certificate.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: ManagedCertificate
3 | categories: dsl
4 | ---
5 |
6 | Here's an example of a ManagedCertificate.
7 |
8 | .kubes/resources/web/managed_certificate.rb
9 |
10 | ```ruby
11 | name "cert1"
12 | domains(["cert1.example.com"])
13 | ```
14 |
15 | Produces:
16 |
17 | .kubes/output/web/managed_certificate.yaml
18 |
19 | ```yaml
20 | ---
21 | apiVersion: networking.gke.io/v1beta2
22 | kind: ManagedCertificate
23 | metadata:
24 | name: cert1
25 | spec:
26 | domains:
27 | - cert1.example.com
28 | ```
29 |
30 | ## DSL Methods
31 |
32 | Here's a list of more common methods:
33 |
34 | Top-level and special fields:
35 |
36 | * domain
37 | * domains
38 |
39 | {% include dsl/methods.md name="managed_certificate" %}
40 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Namespace
3 | categories: dsl
4 | ---
5 |
6 | ## Example
7 |
8 | Here's an example of a Namespace.
9 |
10 | .kubes/resources/shared/namespace.rb
11 |
12 | ```ruby
13 | name "demo"
14 | labels(app: "demo") # useful with NetworkPolicy
15 | ```
16 |
17 | Produces:
18 |
19 | .kubes/output/shared/namespace.yaml
20 |
21 | ```yaml
22 | apiVersion: v1
23 | kind: Namespace
24 | metadata:
25 | name: demo
26 | labels:
27 | app: demo
28 | ```
29 |
30 | ## DSL Methods
31 |
32 | Here's the source of the namespace resource.
33 |
34 | {% include dsl/methods.md name="namespace" %}
35 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/role.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Role
3 | categories: dsl
4 | ---
5 |
6 | ## Example
7 |
8 | Here's an example of a Role.
9 |
10 | .kubes/resources/shared/role.rb
11 |
12 | ```ruby
13 | name "demo"
14 | apiGroups([""])
15 | resources(["pods"])
16 | verbs(["get", "watch", "list"])
17 | ```
18 |
19 | Produces:
20 |
21 | .kubes/output/shared/role.yaml
22 |
23 | ```yaml
24 | apiVersion: rbac.authorization.k8s.io/v1
25 | kind: Role
26 | metadata:
27 | name: demo
28 | rules:
29 | - apiGroups:
30 | - ''
31 | resources:
32 | - pods
33 | verbs:
34 | - get
35 | - watch
36 | - list
37 | ```
38 |
39 | ## DSL Methods
40 |
41 | Here's the source of the Role resource.
42 |
43 | {% include dsl/methods.md name="role" %}
44 |
45 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/role_binding.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: RoleBinding
3 | categories: dsl
4 | ---
5 |
6 | ## Example
7 |
8 | Here's an example of a RoleBinding.
9 |
10 | .kubes/resources/shared/role_binding.rb
11 |
12 | ```ruby
13 | name "demo"
14 |
15 | subjects([
16 | {kind: "User", name: "tung@boltops.com"},
17 | ])
18 |
19 | roleName "demo"
20 | ```
21 |
22 | Produces:
23 |
24 | .kubes/output/shared/role_binding.yaml
25 |
26 | ```yaml
27 | apiVersion: rbac.authorization.k8s.io/v1
28 | kind: RoleBinding
29 | metadata:
30 | name: demo
31 | roleRef:
32 | apiGroup: rbac.authorization.k8s.io
33 | kind: Role
34 | name: demo
35 | subjects:
36 | - kind: User
37 | name: tung@boltops.com
38 | ```
39 |
40 | ## DSL Methods
41 |
42 | Here's a list of more common methods:
43 |
44 | Top-level methods:
45 |
46 | * roleRef
47 | * subjects
48 |
49 | roleRef level methods
50 |
51 | * apiGroup
52 | * roleKind
53 | * roleName
54 |
55 | {% include dsl/methods.md name="role_binding" %}
56 |
--------------------------------------------------------------------------------
/docs/_docs/dsl/resources/service_account.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: ServiceAccount
3 | categories: dsl
4 | ---
5 |
6 | ## Example
7 |
8 | Here's an example of a ServiceAccount.
9 |
10 | .kubes/resources/shared/service_account.rb
11 |
12 | ```ruby
13 | name "demo"
14 | ```
15 |
16 | Produces:
17 |
18 | .kubes/output/shared/service_account.yaml
19 |
20 | ```yaml
21 | apiVersion: v1
22 | kind: ServiceAccount
23 | metadata:
24 | name: demo
25 | ```
26 |
27 | ## DSL Methods
28 |
29 | Here's a list of more common methods:
30 |
31 | Top-level methods:
32 |
33 | * automountServiceAccountToken
34 | * imagePullSecrets
35 | * secrets
36 |
37 | {% include dsl/methods.md name="service_account" %}
38 |
--------------------------------------------------------------------------------
/docs/_docs/extra-env.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Extra Environments
3 | ---
4 |
5 | Kubes adds the concept of extra environments. Let say, you have a demo-web app with a deployment and service.
6 |
7 | .kubes/resources
8 | └── web
9 | ├── deployment.rb
10 | └── service.rb
11 |
12 | You can create additional environments using the same resource files with a few minor changes.
13 |
14 | * [DSL Example]({% link _docs/extra-env/dsl.md %})
15 | * [YAML Example]({% link _docs/extra-env/yaml.md %})
16 |
17 | ## Deploy
18 |
19 | Then to create an additional environment, it's simple:
20 |
21 | KUBES_EXTRA=2 kubes deploy
22 | KUBES_EXTRA=3 kubes deploy
23 | # etc
24 |
--------------------------------------------------------------------------------
/docs/_docs/generators.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Generators
3 | ---
4 |
5 | Kubes ships with a few generators to help you get building with Kubernetes quickly. The generated starter YAML should be modified and customized for your needs.
6 |
7 | ## Examples
8 |
9 | Here are a few examples:
10 |
11 | $ kubes new resource ingress
12 | create .kubes/resources/web/ingress.yaml
13 | $ kubes new resource service_account
14 | create .kubes/resources/shared/service_account.yaml
15 | $
16 |
17 | Use `-h` to see the cli options:
18 |
19 | kubes new resource -h
20 |
21 | ## Supported Resources
22 |
23 | Here's a list of some of the supported resources.
24 |
25 | backend_config
26 | config_map
27 | daemon_set
28 | deployment
29 | ingress
30 | job
31 | managed_certificate
32 | namespace
33 | network_policy
34 | pod
35 | role_binding
36 | role
37 | secret
38 | service_account
39 | service
40 |
41 | Refer to the [source code](https://github.com/boltops-tools/kubes/blob/master/lib/templates/new/resource/yaml) to all the resources that the generator supports.
42 |
--------------------------------------------------------------------------------
/docs/_docs/helpers.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Helpers
3 | ---
4 |
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 %}).
8 |
9 | ## DSL Specific Methods
10 |
11 | Each DSL resource has it's own specific methods. Refer to the [DSL Docs]({% link _docs/dsl.md %}) for their methods.
12 |
13 | ## Provider Helpers
14 |
15 | There are also provider-specific helpers:
16 |
17 | * [AWS Helpers]({% link _docs/helpers/aws.md %})
18 | * [Google Helpers]({% link _docs/helpers/google.md %})
19 |
20 | {% include helpers/generator.md %}
--------------------------------------------------------------------------------
/docs/_docs/helpers/aws.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: AWS Helpers
3 | ---
4 |
5 | List of AWS helpers:
6 |
7 | {% assign docs = site.docs | where: "categories","helpers-aws" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.nav_text }}]({{ doc.url }})
10 | {% endfor %}
11 |
12 | ## Notes
13 |
14 | * By default, `KubeGoogle.logger = Kubes.logger`. This means, you can set `logger.level = "debug"` in `.kubes/config.rb` to see more details.
15 | * The AWS helpers are provided by the [boltops-tools/kubes_aws](https://github.com/boltops-tools/kubes_aws) library.
16 |
--------------------------------------------------------------------------------
/docs/_docs/helpers/aws/advanced.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Advanced AWS Helpers
3 | nav_text: Advanced
4 | categories: helpers-aws
5 | ---
6 |
7 | {% assign docs = site.docs | where: "categories","advanced-helpers-aws" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.nav_text }}]({{ doc.url }})
10 | {% endfor %}
11 |
--------------------------------------------------------------------------------
/docs/_docs/helpers/builtin.md:
--------------------------------------------------------------------------------
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).
17 |
--------------------------------------------------------------------------------
/docs/_docs/helpers/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Helpers
3 | ---
4 |
5 | Kubes ships with several built-in helpers. On top of this, you can define your own custom helpers. This allows you to define new methods and customize Kubes further.
6 |
7 | ## Example
8 |
9 | You define custom helpers in the `.kubes/helpers` folder.
10 |
11 | .kubes/helpers/my_helpers.rb
12 |
13 | ```ruby
14 | module MyHelpers
15 | def database_endpoint
16 | case Kubes.env
17 | when "dev"
18 | "dev-db.cbuqdmc3nqvb.us-west-2.rds.amazonaws.com"
19 | when "prod"
20 | "prod-db.cbuqdmc3nqvb.us-west-2.rds.amazonaws.com"
21 | end
22 | end
23 | end
24 | ```
25 |
26 | The `database_endpoint` will be available to use in the `.kubes/resources` YAML files. IE:
27 |
28 | .kubes/helpers/resources/shared/config_map.yaml
29 |
30 | ```yaml
31 | apiVersion: v1
32 | kind: ConfigMap
33 | metadata:
34 | name: demo
35 | labels:
36 | app: demo
37 | data:
38 | DATABASE_ENDPOINT: <%= database_endpoint %>
39 | ```
40 |
41 | {% include helpers/generator.md %}
--------------------------------------------------------------------------------
/docs/_docs/helpers/google/advanced.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Advanced Google Helpers
3 | nav_text: Advanced
4 | categories: helpers-google
5 | ---
6 |
7 | {% assign docs = site.docs | where: "categories","advanced-helpers-google" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.nav_text }}]({{ doc.url }})
10 | {% endfor %}
11 |
--------------------------------------------------------------------------------
/docs/_docs/install.md:
--------------------------------------------------------------------------------
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.
9 |
--------------------------------------------------------------------------------
/docs/_docs/install/dependencies.md:
--------------------------------------------------------------------------------
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).
19 |
--------------------------------------------------------------------------------
/docs/_docs/install/gem.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Gem Installation
3 | ---
4 |
5 | {% include install/gem.md %}
6 |
7 |
--------------------------------------------------------------------------------
/docs/_docs/install/standalone/details.md:
--------------------------------------------------------------------------------
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.
21 |
--------------------------------------------------------------------------------
/docs/_docs/install/standalone/details/uninstall.md:
--------------------------------------------------------------------------------
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
17 |
--------------------------------------------------------------------------------
/docs/_docs/install/standalone/macosx.md:
--------------------------------------------------------------------------------
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
46 |
--------------------------------------------------------------------------------
/docs/_docs/intro.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: What is Kubes?
3 | ---
4 |
5 | {% include reference.md %}
6 |
7 |
8 |
9 | ## Features
10 |
11 | {% include intro/features.md %}
12 |
--------------------------------------------------------------------------------
/docs/_docs/intro/how-kubes-works.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: How Kubes Works
3 | ---
4 |
5 | Kubes is pretty straightforward. Kubes first builds the Docker image. Then it compiles Kubernetes YAML files. Lastly, it merely calls out to `kubectl`.
6 |
7 | In fact, you can use Kubes to build the files first, and then run `kubectl` directly. Example:
8 |
9 | kubes docker build
10 | kubes docker push
11 | kubes compile # compiles the .kubes/resources files to .kubes/output
12 |
13 | Now, use `kubectl` directly and apply them in the proper order:
14 |
15 | kubectl apply -f .kubes/output/shared/namespace.yaml
16 | kubectl apply -f .kubes/output/web/service.yaml
17 | kubectl apply -f .kubes/output/web/deployment.yaml
18 |
19 | The deploy command simply does all 3 steps: build, compile, and apply.
20 |
21 | kubes deploy
22 |
23 | Kubes is very transparent about it does. It prints out the `kubectl` commands as they are being called.
24 |
25 | You can also run the `kubectl apply` only. The `kube apply` command compiles but will skip the docker build stage if it's already been built.
26 |
27 | kubes apply
28 |
--------------------------------------------------------------------------------
/docs/_docs/intro/ordering/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Ordering
3 | ---
4 |
5 | You can override the ordering with the `kinds` and `roles` option under the `config.kubectl.order` key. It is fully configurable. Here's an example of overriding the default ordering.
6 |
7 | .kubes/config.rb:
8 |
9 | ```ruby
10 | Kubes.configure do |config|
11 | config.kubectl.order.roles = %w[
12 | shared
13 | web
14 | worker
15 | clock
16 | ]
17 | config.kubectl.order.kinds = [
18 | "Namespace",
19 | # ...
20 | "Deployment",
21 | ]
22 | end
23 | ```
24 |
25 | Items not listed in the list are sorted at the end and in alphabetical order. Refer to the source [ordering.rb](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/config.rb#L50) for the default ordering.
26 |
--------------------------------------------------------------------------------
/docs/_docs/layering.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Layering
3 | ---
4 |
5 | Kubes supports layering files together so you can use the same Kubernetes files to build multiple environments like dev and prod.
6 |
7 | {% assign docs = site.docs | where: "categories","layering" | sort: "order" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.title }}]({{ doc.url }})
10 | {% endfor %}
11 |
--------------------------------------------------------------------------------
/docs/_docs/layering/dsl.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: DSL Layering
3 | nav_text: DSL
4 | category: layering
5 | order: 2
6 | ---
7 |
8 | {% include layering/layers.md ext="rb" %}
9 |
--------------------------------------------------------------------------------
/docs/_docs/layering/extra.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Extra Layering
3 | category: layering
4 | order: 8
5 | ---
6 |
7 | Setting KUBES_EXTRA will process extra layers.
8 |
9 | ## Variables
10 |
11 | Example
12 |
13 | KUBES_EXTRA=2 kubes deploy
14 |
15 | Will process:
16 |
17 | .kubes/variables/dev.rb
18 | .kubes/variables/dev-2.rb
19 |
--------------------------------------------------------------------------------
/docs/_docs/layering/yaml.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: YAML Layering
3 | nav_text: YAML
4 | category: layering
5 | order: 1
6 | ---
7 |
8 | {% include layering/layers.md ext="yaml" %}
9 |
--------------------------------------------------------------------------------
/docs/_docs/learn/dsl.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Getting Started with DSL
3 | ---
4 |
5 | {% include learn/start.md type="DSL" %}
6 |
--------------------------------------------------------------------------------
/docs/_docs/learn/dsl/change.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Change Project
3 | ---
4 |
5 | Let's make a simple change. We'll adjust the number of replicas to 3. We do this in `deployment/dev.rb`.
6 |
7 | .kubes/resources/web/deployment/dev.rb
8 |
9 | ```ruby
10 | ---
11 | replicas 3 # <= CHANGED
12 | ```
13 |
14 | This demonstrates Kubes [Layering support]({% link _docs/layering.md %}). We can make changes to only the `KUBES_DEV` environment.
15 |
16 | Next, we'll deploy this update.
17 |
--------------------------------------------------------------------------------
/docs/_docs/learn/dsl/cluster.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cluster Setup
3 | ---
4 |
5 | {% include learn/cluster.md %}
6 |
--------------------------------------------------------------------------------
/docs/_docs/learn/dsl/delete.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Delete App
3 | ---
4 |
5 | Let's now delete the app and clean up:
6 |
7 | kubes delete
8 |
9 | You will be prompted to confirm before deletion.
10 |
11 | $ kubes delete
12 | Compiled .kubes/resources files to .kubes/output
13 | Will run:
14 | kubectl delete -f .kubes/output/web/deployment.yaml
15 | kubectl delete -f .kubes/output/web/service.yaml
16 | kubectl delete -f .kubes/output/shared/namespace.yaml
17 | This will delete resources. Are you sure? (y/N)
18 |
19 | Confirm to delete the resources:
20 |
21 | This will delete resources. Are you sure? (y/N) y
22 | => kubectl delete -f .kubes/output/web/service.yaml
23 | service "demo-web" deleted
24 | => kubectl delete -f .kubes/output/web/deployment.yaml
25 | deployment.apps "demo-web" deleted
26 | => kubectl delete -f .kubes/output/shared/namespace.yaml
27 | namespace "demo" deleted
28 | $
29 |
30 | Let's double-check that the resources have been deleted:
31 |
32 | $ kubectl get all
33 | No resources found.
34 | $
35 |
36 | Tip: If you want to delete without the prompt, you can use the `-y` option:
37 |
38 | kubes delete -y
39 |
40 | Next, we'll look at some next steps.
41 |
--------------------------------------------------------------------------------
/docs/_docs/learn/dsl/install.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Install Kubes
3 | ---
4 |
5 | {% include install/gem.md %}
--------------------------------------------------------------------------------
/docs/_docs/learn/dsl/next-steps.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Next Steps
3 | ---
4 |
5 | {% include learn/next-steps.md %}
6 |
--------------------------------------------------------------------------------
/docs/_docs/learn/yaml.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Getting Started with YAML
3 | ---
4 |
5 | {% include learn/start.md type="YAML" %}
6 |
--------------------------------------------------------------------------------
/docs/_docs/learn/yaml/change.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Change Project
3 | ---
4 |
5 | Let's make a simple change. We'll adjust the number of replicas to 3. We do this in `deployment/dev.yaml`.
6 |
7 | .kubes/resources/web/deployment/dev.yaml
8 |
9 | ```yaml
10 | ---
11 | spec:
12 | replicas: 3 # <= CHANGED
13 | ```
14 |
15 | This demonstrates Kubes [Layering support]({% link _docs/layering.md %}). We can make changes to only the `KUBES_DEV` environment.
16 |
17 | Next, we'll deploy this update.
18 |
--------------------------------------------------------------------------------
/docs/_docs/learn/yaml/cluster.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cluster Setup
3 | ---
4 |
5 | {% include learn/cluster.md %}
6 |
--------------------------------------------------------------------------------
/docs/_docs/learn/yaml/install.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Install Kubes
3 | ---
4 |
5 | {% include install/gem.md %}
--------------------------------------------------------------------------------
/docs/_docs/learn/yaml/next-steps.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Next Steps
3 | ---
4 |
5 | {% include learn/next-steps.md %}
6 |
--------------------------------------------------------------------------------
/docs/_docs/misc/separate-steps.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Separate Steps
3 | ---
4 |
5 | Sometimes you may want to run the 3 separate kubes steps directly. This may be useful if you are setting up CI/CD and need more control over the build process. Here are the 3 main steps:
6 |
7 | To build and push the docker image:
8 |
9 | kubes docker build
10 | kubes docker push
11 |
12 | Note, you must run a `kubes docker build` at least once. As the build step will store the image name in a `.kubes/state/docker_image.txt ` file for later use.
13 |
14 | To compile the Kubernetes YAML files.
15 |
16 | kubes compile
17 |
18 | To apply the Kubernetes YAML files in the correct order and create resources on the cluster:
19 |
20 | kubes apply
21 |
22 |
--------------------------------------------------------------------------------
/docs/_docs/next-steps.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Next Steps
3 | ---
4 |
5 | Hopefully, you have a good feel for how kubes works now. From here, there are a few resources that can help you continue along:
6 |
7 | * Check out the [kubes](https://github.com/boltops-tools/kubes) repo on GitHub
8 | * ⭐️ the kubes project on GitHub
9 | * Write a blog post about kubes
10 | * Post on your favorite discussion about kubes
11 | * Contribute a pull request
12 |
13 | Everyone can contribute to making kubes better, including the documentation. These docs are the kubes repo located the [docs folder](https://github.com/boltops-tools/tree/master/docs). Please fork the project and open a pull request! We love your pull requests. Contributions are encouraged and welcomed!
14 |
--------------------------------------------------------------------------------
/docs/_docs/patterns.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Patterns
3 | ---
4 |
5 | We'll cover some common deployment patterns here:
6 |
7 | {% assign docs = site.docs | where: "categories","patterns" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.title }}]({{ doc.url }})
10 | {% endfor %}
11 |
--------------------------------------------------------------------------------
/docs/_docs/plugins.md:
--------------------------------------------------------------------------------
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 %})
13 |
--------------------------------------------------------------------------------
/docs/_docs/plugins/aws.md:
--------------------------------------------------------------------------------
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.secrets.base64 = false
12 | end
13 | ```
14 |
15 | ## Options Reference Table
16 |
17 | Here's a table with the options:
18 |
19 | Name | Description | Default
20 | ---|---|---
21 | secrets.base64 | Whether or not to automatically base64 encoded values returned by the `aws_secret` helper. | true
22 |
--------------------------------------------------------------------------------
/docs/_docs/plugins/google.md:
--------------------------------------------------------------------------------
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.secrets.base64 = true
12 | end
13 | ```
14 |
15 | ## Options Reference Table
16 |
17 | Here's a table with the options:
18 |
19 | Name | Description | Default
20 | ---|---|---
21 | secrets.base64 | Whether or not to automatically base64 encoded values returned by the `google_secret` helper. | true
22 | {% include plugins/gke-config.md %}
--------------------------------------------------------------------------------
/docs/_docs/resources.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Resources
3 | ---
4 |
5 | You define your Kubernetes resources in the `.kubes/resources` folder. Kubes categories items within this folder in 3 main buckets:
6 |
7 | * [Role-Based Resource]({% link _docs/resources/role.md %}): Role-based resources. This is your main project resources group in roles.
8 | * [Base Folder]({% link _docs/resources/base.md %}): The base folder contains definitions for common fields that is used for [Layering]({% link _docs/layering.md %}).
9 | * [Shared Resources]({% link _docs/resources/shared.md %}): Shared resources that are meant to be created first and shared by other resources.
10 |
11 | In the next sections, we'll cover how these resources are used.
12 |
--------------------------------------------------------------------------------
/docs/_docs/resources/base.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Base
3 | ---
4 |
5 | The base folder is used for purely layering.
6 |
7 | ## Structure
8 |
9 | Here's an example structure, so we can understand how layering works with the base folder.
10 |
11 | .kubes/resources/
12 | ├── base
13 | │ ├── all.rb
14 | │ └── deployment.rb
15 | └── web
16 | ├── deployment.rb
17 | └── service.rb
18 |
19 | ## Layering
20 |
21 | Kubes process the files in the `base` folder first, then it process your [role-based resources]({% link _docs/resources/role.md %}) like web. So:
22 |
23 | kubes deploy web deployment
24 |
25 | Will layer:
26 |
27 | 1. .kubes/resources/base/all.rb
28 | 2. .kubes/resources/base/deployment.rb
29 | 3. .kubes/resources/web/deployment.rb
30 |
31 | More details on layering can be found in the [Layering Docs]({% link _docs/layering.md %}).
32 |
33 | Remember files in the base are used just for layering.
34 |
--------------------------------------------------------------------------------
/docs/_docs/resources/role.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Role-Based Resources
3 | ---
4 |
5 | Role-based resources are your main project's resources. Kubes groups resources together under a "role".
6 |
7 | ## Example Structure
8 |
9 | Here's an example structure to help explain how role-based resources work.
10 |
11 | .kubes/resources
12 | ├── clock
13 | │ └── deployment.yaml
14 | ├── web
15 | │ ├── deployment.yaml
16 | │ └── service.yaml
17 | └── worker
18 | └── deployment.yaml
19 |
20 | ## Resource Roles
21 |
22 | Here the resource roles are:
23 |
24 | 1. clock
25 | 2. web
26 | 3. worker
27 |
28 | You can freely add more roles if needed. This structure is flexible enough to account for most use-cases.
29 |
30 | ## Deploy
31 |
32 | You can deploy specific roles like so:
33 |
34 | kubes deploy clock
35 | kubes deploy web
36 | kubes deploy worker
37 |
38 | Or you can deploy all roles at once:
39 |
40 | kubes deploy
41 |
--------------------------------------------------------------------------------
/docs/_docs/variables.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Variables
3 | ---
4 |
5 | You can set variables to be made available to the templates. Generally, it is recommended to use Basic layering.
6 |
7 | {% assign docs = site.docs | where: "categories","variables" %}
8 | {% for doc in docs -%}
9 | * [{{ doc.title }}]({{ doc.url }})
10 | {% endfor %}
11 |
12 | {% include variables/generator.md %}
--------------------------------------------------------------------------------
/docs/_docs/vs.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Kubes vs. Other Tools
3 | ---
4 |
5 | {% include videos/learn/vs.md %}
6 |
7 | Here are some useful comparisons to help you compare Kubes vs other tools in the ecosystem:
8 |
9 | {% assign docs = site.docs | where: "categories","vs" %}
10 | {% for doc in docs -%}
11 | * [{{ doc.nav_text }}]({{ doc.url }})
12 | {% endfor %}
13 |
--------------------------------------------------------------------------------
/docs/_docs/yaml.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Kubes YAML
3 | ---
4 |
5 | You can write your Kubernetes resources in YAML format.
6 |
7 | .kubes/resources
8 | └── web
9 | ├── deployment.yaml
10 | └── service.yaml
11 |
12 | ## YAML and Templating
13 |
14 | Kubes provides a little extra power for the YAML format. The YAML files are processed through an ERB templating language. So you have dynamic control. Here's an example with `Kubes.env` and the `docker_image` helper.
15 |
16 | .kubes/resources/web/deployment.yaml
17 |
18 | ```yaml
19 | ---
20 | apiVersion: apps/v1
21 | kind: Deployment
22 | metadata:
23 | name: demo-web
24 | labels:
25 | app: demo
26 | namespace: default
27 | spec:
28 | replicas: <%= Kubes.env == "prod" ? 2 : 1 %>
29 | selector:
30 | matchLabels:
31 | app: demo
32 | template:
33 | metadata:
34 | labels:
35 | app: demo
36 | spec:
37 | containers:
38 | - name: demo-web
39 | image: <%= docker_image %>
40 | ```
41 |
--------------------------------------------------------------------------------
/docs/_docs/yaml/multiple-files.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: YAML Multiple Resources with Multiple Files
3 | ---
4 |
5 | You can also create multiple resources of same kind by appending a dash followed by anything. Example:
6 |
7 | .kubes/resources
8 | └── web
9 | ├── deployment-1.yaml
10 | ├── deployment-2.yaml
11 | ├── service-1.yaml
12 | └── service-2.yaml
13 |
14 | Only words before the dash are used to infer the resource kind.
15 |
16 | Filename | Resource Kind
17 | --- | ---
18 | deployment-1.yaml | Deployment
19 | deployment-2.yaml | Deployment
20 | service-1.yaml | Service
21 | service-2.yaml | Service
22 |
23 |
--------------------------------------------------------------------------------
/docs/_includes/banner/foot.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/docs/_includes/config/hooks/generator.md:
--------------------------------------------------------------------------------
1 | ## Hook Generator
2 |
3 | To generator a starter hook:
4 |
5 | $ kubes new hook {{ include.type }}
6 | create .kubes/config/hooks/{{ include.type }}.rb
7 |
--------------------------------------------------------------------------------
/docs/_includes/config/hooks/options.md:
--------------------------------------------------------------------------------
1 | ## General Form
2 |
3 | ```ruby
4 | before(COMMAND_NAME, OPTIONS)
5 | ````
6 |
7 | The command name corresponds to the `{{ include.command }}` commands: apply, delete, etc.
8 |
9 | ## Hook Options
10 |
11 | Name | Description
12 | ---|---
13 | label | A human-friendly label so you can see what hooks is being run.
14 | execute | The script or command to run. IE: path/to/some/script.sh
15 | exit_on_fail | Whether or not to continue process if the script returns an failed exit code.
16 | {% if include.command == "kubectl" %}on | What resource to run the hook on. IE: shared/namespace, web/deployment, web/service. Note: This option is only used by kubectl hooks.{% endif %}
17 |
18 | ## Ruby Hooks
19 |
20 | Instead of using a script for the hook `execute` option, you can also use a Ruby object. This provides some more control over the current process. See: [Ruby Hooks]({% link _docs/config/hooks/ruby.md %})
21 |
22 |
--------------------------------------------------------------------------------
/docs/_includes/content.html:
--------------------------------------------------------------------------------
1 | {% if page.sidebar == false %}
2 |
3 | {{ content }}
4 |
5 | {% else %}
6 |
7 |
8 | {% include_cached sidebar.html %}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
{{ page.title }}
20 | {{ content }}
21 |
22 |
23 |
24 |
25 | {% endif %}
26 |
--------------------------------------------------------------------------------
/docs/_includes/dsl/methods.md:
--------------------------------------------------------------------------------
1 | For a full list of the available methods, refer to the source itself [syntax/{{ include.name }}.rb](https://github.com/boltops-tools/kubes/blob/master/lib/kubes/compiler/dsl/syntax/{{ include.name }}.rb).
2 |
--------------------------------------------------------------------------------
/docs/_includes/dsl/rolling_deployment.md:
--------------------------------------------------------------------------------
1 | A suffix hash based on the contents of the {{ include.kind }} is automatically appended to the {{ include.kind }} name. {{ include.kind }}s used in Deployment and Pod containers fields that use the same name will also have the suffix automatically appended. This is done to trigger a rolling deployment. Here's an example an deployment output with the hashed name.
2 |
--------------------------------------------------------------------------------
/docs/_includes/dsl/suffix_hash.md:
--------------------------------------------------------------------------------
1 | You can disable the auto hasher behavior with:
2 |
3 | ```ruby
4 | Kubes.configure do |config|
5 | # ...
6 | config.suffix_hash = false
7 | end
8 | ```
9 |
--------------------------------------------------------------------------------
/docs/_includes/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
TODO
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/_includes/google_analytics.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/docs/_includes/helpers/base64.md:
--------------------------------------------------------------------------------
1 | Note, Kubernetes secrets are only base64 encoded. So users who have access to read Kubernetes secrets will be able to decode and get the value trivially. Depending on your security posture requirements, this may or may not suffice.
2 |
--------------------------------------------------------------------------------
/docs/_includes/helpers/generator.md:
--------------------------------------------------------------------------------
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 | ```
--------------------------------------------------------------------------------
/docs/_includes/install/gem.md:
--------------------------------------------------------------------------------
1 | ## RubyGems
2 |
3 | Install kubes via RubyGems.
4 |
5 | gem install kubes
6 |
7 | Ruby 3.0 and above is recommended. For other ways to install Kubes see: [Install Docs]({% link _docs/install.md %}).
8 |
--------------------------------------------------------------------------------
/docs/_includes/install/wrapper.md:
--------------------------------------------------------------------------------
1 | ## Generated Wrapper
2 |
3 | The standalone installer creates a wrapper script in `/usr/local/bin`.
4 |
5 | /usr/local/bin/kubes
6 |
7 | Most users have `/usr/local/bin` configured in their PATH. So this wrapper should work immediately.
8 |
9 | Important: If you have a wrapper in `/usr/local/bin` already, the installer will overwrite it.
10 |
--------------------------------------------------------------------------------
/docs/_includes/js.html:
--------------------------------------------------------------------------------
1 | {% if site.google_analytics and jekyll.environment == "production" %}
2 | {% include google_analytics.html %}
3 | {% endif %}
4 |
--------------------------------------------------------------------------------
/docs/_includes/kubes-steps.md:
--------------------------------------------------------------------------------
1 | 1. Build the docker image and push it to repo
2 | 2. Compile Kubernetes YAML files with the Docker build image
3 | 3. Deploy via kubectl apply on the compiled Kubernetes YAML files
--------------------------------------------------------------------------------
/docs/_includes/learn/next-steps.md:
--------------------------------------------------------------------------------
1 | You've seen how to get started with Kubes. From here, you can check out the Docs to learn more:
2 |
3 | * [Intro]({% link _docs/intro.md %}): General introduction.
4 | * [Layering]({% link _docs/layering.md %}): Use the same Kubernetes YAML to build multiple environments like dev and prod with [layering]({% link _docs/layering.md %}).
5 | * [CLI Customizations]({% link _docs/config.md %}): You can customize the [cli args]({% link _docs/config/kubectl.md %}). You can also run hooks before and after kubectl commands.
6 | * [Extra Env]({% link _docs/extra-env.md %}): Create additional envs with little effort.
7 |
8 | ## Learn Videos
9 |
10 | Watch BoltOps Learn Kubes videos:
11 |
12 | * [BoltOps Learn Kubes Videos](https://learn.boltops.com/tagged/kubes)
13 |
14 |
15 | ## Kubes Features
16 |
17 | {% include intro/features.md %}
18 |
--------------------------------------------------------------------------------
/docs/_includes/learn/repo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/boltops-tools/kubes/94b80f0cbf8bb0ead1bb3b8b1946ee14a74579ca/docs/_includes/learn/repo
--------------------------------------------------------------------------------
/docs/_includes/learn/repos.md:
--------------------------------------------------------------------------------
1 | For this tutorial, here are examples of AWS ECR and Google GCR repos, though any repo will work.
2 |
3 | AWS:
4 |
5 | REPO=$(aws ecr describe-repositories --repository-name demo | jq -r '.repositories[].repositoryUri')
6 |
7 | Google:
8 |
9 | export GOOGLE_PROJECT=project-123
10 | REPO=gcr.io/$GOOGLE_PROJECT/demo
11 |
--------------------------------------------------------------------------------
/docs/_includes/learn/review.md:
--------------------------------------------------------------------------------
1 | ## Config
2 |
3 | The `config.rb` is where you can configure Kubes settings.
4 |
5 | .kubes/config.rb
6 |
7 | ```ruby
8 | Kubes.configure do |config|
9 | config.repo = "112233445566.dkr.ecr.us-west-2.amazonaws.com/demo" # may be gcr.io/project-123/demo
10 | config.logger.level = "info"
11 | # auto-switching
12 | # config.kubectl.context = "dev-cluster"
13 | end
14 | ```
15 |
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 %}).
17 |
18 | ## Dockerfile
19 |
20 | The `Dockerfile` is a simple starter example that just runs nginx
21 |
22 | Dockerfile:
23 |
24 | # Simple example starter
25 | FROM nginx
26 | EXPOSE 80
27 | CMD ["nginx", "-g", "daemon off;"]
28 |
29 | Note: If your project already has a Dockerfile, kubes will use that instead of generating a starter one.
30 |
--------------------------------------------------------------------------------
/docs/_includes/learn/start.md:
--------------------------------------------------------------------------------
1 | Kubes is a Kubernetes deployment tool. It automates the deployment process.
2 |
3 | In this guide we'll build a docker image, and build kubernetes YAML files, and deploy a demo app. We'll use the {{ include.type }} format.
4 |
--------------------------------------------------------------------------------
/docs/_includes/plugins/gke-config.md:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/docs/_includes/reference.md:
--------------------------------------------------------------------------------
1 | Kubes is a Kubernetes deployment tool. It focuses on deploying your specific application. It is very good at automating the deployment process. Kubes will:
2 |
3 | {% include kubes-steps.md %}
--------------------------------------------------------------------------------
/docs/_includes/variables/generator.md:
--------------------------------------------------------------------------------
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 | ```
13 |
14 | To create the prod variables, set `KUBES_ENV=prod`.
15 |
16 | $ KUBES_ENV=prod kubes new variable
17 | create .kubes/variables/prod.rb
18 |
19 | .kubes/variables/prod.rb
20 |
21 | ```ruby
22 | @example = "prod-value"
23 | ```
24 |
--------------------------------------------------------------------------------
/docs/_includes/videos/learn.md:
--------------------------------------------------------------------------------
1 |
Kubes is a Kubernetes App Deployment Tool. It focuses on deploying your specific application. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.