Posts
How to Inject Environment Variables into a Kubernetes Pod and the Priority Issue
· β˜• 3 min read
1. Several Ways for a Kubernetes Pod to Reference Environment Variables 1.1 Directly Key/Value You can set the Value directly, and you can also use the current Pod’s information as the Value. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 apiVersion: v1 kind: Pod metadata: name: envar-demo labels: purpose: demonstrate-envars spec: containers: - name: envar-demo-container image: gcr.

Add an External DNS Service to a Kubernetes Cluster
· β˜• 2 min read
1. Add DNS to the Host 1.1 CentOS The first method: manage DNS with /etc/resolv.conf Disable NetworkManager If you do not disable NetworkManager, the DNS records you add directly to /etc/resolv.conf are lost after you restart the NetworkManager component. 1 2 3 4 vim /etc/NetworkManager/NetworkManager.conf [main] dns=none Add dns=none to the [main] section.

Migrating Docker Storage to a New Disk
· β˜• 2 min read
1. Formatting the Disk Check the new disk 1 fdisk -l Usually, the second disk is named /dev/sdb. Partition the disk 1 fdisk /dev/sdb You will be prompted to enter parameters: command (m for help):n Partition number(1-4):1 First cylinder (1-22800,default 1):Enter command (m for help):w Format the disk as ext4 1 mkfs.

How Staged Builds Cache Third-Party Dependencies
· β˜• 10 min read
In a non-staged build scenario, when we use a container to build, we can mount the cache directory inside the container onto the build host, run the build task, and then copy the artifacts into the runtime image to produce the application image. But with a staged build, the build image and the runtime image live in the same Dockerfile, which makes it harder to optimize the caching of third-party dependencies.

Some Common MySQL Commands
· β˜• 1 min read
1. Passwordless Login Edit /etc/my.cnf and add a line under [mysqld]: skip-grant-tables=1 Restart the mysqld service 1 systemctl restart mysqld Log in to MySQL as the root user 1 mysql -u root 2. Allow All Access Sources Log in to MySQL 1 mysql -u root -p At the MySQL interactive command line, enter: