Thursday, May 19, 2022

20.04.1 Ubuntu: Wifi keep disconnecting

The powersaving option in the NetworkManager seems affect the system, disabling will stop the disconnection happen.


vi /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

[connection]

wifi.powersave = 2



where: 

# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).


See also:

https://gist.github.com/jcberthon/ea8cfe278998968ba7c5a95344bc8b55 

Thursday, April 21, 2022

Fedora Packaging + Vagrant + libvirt

https://github.com/dougsland/fedora-packaging

Fedora 35 + Vagrant

 sudo dnf install @vagrant
 sudo dnf install nfs-utils && sudo systemctl enable nfs-server
sudo firewall-cmd --permanent --zone=libvirt --add-service=nfs3 \
    && sudo firewall-cmd --permanent --zone=libvirt --add-service=nfs \
    && sudo firewall-cmd --permanent --zone=libvirt --add-service=rpc-bind \
    && sudo firewall-cmd --permanent --zone=libvirt --add-service=mountd \
    && sudo firewall-cmd --reload
sudo visudo
# Allow Vagrant to manage /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status --no-pager nfs-server.service
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /*/exports
Cmnd_Alias VAGRANT_EXPORTS_REMOVE_2 = /bin/cp /*/exports /etc/exports
%vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE, VAGRANT_EXPORTS_REMOVE_2
sudo getent group vagrant >/dev/null || sudo groupadd -r vagrant
sudo gpasswd -a ${USER} vagrant
sudo -u ${USER} ${SHELL}

https://developer.fedoraproject.org/tools/vagrant/vagrant-libvirt.html

https://developer.fedoraproject.org/tools/vagrant/vagrant-nfs.html

Friday, October 8, 2021

kubernetes + helm + redis

kubectl create ns redis

helm install redis --set global.storageClass=MY_STORAGE_CLASS bitnami/redis -n redis


export REDIS_PASSWORD=$(kubectl get secret --namespace redis redis -o jsonpath="{.data.redis-password}" | base64 --decode)


kubectl run --namespace redis redis-client --restart='Never'  --env REDIS_PASSWORD=$REDIS_PASSWORD  --image docker.io/bitnami/redis:6.2.5-debian-10-r63 --command -- sleep infinity


kubectl exec --tty -i redis-client --namespace redis -- bash

$ redis-cli -h redis-master -a $REDIS_PASSWORD

Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.

redis-master:6379> ping

PONG

redis-master:6379> 


Sunday, May 2, 2021

github actions and golang 1.16 or higher - no required module provides package - working directory is not part of a module.

In your environment your app might work out of the box for go 1.16.x but github actions it might say:
main.go:20:2: no required module provides package github.com/myuser/project/pkg/deployment: working directory is not part of a module.

In go lang 1.16 GO111COMPILE is on by default which means the packages will be stored via GOPATH/go/pkg or for example /home/foobar/go/pkg/github.com/mypackagelibrary. To make it work via github actions use:

jobs:

  my-job-name:

    runs-on: [ ubuntu-18.04 ]

    env:

      GOPATH: /home/runner/work/MYPACKAGELIBRARYNAME/go

      GO111MODULE: auto


....

OR 

for every go command, including get, build, run add GO111MODULE=off in front, like GO111MODULE=off go get github.com/foobar && GO111MODULE=off go run main.go


Wednesday, March 10, 2021

building kubernetes: Fedora 33 and master kubernetes - requirement golang 1.16

$ dnf update   https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/noarch/golang-src-1.16-1.fc34.noarch.rpm --best --allowerasing

$  dnf install https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/x86_64/golang-1.16-1.fc34.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/x86_64/golang-bin-1.16-1.fc34.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/x86_64/golang-race-1.16-1.fc34.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/x86_64/golang-shared-1.16-1.fc34.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/noarch/golang-misc-1.16-1.fc34.noarch.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/noarch/golang-docs-1.16-1.fc34.noarch.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/noarch/golang-misc-1.16-1.fc34.noarch.rpm https://kojipkgs.fedoraproject.org//packages/golang/1.16/1.fc34/noarch/golang-tests-1.16-1.fc34.noarch.rpm


Monday, March 1, 2021

oVirt Driver to install Windows 2019 Server

1. Download oVirt Guest tools iso

https://resources.ovirt.org/pub/ovirt-4.3/iso/oVirt-toolsSetup/4.3-2/el7/oVirt-toolsSetup-4.3-2.el7.iso

2. Upload oVirtToolsSetup iso to your data/iso storage in the Cluster

3. Change the CD to oVirt Tools Setup

After booting the Windows installer, select the Virtual machine in the Admin portal and click ... and Change CD attach oVirt Tools Setup 4.3.2.

4. Re-attach Windows 2019 Server ISO

Attach again the windows ISO by selecting the Virtual machine in the Admin portal and click ... and Change CD attach Window Server 2019 ISO.


A good video explaining the process:

https://www.youtube.com/watch?v=m5Ud4RZI8bU&t=503s


Thursday, August 20, 2020

traefik: kubernetes service not found: xyz

Check if the removed application left the ingressroute behind.

$ kubectl delete ingressroute -n ${NAMESPACE} ${INGRESSROUTE_APP}

Tuesday, August 18, 2020

helm3: installing kubeapps over TLS

$ kubectl create ns kubeapps

$ helm install  kubeapps --namespace kubeapps bitnami/kubeapps \

  --set ingress.enabled=true \

  --set ingress.certManager=true \

  --set ingress.hosts[0].name=kubeapps.medogz.com \

  --set ingress.hosts[0].tls=true \

  --set ingress.hosts[0].tlsSecret=kubeapps-tls


2. Create the secret
$ kubectl -n default create secret tls kubeapps-tls -n kubeapps --key=/path/STAR_medogz_com.key --cert=/path/STAR_medogz_com.crt 

3. Get the token to access the kubeapps.medogz.com

$  kubectl get secret $(kubectl get serviceaccount kubeapps-operator -o jsonpath='{.secrets[].name}') -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' && echo


4. Access https:/kubeapps.medogz.com

NOTE: After the login, some images will load from external network and the site won't be accessed fully by TLS.