1
0
Fork 0
Commit Graph

279 Commits (ccc46288c26b45d45d80a87df05ae51aebefed99)

Author SHA1 Message Date
Dustin 668b5bf5a9 kitchen: Allow Jenkins to restart deployment
Jenkins is now allowed to restart the Deployment named *kitchen* in the
*kitchen* namespace.  It will do this after pushing a new container
image from a build of the *master* branch.
2022-11-06 17:22:46 -06:00
Dustin de054bd68f kitchen: Add manifest for kitchen screen server
I decided to run the kitchen screen service in Kubernetes rather than on
the Raspberry Pi in the kitchen.  This will hopefully make it a bit more
reliable and easier to update.  It will also make it easier to rebuild
the OS on the Pi, if it ever becomes necessary, since it really only
needs Firefox (and MQTTDPMS) now.
2022-11-05 16:39:22 -05:00
Dustin 5208902706 metrics: Add role to allow anon access to metrics
By default, the Kubernetes metrics endpoints are restricted.  I don't
think they're worth protecting with authentication, so I've added a
cluster role/binding to allow anonymous access to them.
2022-11-05 16:23:02 -05:00
Dustin 6df6e552b7 longhorn: Remove node selector labels
I originally added the `du5t1n.me/storage` label to the x86_64 nodes and
configured Longhorn to only run on nodes with those labels because I
thought that was the correct way to control where volume replicas are
stored.  It turns out that this was incorrect, as it prevented Longhorn
from running on non-matching nodes entirely.  Thus, any machine that was
not so labeled could not access any Longhorn storage volumes.

The correct way to limit where Longhorn stores volume replicas is to
enable the `create-default-disk-labeled-nodes` setting.  With this
setting enabled, Longhorn will run on all nodes, but will not create
"disks" on them unless they have the
`node.longhorn.io/create-default-disk` label set to `true`.  Nodes that
do not have "disks" will not store volume replicas, but will run the
other Longhorn components and can therefore access Longhorn volumes.

Note that changing the "default settings" ConfigMap does not change the
setting once Longhorn has been deployed.  To update the setting on an
existing installation, the setting has to be changed explicitly:

```sh
kubectl get setting -n longhorn-system -o json \
    create-default-disk-labeled-nodes \
    | jq '.value="true"' \
    | kubectl apply -f -
```
2022-10-11 21:58:43 -05:00
Dustin a683505e5d dynk8s-provisioner: Add manifest 2022-10-11 21:58:22 -05:00
Dustin 3755aaab6f autoscaler: Add manifest for Cluster Autoscaler 2022-10-11 21:57:59 -05:00
Dustin 5f2aaefc35 stroage: Set default storage class
Setting a default storage class allows PersistentVolumes to be declared
without selecting a specific storage class in each object spec.
2022-08-23 21:21:54 -05:00
Dustin 76875e3dbf storage: Show how to create admin password secret 2022-08-23 21:21:43 -05:00
Dustin 8f6373fb70 storage: Fix typo in node selector 2022-08-23 21:21:22 -05:00
Dustin 7bd7dc7b18 ingress: Show how to import cert as secret 2022-08-23 21:20:47 -05:00
Dustin 102d1fb919 setup: ks: Generate iSCSI initiator name
The iSCSI initiator needs a unique name.  It will generate one the first
time it starts if one does not already exist.  Since it tries to write
it to a file under `/etc`, this will fail, since the root filesystem is
read-only.  As such, we need to generate the name during installation,
when the filesystem is still writable.
2022-08-23 21:22:01 -05:00
Dustin be2f0e5f72 prom_speedtest: Add application manifest
The Raspberry Pi is too slow to run the speed test and get accurate
results.
2022-08-06 22:21:06 -05:00
Dustin 52a6481733 hudctr: Add manifest for Basement HUD controller 2022-08-02 21:46:32 -05:00
Dustin 6c7dcce90b setup: switch back to ext4 on lvm
Originally, I decided to use *btrfs* subvolumes to create writable
directories inside otherwise immutable locations, such as for
`/etc/cni/net.d`, etc.  I figured this would be cleaner than
bind-mounting directories from `/var`, and would avoid the trouble of
determining an appropriate volume sizes necessary to make them each
their own filesystem.

Unfortunately, it turns out that *cri-o* may still have some issues with
its *btrfs* storage driver.  One [blog post][0] hints at performance
issues in *containerd*, and it seems they may apply to *cri-o* as well.
I certainly encountered performance issues when attempting to run `npm`
in a Jenkins job running in a Kubernetes pod.  There is definitely a
[performance issue with `npm`][1] when running in a container, which may
or may not have been exacerbated by the *btrfs* storage driver.

In any case, upstream [does not reecommend][2] using the *btrfs* driver,
performance notwithstanding.  The *overlay* driver is much more widely
used and tested.  Plus, it's easier to filter out container layers from
filesystem usage statistics simply by ignoring *overlay* filesystems.

[0]: https://blog.cubieserver.de/2022/dont-use-containerd-with-the-btrfs-snapshotter/
[1]: https://github.com/npm/cli/issues/3208#issuecomment-1002990902
[2]: https://github.com/containers/storage/issues/929
2022-07-31 17:09:03 -05:00
Dustin c7a3477c9e setup: Convert tabs to spaces 2022-07-31 01:40:16 -05:00
Dustin bd8ae87036 setup: Fix typo in README 2022-07-31 01:39:54 -05:00
Dustin 4cce8df62d README: Add storage section 2022-07-31 01:38:46 -05:00
Dustin 157353ddb0 phpipam: Add manifest for phpipam 2022-07-31 01:31:53 -05:00
Dustin 2a07a7856f docker-distribution: Deploy OCI image registry
We're going to need a place to store custom container images to run on
the Kubernetes cluster!

This is my first from-scratch manifest!
2022-07-31 01:15:01 -05:00
Dustin 9b86a117ef storage: Add manifest for Longhorn
I was originally going to use GlusterFS to provide persistent storage
for pods, but [Heketi][0], the component that provides the API for
the Kubernetes StorageClass, is in "deep maintenance" status and looks
to be practically dead.  I was a bit afraid to try to use it because of
that, and went looking for guidance on Reddit, which is how I discovered
Longhorn.
2022-07-31 00:57:53 -05:00
Dustin 30cbc568d0 ingress: Add manifest for ingress-nginx
This manifest deploys the *ingress-nginx* controller, which is
responsible for handing traffic from clients outside the cluster and
routing it to the proper pods.  I am using host network mode here to
avoid having to have another proxy in front of the ingress controller,
which would be required in NodePort mode.

I looked at MetalLB briefly, but decided to avoid it for now.  As with
everything else in the Kubernetes world, it seems massively complex.
2022-07-31 00:57:12 -05:00
Dustin ac4d9c1f21 jenkins: Fix typo in README 2022-07-31 00:42:42 -05:00
Dustin 5c19643182 setup: Add virt-install commands
These are the `virt-install` commands I used to create the Control Plane
and Worker nodes in the Kubernetes cluster.
2022-07-31 00:42:37 -05:00
Dustin 66b3c83c6c setup: Fix typographical errors 2022-07-31 00:20:55 -05:00
Dustin ce077ad557 setup: Use separate kicstarts for control/worker
We're going to be using Longhorn for persistent storage.  Longhorn
allocates space on worker nodes and exposes iSCSI LUNs to other worker
nodes.  It creates sparse filesystem images under `/var/lib/longhorn`
for each volume.  Thus, we need to mount a large filesystem at that
path on each worker node for Longhorn to use.

Using two different kickstart scripts, one for the control plane nodes,
and one for the worker nodes, we can properly mount the Longhorn data
directory only on machines that will be running the Longhorn manager.

Longhorn only supports *ext4* and *XFS* filesystem types.
2022-07-31 00:14:09 -05:00
Dustin 95e563d1a9 setup: Fix ansible-playbook domain join command
* Correct example hostname
* Apply `base.yml` and `hostname.yml` separately, without
  `bootstrap.yml`, to avoid deploying *firewalld*
* Correct host IP address
2022-07-26 22:40:12 -05:00
Dustin 8b8ae3df04 setup: Use kickstart instead of Ansible
Kubernetes, or rather mostly Calico, does not play well on a machine
with an immutable root filesyste.  Specifically, Calico needs write
access to a couple of paths on the root filesystem, such as
`/etc/cni/net.d`, `/opt/cni/bin`, and
`/usr/libexec/kubernetes/kubelet-plugins/volume`.  Some of those paths
can be configured, but doing so is quite cumbersome.  While these paths
could be made writable, e.g. using symlinks or bind mounts, it would add
a lot of complexity to the *kubelet* Ansible role.  After considering
the options for a while, I decided that the best approach was probably
to mount specific filesystems at these paths.  Instead of using small
LVM logical volumes for each one, I thought it would be better to use a
single *btrfs* filesystem for all the mutable storage locations.  This
way, if I discover more paths that need to be writable, I can create
subvolumes for them, without having to try to move or resize the
existing volumes.

Now that the Kubernetes nodes need their own special kickstart file for
the disk layout, it also makes sense to handle the rest of the machine
setup there, too.  This eliminates the need for the *kubelet* Ansible
role altogether.  Any machine provisioned with this kickstart
configuration is immediately ready to become a Kubernetes control plane
or worker node.
2022-07-26 22:29:50 -05:00
Dustin 70cb9186a6 Add Jenkins setup resources 2022-07-25 17:52:55 -05:00
Dustin f7d01f3d03 Initial commit 2022-07-25 17:52:55 -05:00