2 changes: 0 additions & 2 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: "Auto release"

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch:

env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
ref: ${{ github.ref }}
clean: true
- name: "PDK Build"
uses: docker://puppet/pdk:2.1.0.0
uses: docker://puppet/pdk:nightly
with:
args: 'build'
- name: "Push to Forge"
uses: docker://puppet/pdk:2.1.0.0
uses: docker://puppet/pdk:nightly
with:
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'
1 change: 1 addition & 0 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
env:
BUILDEVENT_FILE: '../buildevents.txt'
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'

steps:
- run: |
Expand Down
1 change: 1 addition & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
/appveyor.yml
/.editorconfig
/.fixtures.yml
/Gemfile
/.gitattributes
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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).

## [v6.2.0](https://github.com/puppetlabs/puppetlabs-kubernetes/tree/v6.2.0) (2021-07-19)

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

### Added

- Allow configuring of waiting times during sa creation [\#519](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/519) ([ZloeSabo](https://github.com/ZloeSabo))

### Fixed

- Support for kubernetes dashboard version 2.0.0 and onwards [\#528](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/528) ([danifr](https://github.com/danifr))
- Support both standard Calico and Calico Tigera [\#511](https://github.com/puppetlabs/puppetlabs-kubernetes/pull/511) ([treydock](https://github.com/treydock))

## [v6.1.0](https://github.com/puppetlabs/puppetlabs-kubernetes/tree/v6.1.0) (2021-05-11)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-kubernetes/compare/v6.0.0...v6.1.0)
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The above parameters are:
* `VERSION`: The version of Kubernetes to deploy. Must follow X.Y.Z format. ([Check kubeadm regex rule](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version.go#L43) for more information)
* `CONTAINER_RUNTIME`: The container runtime Kubernetes uses. Set this value to `docker` (officially supported) or `cri_containerd`. Advanced Kubernetes users can use `cri_containerd`, however this requires an increased understanding of Kubernetes, specifically when running applications in a HA cluster. To run a HA cluster and access your applications, an external load balancer is required in front of your cluster. Setting this up is beyond the scope of this module. For more information, see the Kubernetes [documentation](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/).
* `CNI_PROVIDER`: The CNI network to install. Set this value to `weave`, `flannel`, `calico` or `cilium`.
* `CNI_PROVIDER_VERSION` The CNI version to use. `cilium` uses this variable to reference the correct deployment file. Current version `cilium` is `1.4.3`
* `CNI_PROVIDER_VERSION` The CNI version to use. `calico` and `cilium` uses this variable to reference the correct deployment file. Current version `cilium` is `1.4.3`, calico is `3.18`
* `ETCD_INITIAL_CLUSTER`: The server hostnames and IPs in the form of `hostname:ip`. When in production, include three, five, or seven nodes for etcd.
* `ETCD_IP`: The IP each etcd member listens on. We recommend passing the fact for the interface to be used by the cluster.
* `KUBE_API_ADVERTISE_ADDRESS`: The IP each etcd/apiserver instance uses on each controller. We recommend passing the fact for the interface to be used by the cluster.
Expand Down Expand Up @@ -784,7 +784,7 @@ Defaults to `https://github.com/opencontainers/runc/releases/download/v${runc_ve

Specifies the version of `runc` to install.

Defaults to `1.0.0-rc5`.
Defaults to `1.0.0`.

#### `sa_key`

Expand Down Expand Up @@ -818,6 +818,12 @@ The string used to join nodes to the cluster. This value must be in the form of

Defaults to `undef`.

#### `ttl_duration`

The duration before the bootstrap token is automatically deleted (e.g. 1s, 2m, 3h). If set to '0', the token will never expire

Defaults to `24h`

#### `worker`

Specifies whether to set the node as a Kubernetes worker.
Expand Down
46 changes: 32 additions & 14 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ the files if they do not exist.

[*runc_version*]
The version of runc to install
Defaults to 1.0.0-rc5
Defaults to 1.0.0

[*runc_source*]
The URL to download runc
Expand Down Expand Up @@ -897,11 +897,11 @@ the files if they do not exist.

[*kubernetes_dashboard_url*]
The URL to get the Kubernetes Dashboard yaml file.
Defaults to the upstream source. `kube_tool` sets this value.
Default is based on dashboard_version.

[*dashboard_version*]
The version of Kubernetes dashboard you want to install.
Defaults to v1.10.1
Defaults to 1.10.1

[*schedule_on_controller*]
A flag to remove the control plane role and allow pod scheduling on controllers
Expand Down Expand Up @@ -1223,6 +1223,8 @@ The following parameters are available in the `kubernetes` class:
* [`conntrack_tcp_wait_timeout`](#conntrack_tcp_wait_timeout)
* [`conntrack_tcp_stablished_timeout`](#conntrack_tcp_stablished_timeout)
* [`tmp_directory`](#tmp_directory)
* [`wait_for_default_sa_tries`](#wait_for_default_sa_tries)
* [`wait_for_default_sa_try_sleep`](#wait_for_default_sa_try_sleep)

##### <a name="kubernetes_version"></a>`kubernetes_version`

Expand Down Expand Up @@ -1574,15 +1576,15 @@ Data type: `String`



Default value: `'v1.10.1'`
Default value: `'1.10.1'`

##### <a name="kubernetes_dashboard_url"></a>`kubernetes_dashboard_url`

Data type: `String`
Data type: `Optional[String]`



Default value: `"https://raw.githubusercontent.com/kubernetes/dashboard/${dashboard_version}/src/deploy/recommended/kubernetes-dashboard.yaml"`
Default value: ``undef``

##### <a name="schedule_on_controller"></a>`schedule_on_controller`

Expand Down Expand Up @@ -1806,7 +1808,7 @@ Data type: `Optional[String]`



Default value: `'1.0.0-rc5'`
Default value: `'1.0.0'`

##### <a name="runc_source"></a>`runc_source`

Expand Down Expand Up @@ -2214,6 +2216,22 @@ Data type: `String`

Default value: `'/var/tmp/puppetlabs-kubernetes'`

##### <a name="wait_for_default_sa_tries"></a>`wait_for_default_sa_tries`

Data type: `Integer`



Default value: `5`

##### <a name="wait_for_default_sa_try_sleep"></a>`wait_for_default_sa_try_sleep`

Data type: `Integer`



Default value: `6`

### <a name="kubernetescluster_roles"></a>`kubernetes::cluster_roles`

The kubernetes::cluster_roles class.
Expand Down Expand Up @@ -3066,8 +3084,8 @@ The following parameters are available in the `kubernetes::kube_addons` class:
* [`cni_rbac_binding`](#cni_rbac_binding)
* [`install_dashboard`](#install_dashboard)
* [`dashboard_version`](#dashboard_version)
* [`dashboard_url`](#dashboard_url)
* [`kubernetes_version`](#kubernetes_version)
* [`kubernetes_dashboard_url`](#kubernetes_dashboard_url)
* [`controller`](#controller)
* [`schedule_on_controller`](#schedule_on_controller)
* [`node_name`](#node_name)
Expand Down Expand Up @@ -3130,21 +3148,21 @@ Data type: `String`

Default value: `$kubernetes::dashboard_version`

##### <a name="kubernetes_version"></a>`kubernetes_version`
##### <a name="dashboard_url"></a>`dashboard_url`

Data type: `String`



Default value: `$kubernetes::kubernetes_version`
Default value: `$kubernetes::dashboard_url`

##### <a name="kubernetes_dashboard_url"></a>`kubernetes_dashboard_url`
##### <a name="kubernetes_version"></a>`kubernetes_version`

Data type: `String`



Default value: `$kubernetes::kubernetes_dashboard_url`
Default value: `$kubernetes::kubernetes_version`

##### <a name="controller"></a>`controller`

Expand Down Expand Up @@ -4070,15 +4088,15 @@ Data type: `Optional[Integer]`



Default value: `5`
Default value: `$kubernetes::wait_for_default_sa_tries`

##### <a name="try_sleep"></a>`try_sleep`

Data type: `Optional[Integer]`



Default value: `6`
Default value: `$kubernetes::wait_for_default_sa_try_sleep`

##### <a name="env"></a>`env`

Expand Down
21 changes: 14 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
#
# [*runc_version*]
# The version of runc to install
# Defaults to 1.0.0-rc5
# Defaults to 1.0.0
#
# [*runc_source*]
# The URL to download runc
Expand Down Expand Up @@ -328,11 +328,11 @@
#
# [*kubernetes_dashboard_url*]
# The URL to get the Kubernetes Dashboard yaml file.
# Defaults to the upstream source. `kube_tool` sets this value.
# Default is based on dashboard_version.
#
# [*dashboard_version*]
# The version of Kubernetes dashboard you want to install.
# Defaults to v1.10.1
# Defaults to 1.10.1
#
# [*schedule_on_controller*]
# A flag to remove the control plane role and allow pod scheduling on controllers
Expand Down Expand Up @@ -579,9 +579,8 @@
Optional[String] $cni_provider = undef,
Optional[String] $cni_rbac_binding = undef,
Boolean $install_dashboard = false,
String $dashboard_version = 'v1.10.1',
String $kubernetes_dashboard_url =
"https://raw.githubusercontent.com/kubernetes/dashboard/${dashboard_version}/src/deploy/recommended/kubernetes-dashboard.yaml",
String $dashboard_version = '1.10.1',
Optional[String] $kubernetes_dashboard_url = undef,
Boolean $schedule_on_controller = false,
Integer $api_server_count = undef,
Boolean $delegated_pki = false,
Expand Down Expand Up @@ -609,7 +608,7 @@
Optional[Hash] $kubelet_extra_config = undef,
Optional[Array] $kubelet_extra_arguments = [],
Optional[String] $proxy_mode = '',
Optional[String] $runc_version = '1.0.0-rc5',
Optional[String] $runc_version = '1.0.0',
Optional[String] $runc_source =
"https://github.com/opencontainers/runc/releases/download/v${runc_version}/runc.amd64",
Optional[String] $runc_source_checksum = undef,
Expand Down Expand Up @@ -677,11 +676,19 @@
String $conntrack_tcp_wait_timeout = '1h0m0s',
String $conntrack_tcp_stablished_timeout = '24h0m0s',
String $tmp_directory = '/var/tmp/puppetlabs-kubernetes',
Integer $wait_for_default_sa_tries = 5,
Integer $wait_for_default_sa_try_sleep = 6,
) {
if !$facts['os']['family'] in ['Debian', 'RedHat'] {
notify { "The OS family ${facts['os']['family']} is not supported by this module": }
}

if versioncmp($dashboard_version, '2.0.0') >= 0 {
$dashboard_url = pick($kubernetes_dashboard_url, "https://raw.githubusercontent.com/kubernetes/dashboard/v${dashboard_version}/aio/deploy/recommended.yaml")
} else {
$dashboard_url = pick($kubernetes_dashboard_url, "https://raw.githubusercontent.com/kubernetes/dashboard/v${dashboard_version}/src/deploy/recommended/kubernetes-dashboard.yaml")
}

# Some cloud providers override or fix the node name, so we can't override
case $cloud_provider {
# k8s controller in AWS with delete any nodes it can't query in the metadata
Expand Down
8 changes: 4 additions & 4 deletions manifests/kube_addons.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
Optional[String] $cni_rbac_binding = $kubernetes::cni_rbac_binding,
Boolean $install_dashboard = $kubernetes::install_dashboard,
String $dashboard_version = $kubernetes::dashboard_version,
String $dashboard_url = $kubernetes::dashboard_url,
String $kubernetes_version = $kubernetes::kubernetes_version,
String $kubernetes_dashboard_url = $kubernetes::kubernetes_dashboard_url,
Boolean $controller = $kubernetes::controller,
Optional[Boolean] $schedule_on_controller = $kubernetes::schedule_on_controller,
String $node_name = $kubernetes::node_name,
Expand All @@ -35,7 +35,7 @@
}

if $cni_network_provider {
if $cni_provider == 'calico' {
if $cni_provider == 'calico-tigera' {
if $cni_network_preinstall {
$shellsafe_preinstall = shell_escape($cni_network_preinstall)
exec { 'Install cni network (preinstall)':
Expand Down Expand Up @@ -72,7 +72,7 @@
exec { 'Install cni network provider':
command => "kubectl apply -f ${shellsafe_provider}",
onlyif => 'kubectl get nodes',
unless => "kubectl -n kube-system get daemonset | egrep '(flannel|weave|cilium)'",
unless => "kubectl -n kube-system get daemonset | egrep '(flannel|weave|calico-node|cilium)'",
environment => $env,
}
}
Expand All @@ -86,7 +86,7 @@
}

if $install_dashboard {
$shellsafe_source = shell_escape($kubernetes_dashboard_url)
$shellsafe_source = shell_escape($dashboard_url)
exec { 'Install Kubernetes dashboard':
command => "kubectl apply -f ${shellsafe_source}",
onlyif => 'kubectl get nodes',
Expand Down
2 changes: 1 addition & 1 deletion manifests/repos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
repos => pick($kubernetes_apt_repos,'main'),
release => pick($kubernetes_apt_release,'kubernetes-xenial'),
key => {
'id' => pick($kubernetes_key_id,'54A647F9048D5688D7DA2ABE6A030B21BA07F4FB'),
'id' => pick($kubernetes_key_id,'7F92E05B31093BEF5A3C2D38FEEA9169307EA071'),
'source' => pick($kubernetes_key_source,'https://packages.cloud.google.com/apt/doc/apt-key.gpg'),
},
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/wait_for_default_sa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
String $namespace = $title,
Array $path = $kubernetes::default_path,
Optional[Integer] $timeout = undef,
Optional[Integer] $tries = 5,
Optional[Integer] $try_sleep = 6,
Optional[Integer] $tries = $kubernetes::wait_for_default_sa_tries,
Optional[Integer] $try_sleep = $kubernetes::wait_for_default_sa_try_sleep,
Optional[Array] $env = $kubernetes::environment,
) {
$safe_namespace = shell_escape($namespace)
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-kubernetes",
"version": "6.1.0",
"version": "6.2.0",
"author": "puppetlabs",
"summary": "The module installs and configures a Kubernetes cluster",
"license": "Apache-2.0",
Expand Down Expand Up @@ -53,7 +53,7 @@
"version_requirement": ">= 6.0.0 < 8.0.0"
}
],
"pdk-version": "2.0.0",
"pdk-version": "2.1.0",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
"template-ref": "heads/main-0-ge04486b"
"template-ref": "heads/main-0-g03daa92"
}
2 changes: 1 addition & 1 deletion spec/acceptance/integration_kubernetes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
it 'verify the k8 nodes' do
run_shell('sleep 20')
run_shell('KUBECONFIG=/etc/kubernetes/admin.conf kubectl get nodes') do |r|
expect(r.stdout).to match(/#{hostname1}(\s)+Ready(\s)+master/)
expect(r.stdout).to match(/#{hostname1}(\s)+Ready(\s)+control-plane,master/)
expect(r.stdout).to match(/#{hostname2}(\s)+Ready/)
expect(r.stdout).to match(/#{hostname3}(\s)+Ready/)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/kubernetes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
pp = <<-MANIFEST
if $facts['os']['family'] == 'redhat'{
class {'kubernetes':
kubernetes_version => '1.16.6',
kubernetes_package_version => '1.16.6',
kubernetes_version => '1.20.6',
kubernetes_package_version => '1.20.6',
controller_address => "$::ipaddress:6443",
container_runtime => 'docker',
manage_docker => false,
Expand Down
Loading