-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split actionable code from parameter definitions
- Loading branch information
Showing
12 changed files
with
174 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
--- | ||
k8s::version: 1.26.1 | ||
k8s::etcd_version: 3.5.1 | ||
k8s::sysconfig_path: '/etc/sysconfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# @summary Sets up common Kubernetes components - users/groups/folders/etc | ||
class k8s::common { | ||
group { $k8s::group: | ||
ensure => present, | ||
system => true, | ||
gid => $k8s::gid, | ||
} | ||
|
||
user { $k8s::user: | ||
ensure => present, | ||
comment => 'Kubernetes user', | ||
gid => $k8s::group, | ||
home => '/srv/kubernetes', | ||
managehome => false, | ||
shell => (fact('os.family') ? { | ||
'Debian' => '/usr/sbin/nologin', | ||
default => '/sbin/nologin', | ||
}), | ||
system => true, | ||
uid => $k8s::uid, | ||
} | ||
|
||
file { | ||
default: | ||
ensure => directory, | ||
force => true, | ||
purge => true, | ||
recurse => true; | ||
|
||
'/opt/k8s': ; | ||
'/opt/k8s/bin': ; | ||
} | ||
|
||
file { '/var/run/kubernetes': | ||
ensure => directory, | ||
owner => $k8s::user, | ||
group => $k8s::group, | ||
} | ||
|
||
file { "${k8s::sysconfig_path}/kube-common": | ||
ensure => file, | ||
content => epp('k8s/sysconfig.epp', { | ||
comment => 'General Kubernetes Configuration', | ||
environment_variables => { | ||
'KUBE_LOG_LEVEL' => '', | ||
}, | ||
}), | ||
} | ||
|
||
file { | ||
default: | ||
ensure => directory; | ||
|
||
'/etc/kubernetes': ; | ||
'/etc/kubernetes/certs': ; | ||
'/etc/kubernetes/manifests': | ||
purge => $k8s::purge_manifests, | ||
recurse => true; | ||
'/root/.kube': ; | ||
'/srv/kubernetes': | ||
owner => $k8s::user, | ||
group => $k8s::group; | ||
'/usr/libexec/kubernetes': ; | ||
'/var/lib/kubelet': ; | ||
'/var/lib/kubelet/pki': ; | ||
|
||
'/usr/share/containers/': ; | ||
'/usr/share/containers/oci/': ; | ||
'/usr/share/containers/oci/hooks.d': ; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,7 @@ | |
} | ||
|
||
if $manage_repo { | ||
include k8s::repo | ||
Class['k8s::repo'] -> Package['k8s container manager'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.