Skip to content

Commit

Permalink
Merge pull request #57 from ananace/update-registry
Browse files Browse the repository at this point in the history
Update container references to active registry
  • Loading branch information
ananace authored Jul 5, 2023
2 parents 692d63f + e201208 commit 0474d93
Show file tree
Hide file tree
Showing 11 changed files with 193 additions and 26 deletions.
168 changes: 156 additions & 12 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ The following parameters are available in the `k8s` class:
* [`version`](#-k8s--version)
* [`etcd_version`](#-k8s--etcd_version)
* [`container_registry`](#-k8s--container_registry)
* [`container_image`](#-k8s--container_image)
* [`container_image_tag`](#-k8s--container_image_tag)
* [`container_manager`](#-k8s--container_manager)
* [`container_runtime_service`](#-k8s--container_runtime_service)
Expand Down Expand Up @@ -243,19 +242,11 @@ Data type: `String[1]`



Default value: `'gcr.io/google_containers'`

##### <a name="-k8s--container_image"></a>`container_image`

Data type: `String[1]`



Default value: `'hyperkube'`
Default value: `'registry.k8s.io'`

##### <a name="-k8s--container_image_tag"></a>`container_image_tag`

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



Expand Down Expand Up @@ -1562,6 +1553,9 @@ The following parameters are available in the `k8s::server::apiserver` class:
* [`service_cluster_cidr`](#-k8s--server--apiserver--service_cluster_cidr)
* [`serviceaccount_private`](#-k8s--server--apiserver--serviceaccount_private)
* [`serviceaccount_public`](#-k8s--server--apiserver--serviceaccount_public)
* [`container_registry`](#-k8s--server--apiserver--container_registry)
* [`container_image`](#-k8s--server--apiserver--container_image)
* [`container_image_tag`](#-k8s--server--apiserver--container_image_tag)

##### <a name="-k8s--server--apiserver--advertise_address"></a>`advertise_address`

Expand Down Expand Up @@ -1755,6 +1749,30 @@ Data type: `Stdlib::Unixpath`

Default value: `"${cert_path}/service-account.pub"`

##### <a name="-k8s--server--apiserver--container_registry"></a>`container_registry`

Data type: `String[1]`



Default value: `$k8s::container_registry`

##### <a name="-k8s--server--apiserver--container_image"></a>`container_image`

Data type: `String[1]`



Default value: `'kube-apiserver'`

##### <a name="-k8s--server--apiserver--container_image_tag"></a>`container_image_tag`

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



Default value: `$k8s::container_image_tag`

### <a name="k8s--server--controller_manager"></a>`k8s::server::controller_manager`

Installs and configures a Kubernetes controller manager
Expand All @@ -1773,6 +1791,9 @@ The following parameters are available in the `k8s::server::controller_manager`
* [`ca_key`](#-k8s--server--controller_manager--ca_key)
* [`cert`](#-k8s--server--controller_manager--cert)
* [`key`](#-k8s--server--controller_manager--key)
* [`container_registry`](#-k8s--server--controller_manager--container_registry)
* [`container_image`](#-k8s--server--controller_manager--container_image)
* [`container_image_tag`](#-k8s--server--controller_manager--container_image_tag)

##### <a name="-k8s--server--controller_manager--ensure"></a>`ensure`

Expand Down Expand Up @@ -1854,6 +1875,30 @@ Data type: `Stdlib::Unixpath`

Default value: `"${cert_path}/kube-controller-manager.key"`

##### <a name="-k8s--server--controller_manager--container_registry"></a>`container_registry`

Data type: `String[1]`



Default value: `$k8s::container_registry`

##### <a name="-k8s--server--controller_manager--container_image"></a>`container_image`

Data type: `String[1]`



Default value: `'kube-controller-manager'`

##### <a name="-k8s--server--controller_manager--container_image_tag"></a>`container_image_tag`

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



Default value: `$k8s::container_image_tag`

### <a name="k8s--server--etcd"></a>`k8s::server::etcd`

Sets up an etcd cluster node
Expand Down Expand Up @@ -2359,15 +2404,19 @@ The following parameters are available in the `k8s::server::resources` class:
* [`manage_coredns`](#-k8s--server--resources--manage_coredns)
* [`manage_flannel`](#-k8s--server--resources--manage_flannel)
* [`manage_kube_proxy`](#-k8s--server--resources--manage_kube_proxy)
* [`kube_proxy_registry`](#-k8s--server--resources--kube_proxy_registry)
* [`kube_proxy_image`](#-k8s--server--resources--kube_proxy_image)
* [`kube_proxy_tag`](#-k8s--server--resources--kube_proxy_tag)
* [`kube_proxy_daemonset_config`](#-k8s--server--resources--kube_proxy_daemonset_config)
* [`extra_kube_proxy_args`](#-k8s--server--resources--extra_kube_proxy_args)
* [`coredns_registry`](#-k8s--server--resources--coredns_registry)
* [`coredns_image`](#-k8s--server--resources--coredns_image)
* [`coredns_tag`](#-k8s--server--resources--coredns_tag)
* [`coredns_deployment_config`](#-k8s--server--resources--coredns_deployment_config)
* [`flannel_cni_registry`](#-k8s--server--resources--flannel_cni_registry)
* [`flannel_cni_image`](#-k8s--server--resources--flannel_cni_image)
* [`flannel_cni_tag`](#-k8s--server--resources--flannel_cni_tag)
* [`flannel_registry`](#-k8s--server--resources--flannel_registry)
* [`flannel_image`](#-k8s--server--resources--flannel_image)
* [`flannel_tag`](#-k8s--server--resources--flannel_tag)
* [`flannel_daemonset_config`](#-k8s--server--resources--flannel_daemonset_config)
Expand Down Expand Up @@ -2460,13 +2509,21 @@ Data type: `K8s::Proxy_method`

Default value: `$k8s::manage_kube_proxy`

##### <a name="-k8s--server--resources--kube_proxy_registry"></a>`kube_proxy_registry`

Data type: `String[1]`



Default value: `$k8s::container_registry`

##### <a name="-k8s--server--resources--kube_proxy_image"></a>`kube_proxy_image`

Data type: `String[1]`



Default value: `'k8s.gcr.io/kube-proxy'`
Default value: `'kube-proxy'`

##### <a name="-k8s--server--resources--kube_proxy_tag"></a>`kube_proxy_tag`

Expand All @@ -2492,6 +2549,14 @@ Data type: `Hash[String,Data]`

Default value: `{}`

##### <a name="-k8s--server--resources--coredns_registry"></a>`coredns_registry`

Data type: `String[1]`



Default value: `'docker.io'`

##### <a name="-k8s--server--resources--coredns_image"></a>`coredns_image`

Data type: `String[1]`
Expand All @@ -2516,6 +2581,14 @@ Data type: `Hash[String,Data]`

Default value: `{}`

##### <a name="-k8s--server--resources--flannel_cni_registry"></a>`flannel_cni_registry`

Data type: `String[1]`



Default value: `'docker.io'`

##### <a name="-k8s--server--resources--flannel_cni_image"></a>`flannel_cni_image`

Data type: `String[1]`
Expand All @@ -2532,6 +2605,14 @@ Data type: `String[1]`

Default value: `'v1.0.0'`

##### <a name="-k8s--server--resources--flannel_registry"></a>`flannel_registry`

Data type: `String[1]`



Default value: `'docker.io'`

##### <a name="-k8s--server--resources--flannel_image"></a>`flannel_image`

Data type: `String[1]`
Expand Down Expand Up @@ -2611,6 +2692,7 @@ Generates and deploys the default CoreDNS DNS provider for Kubernetes
The following parameters are available in the `k8s::server::resources::coredns` class:

* [`dns_service_address`](#-k8s--server--resources--coredns--dns_service_address)
* [`registry`](#-k8s--server--resources--coredns--registry)
* [`image`](#-k8s--server--resources--coredns--image)
* [`image_tag`](#-k8s--server--resources--coredns--image_tag)
* [`deployment_config`](#-k8s--server--resources--coredns--deployment_config)
Expand All @@ -2628,6 +2710,14 @@ The address for the DNS service

Default value: `$k8s::server::resources::dns_service_address`

##### <a name="-k8s--server--resources--coredns--registry"></a>`registry`

Data type: `String[1]`

The CoreDNS image registry to use

Default value: `$k8s::server::resources::coredns_registry`

##### <a name="-k8s--server--resources--coredns--image"></a>`image`

Data type: `String[1]`
Expand Down Expand Up @@ -2701,8 +2791,10 @@ Generates and deploys the default CoreDNS DNS provider for Kubernetes
The following parameters are available in the `k8s::server::resources::flannel` class:

* [`cluster_cidr`](#-k8s--server--resources--flannel--cluster_cidr)
* [`cni_registry`](#-k8s--server--resources--flannel--cni_registry)
* [`cni_image`](#-k8s--server--resources--flannel--cni_image)
* [`cni_image_tag`](#-k8s--server--resources--flannel--cni_image_tag)
* [`registry`](#-k8s--server--resources--flannel--registry)
* [`image`](#-k8s--server--resources--flannel--image)
* [`image_tag`](#-k8s--server--resources--flannel--image_tag)
* [`daemonset_config`](#-k8s--server--resources--flannel--daemonset_config)
Expand All @@ -2719,6 +2811,14 @@ The internal cluster CIDR to proxy for

Default value: `$k8s::server::resources::cluster_cidr`

##### <a name="-k8s--server--resources--flannel--cni_registry"></a>`cni_registry`

Data type: `String[1]`

The Flannel CNI plugin image registry to use

Default value: `$k8s::server::resources::flannel_cni_registry`

##### <a name="-k8s--server--resources--flannel--cni_image"></a>`cni_image`

Data type: `String[1]`
Expand All @@ -2735,6 +2835,14 @@ The Flannel CNI plugin image tag to use

Default value: `$k8s::server::resources::flannel_cni_tag`

##### <a name="-k8s--server--resources--flannel--registry"></a>`registry`

Data type: `String[1]`

The Flannel image registry to use

Default value: `$k8s::server::resources::flannel_registry`

##### <a name="-k8s--server--resources--flannel--image"></a>`image`

Data type: `String[1]`
Expand Down Expand Up @@ -2800,6 +2908,7 @@ Generates and deploys the default kube-proxy service for Kubernetes
The following parameters are available in the `k8s::server::resources::kube_proxy` class:

* [`cluster_cidr`](#-k8s--server--resources--kube_proxy--cluster_cidr)
* [`registry`](#-k8s--server--resources--kube_proxy--registry)
* [`image`](#-k8s--server--resources--kube_proxy--image)
* [`image_tag`](#-k8s--server--resources--kube_proxy--image_tag)
* [`daemonset_config`](#-k8s--server--resources--kube_proxy--daemonset_config)
Expand All @@ -2817,6 +2926,14 @@ The internal cluster CIDR to proxy for

Default value: `$k8s::server::resources::cluster_cidr`

##### <a name="-k8s--server--resources--kube_proxy--registry"></a>`registry`

Data type: `String[1]`

The kube-proxy image registry to use

Default value: `$k8s::server::resources::kube_proxy_registry`

##### <a name="-k8s--server--resources--kube_proxy--image"></a>`image`

Data type: `String[1]`
Expand Down Expand Up @@ -2896,6 +3013,9 @@ The following parameters are available in the `k8s::server::scheduler` class:
* [`ca_cert`](#-k8s--server--scheduler--ca_cert)
* [`cert`](#-k8s--server--scheduler--cert)
* [`key`](#-k8s--server--scheduler--key)
* [`container_registry`](#-k8s--server--scheduler--container_registry)
* [`container_image`](#-k8s--server--scheduler--container_image)
* [`container_image_tag`](#-k8s--server--scheduler--container_image_tag)

##### <a name="-k8s--server--scheduler--ensure"></a>`ensure`

Expand Down Expand Up @@ -2953,6 +3073,30 @@ Data type: `Stdlib::Unixpath`

Default value: `"${cert_path}/kube-scheduler.key"`

##### <a name="-k8s--server--scheduler--container_registry"></a>`container_registry`

Data type: `String[1]`



Default value: `$k8s::container_registry`

##### <a name="-k8s--server--scheduler--container_image"></a>`container_image`

Data type: `String[1]`



Default value: `'kube-scheduler'`

##### <a name="-k8s--server--scheduler--container_image_tag"></a>`container_image_tag`

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



Default value: `$k8s::container_image_tag`

### <a name="k8s--server--tls"></a>`k8s::server::tls`

Generates the necessary Kubernetes certificates for a server
Expand Down
5 changes: 2 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
String[1] $version = '1.26.1',
String[1] $etcd_version = '3.5.1',

String[1] $container_registry = 'gcr.io/google_containers',
String[1] $container_image = 'hyperkube',
Optional[String] $container_image_tag = undef,
String[1] $container_registry = 'registry.k8s.io',
Optional[String[1]] $container_image_tag = undef,

K8s::Container_runtimes $container_manager = 'crio',
String[1] $container_runtime_service = "${container_manager}.service",
Expand Down
6 changes: 5 additions & 1 deletion manifests/server/apiserver.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
Stdlib::Unixpath $etcd_cert = "${cert_path}/etcd.pem",
Stdlib::Unixpath $etcd_key = "${cert_path}/etcd.key",

String[1] $container_registry = $k8s::container_registry,
String[1] $container_image = 'kube-apiserver',
Optional[String[1]] $container_image_tag = $k8s::container_image_tag,

Stdlib::IP::Address::Nosubnet $advertise_address = fact('networking.ip'),
Optional[K8s::Firewall] $firewall_type = $k8s::server::firewall_type,
String[1] $etcd_cluster_name = $k8s::server::etcd_cluster_name,
Expand Down Expand Up @@ -152,7 +156,7 @@
} + $_discovery + $_addn_args + $_service_account + $arguments)

if $k8s::packaging == 'container' {
$_image = "${k8s::container_registry}/${k8s::container_image}:${pick($k8s::container_image_tag, $k8s::version)}"
$_image = "${container_registry}/${container_image}:${pick($container_image_tag, "v${k8s::version}")}"
file { '/etc/kubernetes/manifests/kube-apiserver.yaml':
ensure => $ensure,
content => to_yaml({
Expand Down
6 changes: 5 additions & 1 deletion manifests/server/controller_manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
Stdlib::Unixpath $ca_key = $k8s::server::tls::ca_key,
Stdlib::Unixpath $cert = "${cert_path}/kube-controller-manager.pem",
Stdlib::Unixpath $key = "${cert_path}/kube-controller-manager.key",

String[1] $container_registry = $k8s::container_registry,
String[1] $container_image = 'kube-controller-manager',
Optional[String[1]] $container_image_tag = $k8s::container_image_tag,
) {
assert_private()

Expand Down Expand Up @@ -50,7 +54,7 @@

if $k8s::packaging == 'container' {
fail('Not implemented yet')
$_image = "${k8s::container_registry}/${k8s::container_image}:${pick($k8s::container_image_tag, $k8s::version)}"
$_image = "${container_registry}/${container_image}:${pick($container_image_tag, "v${k8s::version}")}"
kubectl_apply { 'kube-controller-manager':
kubeconfig => '/root/.kube/config',
api_version => 'apps/v1',
Expand Down
Loading

0 comments on commit 0474d93

Please sign in to comment.