How to configure cgroup cpu quota for garden container running on ubuntu xenial - ubuntu-16.04

I am trying to configure cpu quota for a garden container running on Ubuntu Xenial like below.
echo 1000 > /sys/fs/cgroup/cpu/garden/cpu.cfs_quota_us
Earlier while using Ubuntu Trusty, we were able to configure the cpu quota for a garden container by editing below file.
echo 1000 > /sys/fs/cgroup/cpu/garden/<container_guid>/cpu.cfs_quota_us
Could someone help me in configuring cpu quota for a garden container on Ubuntu Xenial OS.

Related

Falco installation on Digital Ocean Kubernetes

While installing falco on Digital Ocean managed kubernetes. I am getting the following error
Runtime error: can't open BPF probe '/root/.falco/falco-bpf.o': Errno 2. Exiting. I know this is caused because the ebpf probe was not installed on the cluster nodes.
But when I try installing without the ebpf probe I get the following error
Unable to load the driver. Runtime error: error opening device /host/dev/falco0. Make sure you have root credentials and that the falco module is loaded.. Exiting.
We have to manually install falco and the drivers by sshing into the nodes. After that also we can install only without the ebpf probe, using the kernel module. Has anyone faced with the same issue? Is there any solution to this without doing ssh into the nodes?
Falco version: latest
System info: Worker node Debian 10 Linux kernel 5.10.0
Cloud provider or hardware configuration: 3 vCPU, 6GB Memory, 150 GB Disk
OS: Debian 10
Kernel: Linux 5.10.0
Installation method: from source

K3S on Raspberry Pi 4 - kubectl get pods runs into timeout

Problem
When I connect a k3s agent to the server and run "kubectl get nodes" on the server. I get the following error:
root#k3s-master:/home/marc# kubectl get nodes
Error from server (Timeout): the server was unable to return a response in the time allotted, but may still be processing the request (get nodes)
But if the server is standalone, I can easily run "kubectl get nodes".
CPU utilisation on the server stays about 30-40%. And RAM usage is at 583M of 3.74G.
Specs
2x Raspberry Pi 4b with 4GB RAM
Fresh install of raspbian lite (buster)
Enabled legacy iptables and cgroups
K3S Installation
On the server, I've done:
curl -sfL https://get.k3s.io | sh -
And on the agent:
curl -sfL https://get.k3s.io | K3S_URL=https://k3s-master:6443 K3S_TOKEN=<token> sh -
Thanks in advance, it drives me crazy!
Thanks to stack overflows related question feature, I've stumbled upon this question: PI4 k3s install server currently unable to handle the request
There seems to be an issue regarding cgroup memory failures with buster kernel 5.4.x
Edit
Adding the cgroup didnt helped, so I switched to Ubuntu 20.05 and its working now.

Error Starting Minikube on Ubuntu VM VirutalBox

I do have an Ubuntu VM in VirtualBox on Windows 10. If i follow the instructions to install Minikube I get a start error:
> minikube start &
[1] 4297
vagrant#ubuntu-xenial:~$ o minikube v0.35.0 on linux (amd64)
> Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
# Downloading Minikube ISO ...
184.42 MB / 184.42 MB [============================================] 100.00%
0s
! Unable to start VM: create: precreate: VBoxManage not found. Make sure
VirtualBox is installed and VBoxManage is in the path
Does it mean i need to install VirtualBox in the Ubuntu VM too? Kind of VB inside VB..
thanks
I'd recommend to install Minikube on your host OS (Windows) and use the already installed Virtual box as a hypervisor provider.
If for any reason you want to launch it on Ubuntu VM, there are two options:
I. Minikube supports a --vm-driver=none option that runs the Kubernetes components on the host and not in a VM. Using this driver requires Docker and a Linux environment, but not a hypervisor. In this case you have to provide an address to you local API server
`minikube start --vm-driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost`
And then go and edit ~/.kube/config, replacing the server IP that was
detected from the main network interface with "localhost". For example:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data:/home/asuh/.minikube/ca.crt
server: https://localhost:8443
name: minikube
II. Install VM Ware on Windows and run Ubuntu within installed Virtualbox
and and enabled VT-X/AMD-v in outer VM.
Regarding the error you have at the moment:
However now i get another error like: /usr/local/bin/minikube: cannot
execute binary file
Make sure you have installed a proper version of Minikube. For your Ubuntu VM it should be
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube
It is not recommended to use VM inside VM to run minikube. Check this answer. Try to run minikube with no vm drivers.
minikube start --vm-driver=none
I have read on minikube issues, but can not find it right now.
HTH

503 Service Temporarily Unavailable nginx/1.13.9 in jenkins x

I have created kubernetes cluster using minikube and installed Jenkins x on it.
I am not able to access the Jenkins x dashboard.
Error 503 Service Temporarily Unavailable nginx/1.13.9.
note: I have tried with restarting minikube cluster also.
As mentioned by James Rawlings in the comments, it's likely to be a resource issue. The recommendations in the manual are:
A known good configuration on a 2015 model Macbook Pro is to use 8 GB of RAM, 8 cores, a 150 GB disk size and hyperkit.
The disk size is particularly large as a number of images will need to be downloaded.
So we highly recommend using one of the public clouds above to try out Jenkins X. They all have free tiers so it should not cost you any significant cash and it’ll give you a chance to try out the cloud.
Default minikube installation uses only 2048 MB of RAM, 2 CPU cores and 20Gb disk space. You can adjust minikube VM size using command line options:
$ minikube start --cpus=8 --memory=8192 --disk-size=150g --vm-driver=hyperkit
or use jx tool for that:
For MacOS
$ brew install docker-machine-driver-hyperkit
# docker-machine-driver-hyperkit need root owner and uid
$ sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
$ sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
$ brew tap jenkins-x/jx
$ brew install jx
$ jx create cluster minikube
For linux:
$ curl -L https://github.com/jenkins-x/jx/releases/download/v1.3.784/jx-linux-amd64.tar.gz | tar xzv
$ sudo mv jx /usr/local/bin
$ jx create cluster minikube

Can't Install Kubernetes on Ubuntu 16.04

I have tried to install Kubernetes on 3 separate Ubuntu 16.04 machines, with poor results. On all three machines, the recommended installation, using snap and conjure-up did not work:
gknight#pz1:~$ sudo snap install conjure-up --classic
[sudo] password for gknight:
gknight#pz1:~$ sudo reboot
gknight#pz1:~$ conjure-up kubernetes
dropping privs did not work
This is the snap version:
gknight#pz1:~$ snap --version
snap 2.33.1ubuntu2
snapd 2.33.1ubuntu2
series 16
ubuntu 16.04
kernel 4.4.0-130-generic
On two, local, machines, the repository method worked:
sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add
add the following to sources.list.d, as kubernetes.list:
deb http://apt.kubernetes.io/ kubernetes-xenial main
apt-get update
apt-get install -y kubelet kubeadm kubectl kubernetes-cni
But, on a remote 512mb KVM VPS (PnZ Hosting), although Docker installs and runs just fine, when I install kubelet, etc. and do nothing else, it soon runs the uptime load average up to 12 or so, and I can barely get through to it to reboot. There are no obvious error messages (and swap is turned off).
So, does the "conjure-up" method work on any Ubuntu 16.04 today?
What is Kubernetes doing that's taking over the KVM machine?
Finally, is there any other way to install Kubernetes?
remote 512mb KVM VPS
That's almost certainly the problem, as I don't know of very much software nowadays that will run in that little memory. It matches your experience that the machine will start swapping like mad, driving the I/O pressure through the roof
Agree with #Matthew & #Michael - 512mb is not enough to run Kubernetes.
Increase your memory up to 1GB min and retry.
Apiserver and etcd together are fine on a machine with 1 core and 1GB
RAM for clusters with 10s of nodes.
You can read more documentation here.
Conjure method works fine for me using this instruction.
Ubuntu version:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Ways to install Kubernetes:
Local Kubernetes development with LXD
Running Kubernetes Locally via Minikube
Using kubeadm
Use prepared cloud solutions, for example Google Kubernetes Engine, Amazon EKS or many many others.