How to safely drain and remove k8s node

In this lab, I use Ubuntu 20.04 LTS for my k8s cluster. To remove the k8s node from the cluster, first drain the node : $ kubectl get nodes $ kubectl drain node If required, you also need to ignore daemonsets : $ kubectl drain node –ignore-daemonsets And delete the node : $ kubectl delete … Read more

Setup ftp that works with local user with vsftpd on ubuntu

This is the step-by-step installation of vsftpd that actually works. If you have website that runs wordpress, you might want to enable this to be able install/update your wordpress plugin. Install vsftpd and start the service: $ sudo apt-get install vsftpd -y $ sudo systemctl start vsftpd.service $ sudo systemctl enable vsftpd.service Open vsftpd.conf file, and … Read more

Install pulse secure linux 9 on Fedora 28

This installation is using pulse secure linux version 9 with rpm package ps-pulse-linux-9.0r1.0-b739-centos-rhel-64-bit-installer.rpm $ sudo dnf install compat-libicu57-57.1-2.fc28.x86_64 $ sudo dnf install libgnome-keyring $ sudo rpm -i ps-pulse-linux-9.0r1.0-b739-centos-rhel-64-bit-installer.rpm Create vpn shortcut (optional): $ sudo touch /usr/bin/vpn $ sudo vim /usr/bin/vpn Fill with this script below: #!/bin/bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pulse /usr/local/pulse/pulseUi Make it executable: $ sudo chmod … Read more

Create AWS codebuild project with Terraform

Summary AWS Codebuild is fully managed build service that compiles source code, run tests, and produces software packages that are ready to reploy. To make it easier, we can create it’s infrastructure using terraform. Setup directory structure Before we begin, we can create our own directory structure for the infrastructure. Why this is important? because … Read more

Create docker image and push to AWS ECR

Image tag : test-image awsudo -u aws-profile aws ecr get-login –no-include-email –region ap-southeast-1 sudo docker build -t test-image . sudo docker tag codebuild:test-image 743977200366.dkr.ecr.ap-southeast-1.amazonaws.com/codebuild:test-image sudo docker push 743977200366.dkr.ecr.ap-southeast-1.amazonaws.com/codebuild:test-image  

Python migration with Alembic

$ pip install alembic $ alembic init –template generic alembic edit alembic.ini sqlalchemy.url = mysql://root:@localhost/database_name $ alembic current $ alembic revision -m “Init” $ alembic upgrade head INFO [alembic.migration] Context impl MySQLImpl. INFO [alembic.migration] Will assume non-transactional DDL. INFO [alembic.migration] Running upgrade None -> 174f01a0ar12, Init