Showing with 53,404 additions and 400 deletions.
  1. +3 −0 .fixtures.yml
  2. +44 −0 .github/workflows/release.yml
  3. +1 −0 .gitignore
  4. +1 −0 .pdkignore
  5. +7 −0 .rubocop.yml
  6. +13 −23 .sync.yml
  7. +5 −8 .travis.yml
  8. +24 −1 CHANGELOG.md
  9. +2 −0 CODEOWNERS
  10. +5 −8 Gemfile
  11. +33 −4 README.md
  12. +52,593 −0 REFERENCE.md
  13. +11 −2 Rakefile
  14. +9 −4 manifests/config/kubeadm.pp
  15. +3 −2 manifests/config/worker.pp
  16. +27 −4 manifests/init.pp
  17. +9 −7 manifests/kube_addons.pp
  18. +74 −16 manifests/packages.pp
  19. +2 −2 manifests/repos.pp
  20. +6 −6 metadata.json
  21. +16 −0 provision.yaml
  22. +9 −9 spec/acceptance/kubernetes_spec.rb
  23. +0 −12 spec/acceptance/nodesets/centos-72-x64.yml
  24. +0 −12 spec/acceptance/nodesets/default.yml
  25. +0 −15 spec/acceptance/nodesets/pooler/centos7.yml
  26. +0 −15 spec/acceptance/nodesets/pooler/default.yml
  27. +0 −15 spec/acceptance/nodesets/pooler/rhel7.yml
  28. +0 −15 spec/acceptance/nodesets/pooler/ubuntu-1604.yml
  29. +0 −12 spec/acceptance/nodesets/ubuntu-1604-x64.yml
  30. +49 −5 spec/classes/config/kubeadm_spec.rb
  31. +67 −2 spec/classes/packages_spec.rb
  32. +1 −0 spec/default_facts.yml
  33. +5 −187 spec/spec_helper_acceptance.rb
  34. +170 −0 spec/spec_helper_acceptance_local.rb
  35. +12 −0 templates/docker/daemon_debian.json.erb
  36. +15 −0 templates/docker/daemon_redhat.json.erb
  37. +5 −1 templates/v1beta1/config_kubeadm.yaml.erb
  38. +1 −9 templates/v1beta1/config_worker.yaml.erb
  39. +137 −0 templates/v1beta2/config_kubeadm.yaml.erb
  40. +36 −0 templates/v1beta2/config_worker.yaml.erb
  41. +1 −1 tooling/Dockerfile
  42. +8 −3 tooling/kube_tool/create_certs.rb
3 changes: 3 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ fixtures:
augeasproviders_core: "herculesteam-augeasproviders_core"
kmod: "camptocamp-kmod"
repositories:
facts: 'git://github.com/puppetlabs/puppetlabs-facts.git'
puppet_agent: 'git://github.com/puppetlabs/puppetlabs-puppet_agent.git'
provision: 'git://github.com/puppetlabs/provision.git'
yumrepo_core:
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
puppet_version: ">= 6.0.0"
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "release"

on:
push:
branches:
- 'release'

jobs:
LitmusAcceptance:
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks]
agent_family: ['puppet5', 'puppet6-nightly']

steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@master
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
Spec:
runs-on: self-hosted
strategy:
matrix:
check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
ruby_version: [2.5.x]
puppet_gem_version: [~> 5.0, ~> 6.0]
exclude:
- puppet_gem_version: ~> 5.0
check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
- ruby_version: 2.5.x
puppet_gem_version: ~> 5.0
steps:
- uses: actions/checkout@v1
- name: Spec Tests
uses: puppetlabs/action-litmus_spec@master
with:
puppet_gem_version: ${{ matrix.puppet_gem_version }}
check: ${{ matrix.check }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
1 change: 1 addition & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
Expand Down
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down Expand Up @@ -98,6 +99,12 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Expand Down
36 changes: 13 additions & 23 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
---
.gitignore:
required:
- ---.project

.gitlab-ci.yml:
delete: true

.travis.yml:
deploy_to_forge:
enabled: false
branches:
- release
- release
simplecov: true

appveyor.yml:
delete: true

Gemfile:
required:
':system_tests':
- gem: 'puppet-module-posix-system-r#{minor_version}'
platforms: ruby
- gem: 'puppet-module-win-system-r#{minor_version}'
platforms:
- mswin
- mingw
- x64_mingw
optional:
':development':
- gem: 'github_changelog_generator'
Expand All @@ -49,15 +39,15 @@ Rakefile:
AllCops:
TargetRubyVersion: '2.2'
Exclude:
- tooling/kube_tool/*
- tooling/*
- spec/defines/*
- spec/classes/*
- spec/*
- spec/acceptance/*
- rakelib/*
- plans/*.pp
- tasks/*
- tooling/kube_tool/*
- tooling/*
- spec/defines/*
- spec/classes/*
- spec/*
- spec/acceptance/*
- rakelib/*
- plans/*.pp
- tasks/*

spec/spec_helper.rb:
mock_with: ':rspec'
Expand Down
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system $RUBYGEMS_VERSION
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
- "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used"
- "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
- '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION'
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
- 'SIMPLECOV=yes bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.3
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
matrix:
fast_finish: true
include:
Expand All @@ -34,9 +34,6 @@ matrix:
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
branches:
only:
- master
Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v5.1.0](https://github.com/puppetlabs/puppetlabs-kubernetes/tree/v5.1.0) (2020-01-27)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-kubernetes/compare/v5.0.0...v5.1.0)

### Added

- Allow setting metricsBindAddress [\#377](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/377) ([TJM](https://github.com/TJM))
- Add docker\_extra\_daemon\_config for use when managing docker [\#376](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/376) ([mrwulf](https://github.com/mrwulf))
- Add support for managing Docker logging max-file and max-size settings. [\#358](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/358) ([nickperry](https://github.com/nickperry))
- Add possibility to run acceptance tests with Litmus and Vagrant [\#353](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/353) ([carabasdaniel](https://github.com/carabasdaniel))
- Add\_support\_1.16 [\#351](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/351) ([BaronMsk](https://github.com/BaronMsk))

### Fixed

- Fix worker k8s 1.6 [\#363](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/363) ([BaronMsk](https://github.com/BaronMsk))
- Configure extra\_volumes when cloud\_provider is set and cloud\_config is not. Fixes \#301 [\#361](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/361) ([nickperry](https://github.com/nickperry))
- Add support for readOnly and pathType fields on volumes [\#359](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/359) ([nickperry](https://github.com/nickperry))
- Adding all IPs for etcd servers to etcd server cert [\#350](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/350) ([blodone](https://github.com/blodone))
- repair/improve package installation [\#348](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/348) ([scoopex](https://github.com/scoopex))
- Use correct apt release on Debian/Ubuntu [\#338](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/338) ([aptituz](https://github.com/aptituz))
- Fix repository location for Ubuntu [\#337](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/337) ([aptituz](https://github.com/aptituz))
- Fixed v1beta1 JoinConfiguration template to match the documentation [\#332](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/332) ([Xartos](https://github.com/Xartos))

## [v5.0.0](https://github.com/puppetlabs/puppetlabs-kubernetes/tree/v5.0.0) (2019-07-24)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-kubernetes/compare/v4.0.1...v5.0.0)

### Changed

- \(MODULES-9550\) - v5.0.0 Release Prep [\#324](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/324) ([sheenaajay](https://github.com/sheenaajay))
- \(FM-8100\) Update minimum supported Puppet version to 5.5.10 [\#291](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/291) ([sheenaajay](https://github.com/sheenaajay))

### Added
Expand All @@ -28,7 +52,6 @@ All notable changes to this project will be documented in this file. The format

### Fixed

- Add extra arguments for API server and controller manager [\#282](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/282) ([fydai](https://github.com/fydai))
- cluster name missing tag brackets in worker config [\#280](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/280) ([jorhett](https://github.com/jorhett))
- Avoid log message about waiting for SA when it already exists [\#278](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/278) ([jorhett](https://github.com/jorhett))
- MODULES-8947 fixing bugs and tests [\#274](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/274) ([sheenaajay](https://github.com/sheenaajay))
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Setting ownership to the modules team
* @puppetlabs/modules
13 changes: 5 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ group :development do
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
Expand Down
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
## Description

[<img
src="https://raw.githubusercontent.com/cncf/artwork/master/kubernetes/certified-kubernetes/1.13/color/certified-kubernetes-1.13-color.png"
src="https://github.com/cncf/artwork/blob/04763c0f5f72b23d6a20bfc9c68c88cee805dbcc/projects/kubernetes/certified-kubernetes/1.13/color/certified-kubernetes-1.13-color.png"
align="right" width="150px" alt="certified kubernetes 1.13">][certified]

[certified]: https://github.com/cncf/k8s-conformance/tree/master/v1.13/puppetlabs-kubernetes
Expand Down Expand Up @@ -58,7 +58,7 @@ docker run --rm -v $(pwd):/mnt --env-file env puppet/kubetool:{$module_version}
The `docker run` command above includes an `env` file which is included in the root folder of this repo.

```
docker run --rm -v $(pwd):/mnt -e OS=debian -e VERSION=1.10.2 -e CONTAINER_RUNTIME=docker -e CNI_PROVIDER=cilium -e CNI_PROVIDER_VERSION=1.4.3 -e ETCD_INITIAL_CLUSTER=kube-master:172.17.10.101,kube-replica-master-01:172.17.10.210,kube-replica-master-02:172.17.10.220 -e ETCD_IP="%{::ipaddress_eth1}" -e KUBE_API_ADVERTISE_ADDRESS="%{::ipaddress_eth1}" -e INSTALL_DASHBOARD=true puppet/kubetool:{$module-version}
docker run --rm -v $(pwd):/mnt -e OS=ubuntu -e VERSION=1.10.2 -e CONTAINER_RUNTIME=docker -e CNI_PROVIDER=cilium -e CNI_PROVIDER_VERSION=1.4.3 -e ETCD_INITIAL_CLUSTER=kube-master:172.17.10.101,kube-replica-master-01:172.17.10.210,kube-replica-master-02:172.17.10.220 -e ETCD_IP="%{networking.ip}" -e KUBE_API_ADVERTISE_ADDRESS="%{networking.ip}" -e INSTALL_DASHBOARD=true puppet/kubetool:{$module-version}
```

The above parameters are:
Expand Down Expand Up @@ -189,6 +189,8 @@ apiserver_extra_volumes => {
'volume-name' => {
hostPath => '/data',
mountPath => '/data',
readOnly: => 'false',
pathType: => 'DirectoryOrCreate'
},
}
```
Expand Down Expand Up @@ -286,6 +288,8 @@ controllermanager_extra_volumes => {
'volume-name' => {
hostPath => '/data',
mountPath => '/data',
readOnly: => 'false',
pathType: => 'DirectoryOrCreate'
},
}
```
Expand Down Expand Up @@ -428,7 +432,7 @@ Defaults to `$hostname`.

Specifies the IP address etcd uses for communications.

A Hiera is `kubernetes::etcd_ip:"%{::ipaddress_enp0s8}"`.
A Hiera is `kubernetes::etcd_ip:"%{networking.ip}"`.

Defaults to `undef`.

Expand Down Expand Up @@ -547,7 +551,7 @@ Defaults to `undef`.

The IP address you want exposed by the API server.

A Hiera example is `kubernetes::kube_api_advertise_address:"%{::ipaddress_enp0s8}"`.
A Hiera example is `kubernetes::kube_api_advertise_address:"%{networking.ip}"`.

Defaults to `undef`.

Expand Down Expand Up @@ -717,6 +721,31 @@ Docker is the supported container runtime for this module.

If you would like to contribute to this module, please follow the rules in the [CONTRIBUTING.md](https://github.com/puppetlabs/puppetlabs-kubernetes/blob/master/CONTRIBUTING.md). For more information, see our [module contribution guide.](https://puppet.com/docs/puppet/latest/contributing.html)

To run the acceptance tests you can use Puppet Litmus with the Vagrant provider by using the following commands:

bundle exec rake 'litmus:provision_list[all_supported]'
bundle exec rake 'litmus:install_agent[puppet5]'
bundle exec rake 'litmus:install_module'
bundle exec rake 'litmus:acceptance:parallel'

As currently Litmus does not allow memory size and cpu size parameters for the Vagrant provisioner task we recommend to manually update the Vagrantfile used by the provisioner and add at least the following specifications for the puppetlabs-kubernetes module acceptance tests:

**Update Vagrantfile in the file: spec/fixtures/modules/provision/tasks/vagrant.rb**
vf = <<-VF
Vagrant.configure(\"2\") do |config|
config.vm.box = '#{platform}'
config.vm.boot_timeout = 600
config.ssh.insert_key = false
config.vm.hostname = "testkube"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
end
#{network}
#{synced_folder}
end
VF

## Examples

In the examples folder you will find a [bash script](https://github.com/puppetlabs/puppetlabs-kubernetes/blob/master/examples/task_examples.sh) containg a few sample Puppet Bolt commands for the usage of the tasks. The example script is intended to be used with a Kubernetes API that requires the token authentication header, but the token parameter is optional by default.
Loading