mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #26174 from derekwaynecarr/enable_vagrant_accounting
Enable CPU and Memory accounting on vagrant cluster
This commit is contained in:
commit
1ec7fd4e1e
@ -64,6 +64,7 @@ done
|
|||||||
echo "127.0.0.1 localhost" >> /etc/hosts # enables cmds like 'kubectl get pods' on master.
|
echo "127.0.0.1 localhost" >> /etc/hosts # enables cmds like 'kubectl get pods' on master.
|
||||||
echo "$MASTER_IP $MASTER_NAME" >> /etc/hosts
|
echo "$MASTER_IP $MASTER_NAME" >> /etc/hosts
|
||||||
|
|
||||||
|
enable-accounting
|
||||||
prepare-package-manager
|
prepare-package-manager
|
||||||
|
|
||||||
# Configure the master network
|
# Configure the master network
|
||||||
@ -118,8 +119,7 @@ if ! which /usr/libexec/cockpit-ws &>/dev/null; then
|
|||||||
|
|
||||||
pushd /etc/yum.repos.d
|
pushd /etc/yum.repos.d
|
||||||
curl -OL https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/repo/fedora-23/msuchy-cockpit-preview-fedora-23.repo
|
curl -OL https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/repo/fedora-23/msuchy-cockpit-preview-fedora-23.repo
|
||||||
dnf install -y cockpit cockpit-kubernetes socat ethtool
|
dnf install -y cockpit cockpit-kubernetes docker socat ethtool
|
||||||
dnf update -y docker
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
systemctl enable cockpit.socket
|
systemctl enable cockpit.socket
|
||||||
|
@ -59,6 +59,7 @@ for (( i=0; i<${#NODE_NAMES[@]}; i++)); do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
enable-accounting
|
||||||
prepare-package-manager
|
prepare-package-manager
|
||||||
|
|
||||||
# Configure network
|
# Configure network
|
||||||
|
@ -14,15 +14,21 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
function enable-accounting() {
|
||||||
|
mkdir -p /etc/systemd/system.conf.d/
|
||||||
|
cat <<EOF >/etc/systemd/system.conf.d/kubernetes-accounting.conf
|
||||||
|
[Manager]
|
||||||
|
DefaultCPUAccounting=yes
|
||||||
|
DefaultMemoryAccounting=yes
|
||||||
|
EOF
|
||||||
|
systemctl daemon-reload
|
||||||
|
}
|
||||||
|
|
||||||
function prepare-package-manager() {
|
function prepare-package-manager() {
|
||||||
echo "Prepare package manager"
|
echo "Prepare package manager"
|
||||||
|
|
||||||
# Useful if a mirror is broken or slow
|
# Useful if a mirror is broken or slow
|
||||||
echo "fastestmirror=True" >> /etc/dnf/dnf.conf
|
echo "fastestmirror=True" >> /etc/dnf/dnf.conf
|
||||||
|
|
||||||
# In Fedora 23, installed version does not work with Salt
|
|
||||||
# Cf. https://github.com/saltstack/salt/issues/31001
|
|
||||||
dnf update -y dnf dnf-plugins-core
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -113,8 +119,10 @@ function install-salt() {
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
if ! which salt-call >/dev/null 2>&1; then
|
if ! which salt-call >/dev/null 2>&1; then
|
||||||
# Install salt binaries
|
# Install salt from official repositories.
|
||||||
curl -sS -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s
|
# Need to enable testing-repos to get version of salt with fix for dnf-core-plugins
|
||||||
|
dnf config-manager --set-enabled updates-testing
|
||||||
|
dnf install -y salt-minion
|
||||||
|
|
||||||
# Fedora >= 23 includes salt packages but the bootstrap is
|
# Fedora >= 23 includes salt packages but the bootstrap is
|
||||||
# creating configuration for a (non-existent) salt repo anyway.
|
# creating configuration for a (non-existent) salt repo anyway.
|
||||||
|
Loading…
Reference in New Issue
Block a user