From 1f8287da157ec8aa430ef782a15f29426915ee7c Mon Sep 17 00:00:00 2001 From: davegallant Date: Wed, 17 Nov 2021 22:54:55 +0000 Subject: [PATCH] deploy: 1ff0e68a91931d15c85aa3d34dcd8f6cf32550be --- 404.html | 2 +- about/index.html | 2 +- authors/index.html | 2 +- .../16/appgate-sdp-on-arch-linux/index.html | 2 +- .../06/what-to-do-with-a-homelab/index.html | 2 +- .../08/why-i-threw-out-my-dotfiles/index.html | 8 +-- .../index.html | 2 +- .../index.html | 62 +++++++++---------- .../running-k3s-in-lxc-on-proxmox/index.html | 50 +++++++-------- index.html | 2 +- page/index.html | 2 +- page/search/index.html | 2 +- page/search/index.json | 2 +- post/index.html | 2 +- tags/adguard/index.html | 2 +- tags/aws-vault/index.html | 2 +- tags/aws/index.html | 2 +- tags/containers/index.html | 2 +- tags/docker/index.html | 2 +- tags/dotfiles/index.html | 2 +- tags/grafana/index.html | 2 +- tags/home-manager/index.html | 2 +- tags/homelab/index.html | 2 +- tags/index.html | 2 +- tags/jellyfin/index.html | 2 +- tags/k3s/index.html | 2 +- tags/linux/index.html | 2 +- tags/lxc/index.html | 2 +- tags/netdata/index.html | 2 +- tags/nix/index.html | 2 +- tags/pihole/index.html | 2 +- tags/plex/index.html | 2 +- tags/podman/index.html | 2 +- tags/proxmox/index.html | 2 +- tags/python/index.html | 2 +- tags/security/index.html | 2 +- tags/tailscale/index.html | 2 +- tags/virtualization/index.html | 2 +- tags/vpn/index.html | 2 +- 39 files changed, 96 insertions(+), 96 deletions(-) diff --git a/404.html b/404.html index fd9b4d78..53a315fb 100644 --- a/404.html +++ b/404.html @@ -8,7 +8,7 @@ - + This page no longer exists, or maybe it never did? Try https://archive.org? • davegallant diff --git a/about/index.html b/about/index.html index 13225bb8..8f31c13a 100644 --- a/about/index.html +++ b/about/index.html @@ -8,7 +8,7 @@ - + About • davegallant diff --git a/authors/index.html b/authors/index.html index 558de1d2..780c2e41 100644 --- a/authors/index.html +++ b/authors/index.html @@ -8,7 +8,7 @@ - + Authors • davegallant diff --git a/blog/2020/03/16/appgate-sdp-on-arch-linux/index.html b/blog/2020/03/16/appgate-sdp-on-arch-linux/index.html index c5a7c949..1c4766d8 100644 --- a/blog/2020/03/16/appgate-sdp-on-arch-linux/index.html +++ b/blog/2020/03/16/appgate-sdp-on-arch-linux/index.html @@ -8,7 +8,7 @@ - + AppGate SDP on Arch Linux • davegallant diff --git a/blog/2021/09/06/what-to-do-with-a-homelab/index.html b/blog/2021/09/06/what-to-do-with-a-homelab/index.html index a811a6ca..3194ba48 100644 --- a/blog/2021/09/06/what-to-do-with-a-homelab/index.html +++ b/blog/2021/09/06/what-to-do-with-a-homelab/index.html @@ -8,7 +8,7 @@ - + What To Do With A Homelab • davegallant diff --git a/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html b/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html index 13f97fe9..09d367cd 100644 --- a/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html +++ b/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html @@ -8,7 +8,7 @@ - + Why I Threw Out My Dotfiles • davegallant @@ -161,9 +161,9 @@ personal blog

What is home-manager?

Before understanding home-manager, it is worth briefly discussing what nix is. nix is a package manager that originally spawned from a PhD thesis. Unlike other package managers, it uses symbolic links to keep track of the currently installed packages, keeping around the old ones in case you may want to rollback.

For example, I have used nix to install the package bind which includes dig. You can see that it is available on multiple platforms. The absolute path of dig can be found by running:

-
❯ ls -lh $(which dig)
-lrwxr-xr-x 73 root 31 Dec  1969 /run/current-system/sw/bin/dig -> /nix/store/0r4qdyprljd3dki57jn6c6a8dh2rbg9g-bind-9.16.16-dnsutils/bin/dig
-

Notice that there is a hash included in the file path? This is a nix store path and is computed by the nix package manager. This nix pill does a good job explaining how this hash is computed. All of the nix pills are worth a read, if you are interested in learning more about nix itself. However, using home-manager does not require extensive knowledge of nix.

+
❯ ls -lh $(which dig)
+lrwxr-xr-x 73 root 31 Dec  1969 /run/current-system/sw/bin/dig -> /nix/store/0r4qdyprljd3dki57jn6c6a8dh2rbg9g-bind-9.16.16-dnsutils/bin/dig
+

Notice that there is a hash included in the file path? This is a nix store path and is computed by the nix package manager. This nix pill does a good job explaining how this hash is computed. All of the nix pills are worth a read, if you are interested in learning more about nix itself. However, using home-manager does not require extensive knowledge of nix.

Part of the nix ecosystem includes nixpkgs. Many popular tools can be found already packaged in this repository. As you can see with these stats, there is a large number of existing packages that are being maintained by the community. Contributing a new package is easy, and anyone can do it!

home-manager leverages the nix package manager (and nixpkgs), as well the nix language so that you can declaratively define your system configuration. I store my nix-config in git so that I can keep track of my packages and configurations, and retain a clean and informative git commit history so that I can understand what changed and why.

Setting up home-manager

diff --git a/blog/2021/09/17/automatically-rotating-aws-access-keys/index.html b/blog/2021/09/17/automatically-rotating-aws-access-keys/index.html index 36653d95..a79dc17d 100644 --- a/blog/2021/09/17/automatically-rotating-aws-access-keys/index.html +++ b/blog/2021/09/17/automatically-rotating-aws-access-keys/index.html @@ -8,7 +8,7 @@ - + Automatically Rotating AWS Access Keys • davegallant diff --git a/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html b/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html index acf8ddfd..cf6fe215 100644 --- a/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html +++ b/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html @@ -8,7 +8,7 @@ - + Replacing docker with podman on macOS (and Linux) • davegallant @@ -178,21 +178,21 @@ podman machine init podman machine start

Running a container

Let’s try to pull an image:

-
$ podman pull alpine
-Trying to pull docker.io/library/alpine:latest...
-Getting image source signatures
-Copying blob sha256:a0d0a0d46f8b52473982a3c466318f479767577551a53ffc9074c9fa7035982e
-Copying config sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
-Writing manifest to image destination
-Storing signatures
-14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
-
+
$ podman pull alpine
+Trying to pull docker.io/library/alpine:latest...
+Getting image source signatures
+Copying blob sha256:a0d0a0d46f8b52473982a3c466318f479767577551a53ffc9074c9fa7035982e
+Copying config sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
+Writing manifest to image destination
+Storing signatures
+14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab
+

If you’re having an issue pulling images, you may need to remove ~/.docker/config.json or remove the set of auths in the configuration as mentioned here.

and then run and exec into the container:

-
$ podman run --rm -ti alpine
-Error: error preparing container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f676af59fbf32ce205b for attach: error configuring network namespace for container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f676af59fbf32ce205b: error adding pod unruffled_bohr_unruffled_bohr to CNI network "podman": unexpected end of JSON input
-

What does this error mean? A bit of searching lead to this github issue.

+
$ podman run --rm -ti alpine
+Error: error preparing container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f676af59fbf32ce205b for attach: error configuring network namespace for container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f676af59fbf32ce205b: error adding pod unruffled_bohr_unruffled_bohr to CNI network "podman": unexpected end of JSON input
+

What does this error mean? A bit of searching lead to this github issue.

Until the fix is released, a workaround is to just specify a port (even when it’s not needed):

podman run -p 4242 --rm -ti alpine
 

If you’re reading this from the future, there is a good chance specifying a port won’t be needed.

@@ -212,24 +212,24 @@ Error: error preparing container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f6 command: [/bin/echo, 'Hello world'] EOF

Now run:

-
$ podman-compose up
-podman pod create --name=davegallant.github.io --share net
-40d61dc6e95216c07d2b21cea6dcb30205bfcaf1260501fe652f05bddf7e595e
-0
-podman create --name=davegallant.github.io_hello_world_1 --pod=davegallant.github.io -l io.podman.compose.config-hash=123 -l io.podman.compose.project=davegallant.github.io -l io.podman.compose.version=0.0.1 -l com.docker.compose.container-number=1 -l com.docker.compose.service=hello_world --add-host hello_world:127.0.0.1 --add-host davegallant.github.io_hello_world_1:127.0.0.1 ubuntu /bin/echo Hello world
-Resolved "ubuntu" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
-Trying to pull docker.io/library/ubuntu:latest...
-Getting image source signatures
-Copying blob sha256:f3ef4ff62e0da0ef761ec1c8a578f3035bef51043e53ae1b13a20b3e03726d17
-Copying blob sha256:f3ef4ff62e0da0ef761ec1c8a578f3035bef51043e53ae1b13a20b3e03726d17
-Copying config sha256:597ce1600cf4ac5f449b66e75e840657bb53864434d6bd82f00b172544c32ee2
-Writing manifest to image destination
-Storing signatures
-1a68b2fed3fdf2037b7aef16d770f22929eec1d799219ce30541df7876918576
-0
-podman start -a davegallant.github.io_hello_world_1
-Hello world
-

This should more or less provide the same results you would come to expect with docker. The README does clearly state that podman-compose is under development.

+
$ podman-compose up
+podman pod create --name=davegallant.github.io --share net
+40d61dc6e95216c07d2b21cea6dcb30205bfcaf1260501fe652f05bddf7e595e
+0
+podman create --name=davegallant.github.io_hello_world_1 --pod=davegallant.github.io -l io.podman.compose.config-hash=123 -l io.podman.compose.project=davegallant.github.io -l io.podman.compose.version=0.0.1 -l com.docker.compose.container-number=1 -l com.docker.compose.service=hello_world --add-host hello_world:127.0.0.1 --add-host davegallant.github.io_hello_world_1:127.0.0.1 ubuntu /bin/echo Hello world
+Resolved "ubuntu" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
+Trying to pull docker.io/library/ubuntu:latest...
+Getting image source signatures
+Copying blob sha256:f3ef4ff62e0da0ef761ec1c8a578f3035bef51043e53ae1b13a20b3e03726d17
+Copying blob sha256:f3ef4ff62e0da0ef761ec1c8a578f3035bef51043e53ae1b13a20b3e03726d17
+Copying config sha256:597ce1600cf4ac5f449b66e75e840657bb53864434d6bd82f00b172544c32ee2
+Writing manifest to image destination
+Storing signatures
+1a68b2fed3fdf2037b7aef16d770f22929eec1d799219ce30541df7876918576
+0
+podman start -a davegallant.github.io_hello_world_1
+Hello world
+

This should more or less provide the same results you would come to expect with docker. The README does clearly state that podman-compose is under development.

Summary

Installing Podman on macOS was not seamless, but it was manageable well within 30 minutes. I would recommend giving Podman a try to anyone who is unhappy with experiencing forced docker updates, or who is interested in using a more modern technology for running containers.

One caveat to mention is that there isn’t an official graphical user interface for Podman, but there is an open issue considering one. If you rely heavily on Docker Desktop’s UI, you may not be as interested in using podman yet.

diff --git a/blog/2021/11/14/running-k3s-in-lxc-on-proxmox/index.html b/blog/2021/11/14/running-k3s-in-lxc-on-proxmox/index.html index 502bad60..1bfd5b14 100644 --- a/blog/2021/11/14/running-k3s-in-lxc-on-proxmox/index.html +++ b/blog/2021/11/14/running-k3s-in-lxc-on-proxmox/index.html @@ -8,7 +8,7 @@ - + Running K3s in LXC on Proxmox • davegallant @@ -211,30 +211,30 @@ k3sup install --ip $CONTAINER_IP --user root --k3s

If all goes well, you should see a path to the kubeconfig generated. I moved this into ~/.kube/config so that kubectl would read this by default.

Wrapping up

Installing K3s in LXC on Proxmox works with a few tweaks to the default configuration. I later followed the Tekton’s Getting Started guide and was able to deploy it in a few commands.

-
$ kubectl get all --namespace tekton-pipelines
-NAME                                               READY   STATUS    RESTARTS      AGE
-pod/tekton-pipelines-webhook-8566ff9b6b-6rnh8      1/1     Running   1 (50m ago)   12h
-pod/tekton-dashboard-6bf858f977-qt4hr              1/1     Running   1 (50m ago)   11h
-pod/tekton-pipelines-controller-69fd7498d8-f57m4   1/1     Running   1 (50m ago)   12h
-
-NAME                                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                              AGE
-service/tekton-pipelines-controller   ClusterIP   10.43.44.245    <none>        9090/TCP,8080/TCP                    12h
-service/tekton-pipelines-webhook      ClusterIP   10.43.183.242   <none>        9090/TCP,8008/TCP,443/TCP,8080/TCP   12h
-service/tekton-dashboard              ClusterIP   10.43.87.97     <none>        9097/TCP                             11h
-
-NAME                                          READY   UP-TO-DATE   AVAILABLE   AGE
-deployment.apps/tekton-pipelines-webhook      1/1     1            1           12h
-deployment.apps/tekton-dashboard              1/1     1            1           11h
-deployment.apps/tekton-pipelines-controller   1/1     1            1           12h
-
-NAME                                                     DESIRED   CURRENT   READY   AGE
-replicaset.apps/tekton-pipelines-webhook-8566ff9b6b      1         1         1       12h
-replicaset.apps/tekton-dashboard-6bf858f977              1         1         1       11h
-replicaset.apps/tekton-pipelines-controller-69fd7498d8   1         1         1       12h
-
-NAME                                                           REFERENCE                             TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
-horizontalpodautoscaler.autoscaling/tekton-pipelines-webhook   Deployment/tekton-pipelines-webhook   9%/100%   1         5         1          12h
-

I made sure to install Tailscale in the container so that I can easily access K3s from anywhere.

+
$ kubectl get all --namespace tekton-pipelines
+NAME                                               READY   STATUS    RESTARTS      AGE
+pod/tekton-pipelines-webhook-8566ff9b6b-6rnh8      1/1     Running   1 (50m ago)   12h
+pod/tekton-dashboard-6bf858f977-qt4hr              1/1     Running   1 (50m ago)   11h
+pod/tekton-pipelines-controller-69fd7498d8-f57m4   1/1     Running   1 (50m ago)   12h
+
+NAME                                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                              AGE
+service/tekton-pipelines-controller   ClusterIP   10.43.44.245    <none>        9090/TCP,8080/TCP                    12h
+service/tekton-pipelines-webhook      ClusterIP   10.43.183.242   <none>        9090/TCP,8008/TCP,443/TCP,8080/TCP   12h
+service/tekton-dashboard              ClusterIP   10.43.87.97     <none>        9097/TCP                             11h
+
+NAME                                          READY   UP-TO-DATE   AVAILABLE   AGE
+deployment.apps/tekton-pipelines-webhook      1/1     1            1           12h
+deployment.apps/tekton-dashboard              1/1     1            1           11h
+deployment.apps/tekton-pipelines-controller   1/1     1            1           12h
+
+NAME                                                     DESIRED   CURRENT   READY   AGE
+replicaset.apps/tekton-pipelines-webhook-8566ff9b6b      1         1         1       12h
+replicaset.apps/tekton-dashboard-6bf858f977              1         1         1       11h
+replicaset.apps/tekton-pipelines-controller-69fd7498d8   1         1         1       12h
+
+NAME                                                           REFERENCE                             TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
+horizontalpodautoscaler.autoscaling/tekton-pipelines-webhook   Deployment/tekton-pipelines-webhook   9%/100%   1         5         1          12h
+

I made sure to install Tailscale in the container so that I can easily access K3s from anywhere.

If I’m feeling adventurous, I might experiment with K3s rootless.