Using Kubectl under Windows

Just a small tip about Kubectl, the command line client to interact with a Kubernetes master. I recently had to use it with Windows 7 and I met problems at the beginning with it. The basic configuration consists in having a config file under the ~/.kube directory. But for some reason, kubectl was not picking it up.

The solution is to create a system variable in Windows, named KUBECONFIG, and that points to ~/.kube/config (or whatever file you want).

Concatenate Files

It is sometimes useful or required to concatenate files.

One example could be log files, or files that have been split (as an example by a host like badongo, with *.aa, *.ab, *.ac… files).

Under Linux, this is feasible with the cat command.
For every file to concatenate, you only have to redirect the output of the cat command in the same file.

cat file1 > filename.ext
cat file2 >> filename.ext
cat file3 >> filename.ext

Under Windows, you can get the same result with the copy DOS command.

copy /B file1 + file2 + file3 filename.ext

At the end, filename.ext contains the concatenated content of the files file1, file2 and file3.