Posts tagged: containers
All posts with the tag "containers"
After first setting up a new k3s instance your kubeconfig file will be located in /etc/rancher/k3s/k3s.yaml.
You cans use it from here by setting $KUBECONFIG to that file.
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
Or you can copy it to ~/.kube/config
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
If you have installed k3s on a remote server and need the config on your local machine then you will need to modify the server address to reflect the remote server.
scp user@<server-ip>:/etc/rancher/k3s/k3s.yaml ~/.kube/config
Warning
only do this if you don’t already have a ~/.kube/config file, otherwise copy it to a new file and set your $KUBECONFIG env variable to use it.
Now you will need to open that file and change the server address, making sure to keep the port number.
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ****
server: https://<server-ip>:6443
name: default
I’ve started leaning in on kubernetes kustomize to customize my manifests per deployment per environment. Today I learned that it comes with a diff command.
kubectl diff -k k8s/overlays/local
You can enable color diffs by using an external diff provider like colordiff.
export KUBECTL_EXTERNAL_DIFF="colordiff -N -u"
You might need to install colordiff if you don’t already have it.
sudo pacman -S colordiff
sudo apt install colordiff
Now I can try out kustomize changes and see the change with kustomize diff.
kubectl dash k
Kubernetes ships with a feature called kustomize that allows you to customize your manifests in a declarative way. It's a bit like helm, but easier to use. I...
kind cluster
Yesterday I realized that I have overlooked the default installation method of the sealed secrets controller for kubernetes kubeseal this whole time an jumped straight to the helm section. I spun up a quick kind cluster and had it up quickly. I can’t say this is any better or worse than helm as I have never needed to customize the install. According to the docs you can customize it with [[ kustomize ]] or helm.
# option if you don't have a cluster try with kind
kind create cluster
curl -L https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.27.0/controller.yaml > controller.yaml
kubectl apply -f controller.yaml