-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #545: Add salt states to install kubelet
- Loading branch information
1 parent
12d64c4
commit c43db5a
Showing
17 changed files
with
159 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Repositories informations | ||
repo: | ||
# Configure online repositories | ||
online_mode: True |
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,3 @@ | ||
base: | ||
'*': | ||
- repositories |
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,9 @@ | ||
include: | ||
- .installed | ||
|
||
Start and enable containerd: | ||
service.running: | ||
- name: containerd | ||
- enable: True | ||
- require: | ||
- pkg: Install containerd |
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,2 @@ | ||
include: | ||
- .configured |
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,24 @@ | ||
{%- from "containerd/map.jinja" import containerd with context %} | ||
{%- from "repo/map.jinja" import repo with context %} | ||
include: | ||
- repo | ||
- runc | ||
Install containerd: | ||
pkg.installed: | ||
- name: containerd | ||
- version: {{ containerd.version }} | ||
- fromrepo: {{ repo.containerd.name }} | ||
- require: | ||
- pkgrepo: Configure Kubernetes repository | ||
- pkg: Install runc | ||
Update container-selinux: | ||
pkg.installed: | ||
- name: container-selinux | ||
- sources: | ||
# TODO: Maybe something to specify link/version | ||
- container-selinux: https://buildlogs.centos.org/centos/7/virt/x86_64/container/container-selinux-2.77-1.el7.noarch.rpm | ||
- require: | ||
- pkg: Install containerd |
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,5 @@ | ||
{%- set containerd = salt['grains.filter_by']({ | ||
'Linux': { | ||
'version': 'latest' | ||
} | ||
}, grain='kernel', merge=salt['pillar.get']('containerd')) %} |
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,2 @@ | ||
include: | ||
- .installed |
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,21 @@ | ||
{%- from "kubelet/map.jinja" import kubelet with context %} | ||
{%- from "repo/map.jinja" import repo with context %} | ||
include: | ||
- repo | ||
# TODO: Maybe not needed in offline because embedded in the kubernetes repository | ||
Install kubelet dependencies: | ||
pkg.installed: | ||
- pkgs: | ||
- ebtables | ||
- socat | ||
- conntrack-tools | ||
Install kubelet: | ||
pkg.installed: | ||
- name: kubelet | ||
- version: {{ kubelet.version }} | ||
- fromrepo: {{ repo.kubernetes.name }} | ||
- require: | ||
- pkgrepo: Configure Kubernetes repository |
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,5 @@ | ||
{%- set kubelet = salt['grains.filter_by']({ | ||
'Linux': { | ||
'version': 'latest' | ||
} | ||
}, grain='kernel', merge=salt['pillar.get']('kubelet')) %} |
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,8 @@ | ||
{%- from "repo/map.jinja" import repo with context %} | ||
include: | ||
{%- if repo.online_mode %} | ||
- .online | ||
{%- else %} | ||
- .offline | ||
{%- endif %} |
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,2 @@ | ||
include: | ||
- .configured |
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,18 @@ | ||
{%- set defaults = salt['grains.filter_by']({ | ||
'Linux': { | ||
'online_mode': True | ||
} | ||
}, grain='kernel', merge=salt['pillar.get']('repo')) %} | ||
|
||
{%- set repo = salt['grains.filter_by']({ | ||
'RedHat': { | ||
'containerd': { | ||
'name': 'epel' | ||
}, | ||
'kubernetes': { | ||
'name': 'kubernetes' | ||
} | ||
}, | ||
'Debian': { | ||
} | ||
}, merge=defaults) %} |
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,3 @@ | ||
offline mode not yet implemented: | ||
test.fail_without_changes: | ||
- failhard: True |
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,36 @@ | ||
{%- from "repo/map.jinja" import repo with context %} | ||
{%- if grains["os_family"] == "RedHat" %} | ||
Configure EPEL repository: | ||
pkg.installed: | ||
{%- if grains["os"] == "CentOs" %} | ||
- name: epel-release | ||
{%- else %} | ||
- sources: | ||
- epel-release: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ grains['osmajorrelease'] }}.noarch.rpm | ||
{%- endif %} | ||
{%- if grains["os"] == "RedHat" %} | ||
check that the system is registered: | ||
cmd.run: | ||
- name: subscription-manager status | ||
{%- endif %} | ||
Configure Kubernetes repository: | ||
pkgrepo.managed: | ||
- name: {{ repo.kubernetes.name }} | ||
- humanname: Kubernetes | ||
- baseurl: "https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64" | ||
- gpgcheck: 1 | ||
- repo_gpg_check: 1 | ||
- gpgkey: "https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" | ||
- enabled: 0 | ||
{%- else %} | ||
{{ grains["os_family"] }} not supported, only RedHat based supported: | ||
test.fail_without_changes: | ||
- failhard: True | ||
{%- endif %} |
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,2 @@ | ||
include: | ||
- .installed |
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,10 @@ | ||
{% from "runc/map.jinja" import runc with context %} | ||
include: | ||
- repo | ||
# TODO: Add a fromrepo for offline | ||
Install runc: | ||
pkg.installed: | ||
- name: runc | ||
- version: {{ runc.version }} |
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,5 @@ | ||
{%- set runc = salt['grains.filter_by']({ | ||
'Linux': { | ||
'version': 'latest' | ||
} | ||
}, grain='kernel', merge=salt['pillar.get']('runc')) %} |