Showing 678 changed files with 10,944 additions and 10,736 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version 4.0.0

Upgrade tasks for version v1beta1

Upgrade kubeadmn templates for v1beta1 (kubernetes versions 1.13.+)

Ability to change etcd hostname

Ability to change Kubernetes dashboard url

A full list of PR's and issues closed can be found here [here](https://github.com/puppetlabs/puppetlabs-kubernetes/milestone/7)

# Version 3.4.0

Add Puppet Bolt tasks to interact with the Kubernetes API
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@

## Description

[<img
src="https://raw.githubusercontent.com/cncf/artwork/master/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

This module installs and configures [Kubernetes](https://kubernetes.io/) which is an open-source system for automating deployment, scaling, and management of containerized applications. For efficient management and discovery, containers that make up an application are grouped into logical units.

To bootstrap a Kubernetes cluster in a secure and extensible way, this module uses the [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/) toolkit.




## Setup

[Install](https://puppet.com/docs/puppet/5.5/modules_installing.html) this module, [generate the configuration](#generating-the-module-configuration), [add the OS and hostname yaml files to Hiera](#adding-the-`{$OS}.yaml`-and-`{$hostname}.yaml`-files-to-Hiera), and [configure your node](#configuring-your-node).
Expand Down Expand Up @@ -365,6 +374,14 @@ The system package name for installing etcd

Defaults to `etcd-server`.

#### `etcd_hostname`

Specifies the name of the etcd instance.

A Hiera is `kubernetes::etcd_hostname:"%{::fqdn}"`.

Defaults to `$hostname`.

#### `etcd_ip`

Specifies the IP address etcd uses for communications.
Expand Down
8 changes: 2 additions & 6 deletions manifests/config/kubeadm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
String $etcdpeer_crt = $kubernetes::etcdpeer_crt,
String $etcdpeer_key = $kubernetes::etcdpeer_key,
Array $etcd_peers = $kubernetes::etcd_peers,
String $etcd_hostname = $kubernetes::etcd_hostname,
String $etcd_ip = $kubernetes::etcd_ip,
String $cni_pod_cidr = $kubernetes::cni_pod_cidr,
String $kube_api_advertise_address = $kubernetes::kube_api_advertise_address,
Expand Down Expand Up @@ -108,12 +109,6 @@
}
}
}
else {
$apiserver_merged_extra_arguments = $apiserver_extra_arguments
$apiserver_extra_volumes = {}
$controllermanager_merged_extra_arguments = []
$controllermanager_extra_volumes = {}
}

# to_yaml emits a complete YAML document, so we must remove the leading '---'
$kubeadm_extra_config_yaml = regsubst(to_yaml($kubeadm_extra_config), '^---\n', '')
Expand All @@ -122,6 +117,7 @@

$config_version = $kubernetes_version ? {
/1.1(0|1)/ => 'v1alpha1',
/1.1(3|4)/ => 'v1beta1',
default => 'v1alpha3',
}

Expand Down
1 change: 1 addition & 0 deletions manifests/config/worker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
$kubelet_extra_config_yaml = regsubst(to_yaml($kubelet_extra_config), '^---\n', '')

$template = $kubernetes_version ? {
/1.1(3|4)/ => 'v1beta1',
default => 'v1alpha3',
}

Expand Down
16 changes: 14 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#
# [*cni_network_provider*]
#
# The URL to get the cni providers yaml file.
# The URL to get the cni providers yaml file.
# Defaults to `undef`. `kube_tool` sets this value.
#
# [*cni_rbac_binding*]
Expand Down Expand Up @@ -107,7 +107,12 @@
# [*runc_source*]
# The URL to download runc
# Defaults to https://github.com/opencontainers/runc/releases/download/v${runc_version}/runc.amd64
#
#
# [*etcd_hostname*]
# The name of the etcd instance.
# An example with hiera would be kubernetes::etcd_hostname: "%{::fqdn}"
# Defaults to hostname
#
# [*etcd_ip*]
# The ip address that you want etcd to use for communications.
# An example with hiera would be kubernetes::etcd_ip: "%{::ipaddress_enp0s8}"
Expand Down Expand Up @@ -204,6 +209,10 @@
# This is a bool that determines if the kubernetes dashboard is installed.
# Defaults to false
#
# [*kubernetes_dashboard_url*]
# The URL to get the Kubernetes Dashboard yaml file.
# Defaults to the upstream source. `kube_tool` sets this value.
#
# [*dashboard_version*]
# The version of Kubernetes dashboard you want to install.
# Defaults to v1.10.1
Expand Down Expand Up @@ -360,6 +369,7 @@
Boolean $manage_etcd = true,
Optional[String] $kube_api_advertise_address = undef,
Optional[String] $etcd_version = '3.1.12',
Optional[String] $etcd_hostname = $facts['hostname'],
Optional[String] $etcd_ip = undef,
Optional[Array] $etcd_peers = undef,
Optional[String] $etcd_initial_cluster = undef,
Expand All @@ -376,6 +386,8 @@
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",
Boolean $schedule_on_controller = false,
Integer $api_server_count = undef,
String $kubernetes_ca_crt = undef,
Expand Down
3 changes: 2 additions & 1 deletion manifests/kube_addons.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Boolean $install_dashboard = $kubernetes::install_dashboard,
String $dashboard_version = $kubernetes::dashboard_version,
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 Down Expand Up @@ -45,7 +46,7 @@
}

if $install_dashboard {
$shellsafe_source = shell_escape("https://raw.githubusercontent.com/kubernetes/dashboard/${dashboard_version}/src/deploy/recommended/kubernetes-dashboard.yaml")
$shellsafe_source = shell_escape($kubernetes_dashboard_url)
exec { 'Install Kubernetes dashboard':
command => "kubectl apply -f ${shellsafe_source}",
onlyif => 'kubectl get nodes',
Expand Down
10 changes: 5 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-kubernetes",
"version": "3.4.0",
"version": "4.0.0",
"author": "Puppet",
"summary": "The module installs and configures a Kubernetes cluster",
"license": "Apache-2.0",
Expand All @@ -10,19 +10,19 @@
"dependencies": [
{
"name": "puppetlabs-stdlib",
"version_requirement": ">= 4.20.0 < 5.0.0"
"version_requirement": ">= 4.20.0 <= 5.2.0"
},
{
"name": "puppetlabs-apt",
"version_requirement": ">= 4.1.0 < 6.0.0"
"version_requirement": ">= 4.1.0 <= 6.3.0"
},
{
"name": "puppet-archive",
"version_requirement": ">= 2.0.0 < 3.1.0"
"version_requirement": ">= 2.0.0 <= 3.2.1"
},
{
"name": "puppetlabs-translate",
"version_requirement": ">= 0.0.1 < 1.1.0"
"version_requirement": ">= 0.0.1 <= 1.2.0"
},
{
"name": "herculesteam-augeasproviders_sysctl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@



"dry_run":{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"type": "Optional[String[1]]"
}
,

"field_manager":{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"type": "Optional[String[1]]"
Expand Down Expand Up @@ -65,6 +59,12 @@
"description": "",
"type": "Optional[String[1]]"
}
,

"dry_run":{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"type": "Optional[String[1]]"
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,50 @@



"dry_run":{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"apiversion":{
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"type": "Optional[String[1]]"
}
,

"field_manager":{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"kind":{
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"type": "Optional[String[1]]"
}
,

"pretty":{
"description": "If 'true', then the output is pretty printed.",
"metadata":{
"description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.",
"type": "Optional[String[1]]"
}
,

"apiversion":{
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"webhooks":{
"description": "Webhooks is a list of webhooks and the affected resources and operations.",
"type": "Optional[String[1]]"
}
,

"kind":{
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"body":{
"description": "",
"type": "Optional[String[1]]"
}
,

"metadata":{
"description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.",
"dry_run":{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"type": "Optional[String[1]]"
}
,

"webhooks":{
"description": "Webhooks is a list of webhooks and the affected resources and operations.",
"field_manager":{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"type": "Optional[String[1]]"
}
,

"body":{
"description": "",
"pretty":{
"description": "If 'true', then the output is pretty printed.",
"type": "Optional[String[1]]"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,56 +19,56 @@



"body":{
"metadata":{
"description": "",
"type": "Optional[String[1]]"
}
,

"field_manager":{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"spec":{
"description": "Spec describes how the user wants the resources to appear",
"type": "Optional[String[1]]"
}
,

"metadata":{
"description": "",
"apiversion":{
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"type": "Optional[String[1]]"
}
,

"spec":{
"description": "Spec describes how the user wants the resources to appear",
"kind":{
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"type": "Optional[String[1]]"
}
,

"dry_run":{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"field_manager":{
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
"type": "Optional[String[1]]"
}
,

"pretty":{
"description": "If 'true', then the output is pretty printed.",
"dry_run":{
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
"type": "Optional[String[1]]"
}
,

"apiversion":{
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources",
"pretty":{
"description": "If 'true', then the output is pretty printed.",
"type": "Optional[String[1]]"
}
,

"kind":{
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
"status":{
"description": "Status indicates the actual state of the CustomResourceDefinition",
"type": "Optional[String[1]]"
}
,

"status":{
"description": "Status indicates the actual state of the CustomResourceDefinition",
"body":{
"description": "",
"type": "Optional[String[1]]"
}

Expand Down
Loading