Categories
Uncategorized

no cached repository for helm-manager- found. (try ‘helm repo update’)

If you hit this error at the beginning of 2020 most probably you do have dependency in your chart that points to deprecated repo.

You must updated URI in charts.yaml (or requirements.yaml)

NameOld LocationNew Location
stablehttps://kubernetes-charts.storage.googleapis.comhttps://charts.helm.sh/stable
incubatorhttps://kubernetes-charts-incubator.storage.googleapis.comhttps://charts.helm.sh/incubator

Reference: https://helm.sh/blog/new-location-stable-incubator-charts/

Categories
Uncategorized

Kubernetes namespace stuck at “terminating”

Most of the time you do not want to simply force deletion of given namespace. If there are some resources hanging you do want to clean them up first. Especially if you share your cluster with other teams. Why?

Imagine you will force delete your namespace (meaning someone else will be able to create namespace with such name). They might gain access to leftovers you did not bother to clean.

Ok how to find leftovers that blocks namespace from deletion?

kubectl api-resources  --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n $namespace

Inspect each case one by one.

Sometimes that problems comes from buggy kubernetes package. For instance Percona Helm charts is always giving me that problem which is also reported in theirs jira.

Categories
Uncategorized

javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request

After bumping to latest docker (19.03.12) or minikube (0.12.1) you might quickly realise that you cannot push images from under maven build lifecycle.

This is because docker guys bumped go lang dependency which by default is using TLS 1.3

Either add

-Djdk.tls.client.protocols=TLSv1.2

to your java / maven command line or update your java to the very latest as this is fixed in every major java version now.

https://github.com/golang/go/issues/35722

https://bugs.openjdk.java.net/browse/JDK-8236039

Also it might be great opportunity to learn about TLS 1.3.. the biggest improvement is reducing handshake time. Are you microservices talking to each other using latest TLS.. by default currently it’s rather unlikely and the change could greatly improve your integration test time, not to say about waiting time of your users.

Categories
aws Uncategorized

Aws cost savings tip#1

This will start series of blog posts about cost savings on Amazon. There are many typical mistakes that everyone is making, quick wins action that you can take to save some costs both for big scale and small scale deployments.

When you migrate to the cloud most probably you will be using Ec2 and RDS databases. Whole my private project code base relies on Spring boot + JPA + mysql8.. adapting this to other storage type would cause that I am more dependent on Amazon which I do not want. And also I would need seriously change not only DAO layer, but the way I model my data.. a bit to much..

My db size is around 10 gigabytes.. average utilisation is low I stop db over night using cloud custodian so I mostly pay for the storage.

I already know that if I was using google cloud I would switch to kubernetes and install mysql db myself… then I would be paying for tiny computing power and a bit of storage… on Amazon RDS service includes automated backups (which are super convenient), possibility to have multi AZ database (which I do not need)… but for now.. I will stick to Amazon.. what can I do?

Recently I learned that after switching from mysql 5 to mysql 8 default character encoding changed..

In mysql5 it was called utf8 which could not cope with any character (yes – surprise!). In mysql8 it’s called utf8mb4 which is a real utf, but it’s size. is 4 bytes for each character.

In practice the difference is neglectable. Old utf8 takes 3 bytes per character and the only characters it could have issues with are some emoticons data. It’s unlikely that it could cause you a problem unless you are developing application for many users and you do want to allow users to store emoticons in – let’s say blog comments..

Anyway.. if you migrate your db from mysql5 to 8 expect your database size, snapshots increase in worst case by 33% (from 3 bytes per character to 4 bytes).
That includes also traffic between db and application..

In my app most of my data are just numbers so that experiment will not affect me much. But other tables mostly contains names that are could be just plain ascii. I do not store any input from users… sounds like a place for a improvement…

There are default settings for character sets and collations at four levels: server, database, table, and column.

https://dev.mysql.com/doc/refman/8.0/en/charset-syntax.html

To change default character set you can use :

ALTER TABLE t CHARACTER SET ascii;

but this does not convert existing data values.. for that you need to execute:

ALTER TABLE t CONVERT TO CHARACTER SET ascii;

After that.. my database was smaller by 10% and my storage costs dropped by 10% as well.

Ok and do we have any drawbacks? If you really know that your table and application usage will not be hurt by using ascii, latin or old utf8 character then no. If you want to introduce the change only to some tables then bare in mind that if you want to join let’s say “sessionId” from one table which is ascii and with second table where it is utf8 such join is not sagrable (indexes won’t be used) check here https://stackoverflow.com/questions/799584/what-makes-a-sql-statement-sargable

So as always.. you need to decide, experiment and check.

Interesting comparison of impact on character set and collaction across mysql 5 and 8 is here
https://www.percona.com/blog/2019/02/27/charset-and-collation-settings-impact-on-mysql-performance/

Bear in mind that the default utf8mb4 is there for a reason.. using that character you will not have any issues when storing data from many sources.. be it users or web scrapping data… Think about optimizations only if you have a use case for that (terrabytes of data for instance!)

Categories
Uncategorized

Ubuntu 16.04 custom kernel and latest Virtualbox

Due to some reason I had to go with 48 kernel and not 4.4 default one.
After some time I realized that my virtualbox is no longer working… This is one of nice things with Ubuntu.. It works all together flawlessly until you start messing with it (for instance when you need latest software and latest software usually has dependencies on some other latest software).
So for Kernel 4.8 you need Virtualbox 5.1 to install it quickly

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-5.1
Categories
Uncategorized

Public key for jenkins is not installed

Just do:

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

sudo yum install jenkins

Categories
Uncategorized

Sun comercials

Categories
Uncategorized

How to action menu entry in Dolphin.

Peace of simple  functionality I’ve been lacking for some time in dolphin was “send to ” option which would create an email with attached file(s). I have no idea why it does not exists “out of box” but there is quite simple way of adding this.

This descriptions applies to KDE4.
/usr/share/kde4/services/ServiceMenus

contains list of actions avaiable in Dolphin for various file types.
If you add file there an entry will appear in Dolphin (Settings -> Configure Dolphin, Services)
In order to Dolphin re-read content of this dir you have to change something in that windows (check and uncheck any selectbox and press apply).

Ok. create email.desktop in mentioned dir:

[Desktop Entry]
Actions=attachToEmail
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory
Type=Service

[Desktop Action attachToEmail]
Name=Attach to Thunderbird Mail
Name[en]=Send file as attachment
Name[]=Wyslij jako zalacznik
Icon=/usr/share/thunderbird/icons/mozicon16.xpm

[Desktop Entry]
Actions=attachToEmail
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory
Type=Service

[Desktop Action attachToEmail]
Name=Attach to Thunderbird Mail
Name[en]=Send file as attachment
Name[]=Wyslij jako zalacznik
Icon=/usr/share/thunderbird/icons/mozicon16.xpm
Exec=thunderbird -compose “attachment=’file:/`echo %F | sed ‘s/\\ \\//,file:\\/\\//g’`'”

Download above sample from here.

As you see you can specify with which file types this context menu should appear.
Above configuration works for thunderbird 2.x (2.x requires files:// prefix, because of some bug)

There is a peace of magic in Exec line, because of the way thunderbirds expects filenames.

More about desktop file format here.

Categories
Uncategorized

Problem with TagLibs on Jetty run under maven2.

Error obviously suggests problem with library versions. Generally first step  to solve this is to find out in what version of library below method is used, what version we  are using (jar may be provided by your application, by application server or sometimes in java libs folder).

java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.(Ljava/lang/String;ZLjava/lang/String;ZZ)V  org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute (TagLibraryInfoImpl.java:577)

Most often conflict is in jetty/libs directory, but where does jetty under maven has it’s home dir?
More about configuring jetty plugin here.

After struggling with my configuration I find out that problem was in following lines:


<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
<version>1.0</version>
</dependency>

which I copied from other tutorial so small chances thay it will be your cause.

Categories
Uncategorized

No Polish keys after upgrade to xorg-server 1.5

Have you read news that gentoo developers have sent you?

eselect news read 2009-04-06-x_server-1_5

xorg-server 1.5 now have option to use hal to configure devices (in future xorg.conf will be not needed atall)
and by default looks for configuration options for devices in /etc/hal/

You can:
1. Disable new feature be adding
Option “AutoAddDevices” “false”
to your xorg.conf

2. Start using new features…
Make sure your xorg is compiled with hal and edev flags.
and copy following file

<?xml version="1.0" encoding="UTF-8"?>
<!--
Section "InputDevice"
Driver "evdev"
Option "XkbLayout" "ee"
EndSection
-->
<deviceinfo version="0.2">
<match key="info.capabilities" contains="input.keyboard">
<merge key="input.x11_options.XkbLayout" type="string">pl</merge>
</match>
</deviceinfo>

into /etc/hal/fdi/policy/10-xinput-configuration.fdi
More details here