Defined Type: k8s::package

Defined in:
modules/k8s/manifests/package.pp

Overview

SPDX-License-Identifier: Apache-2.0

This define can be used to install a package for a specific kubernetes version from our internal apt repository.

Parameters:

  • package (Enum['master', 'node', 'client'])
  • version (K8s::KubernetesVersion)
  • distro (String) (defaults to: "${::lsbdistcodename}-wikimedia")
  • uri (Stdlib::HTTPUrl) (defaults to: 'http://apt.wikimedia.org/wikimedia')
  • priority (Integer) (defaults to: 1001)
  • ensure_packages (Boolean) (defaults to: true)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'modules/k8s/manifests/package.pp', line 6

define k8s::package (
    Enum['master', 'node', 'client'] $package,
    K8s::KubernetesVersion           $version,
    String                           $distro          = "${::lsbdistcodename}-wikimedia",
    Stdlib::HTTPUrl                  $uri             = 'http://apt.wikimedia.org/wikimedia',
    Integer                          $priority        = 1001,
    Boolean                          $ensure_packages = true,
) {
    require k8s::base_dirs
    $component_title = "kubernetes${regsubst($version, '\\.', '')}"
    ensure_resource('apt::package_from_component', $component_title, {
        component => "component/${component_title}",
        packages  => [],
    })
    ensure_packages("kubernetes-${package}", {
        'require' => Apt::Package_from_component[$component_title],
    })
}