Blog

  • How to install Portainer with multiple nodes

    How to install Portainer with multiple nodes

    Prerequisites

    To get multiple nodes, I am using both a VM on my host and Docker on my Synology. To that end, these instructions will be based off of what I am using.

    I’ll cover the steps from once you have Synology up and running as well as a Linux VM running Ubuntu. For sizing the VM, I couldn’t find much guidance so went with 4 cores on 1 CPU, 2 GB RAM and 10 GB HDD. I only have a two-bay NAS but did upgrade the RAM to 6 GB.

    Synology Steps

    I used the excellent steps on Synology: 30 Second Portainer Install Using Task Scheduler & Docker – Marius Hosting. The thing to remember in his steps, the names and paths created in the middle are used explicitly in the scheduled task. You are using the scheduled task so you don’t have to SSH into the Synology. Think of it as entering the commands in the terminal. Obviously I edited the commands to match my setup. I like Maruis’ way as it’s simple with the flexibility of command line. Speaking of which, I needed to adjust my Synology firewall to allow the traffic on the new ports. The script Marius provided uses 8000 and 9000.

    There is also a GUI interface in Synology for creating docker containers. This site has a great tutorial on that but uses PiHole as the example. In the end, I used the command line scheduled task (even for updating Portainer) as I don’t know how to use the GUI to get an equivalent to “docker.sock” volume.

    Ubuntu VM Steps

    First I created a new VM and installed the latest mini-Ubuntu. There is a selection in the installer for adding Docker, don’t do that. It loads Snaps and those don’t work. Then I installed Docker by following these instructions- How to install Docker on Ubuntu as they were using more of the built-in functionality of APT.

    Next I installed the agent using these instructions. The guy talks a lot but the key point of using the Edge Install script provided in Portainer is correct. The link should be about 3 min in where he really gets to the details.

    Now I have Two

    Now I have two environments in one administration interface! For my purposes, I’m going to put more containers on the VM to keep the load over there.

  • Rectangle Spaceship

    I was looking at Pintrest and this shape stood out to me. I don’t think it was actually a spaceship but some futuristic product. The shape was super cool and I thought of how I could make it with LEGO. Additionally, I was playing around with how to connect the two parts, I wound up using clips between the top and bottom. The bottom also has some Technic beams to hold it’s structure together as it’s mostly just the skin. I wound up revising it quite a few times to get what I wanted.

    Inside, there is a fold-down bunk and a shelf for storage. Behind the door is a rack for a gun.

    The color scheme was dictated by the red window frames and the yellow curves at the bottom. I tried to not suggest any Mc Donald’s shapes but not sure how far away from suggesting a future fast-food delivery ship I got…

  • Kubernetes Cheat-sheet

    Kubernetes Cheat-sheet

    kubectl get pods -n namespace ### get the id of the pod just made for given namespace

    kubectl logs namespace-tag-6b59cf4fbc-k5wdc -n namespace ### show the logs of what’s happening to it

    kubectl get ingress -A ### get a list of ingress points for all namespace

    kubectl get svc -A ### get a list of all services running for all namespaces

    kubectl exec -it container-tag-6b59cf4fbc-k5wdc -n namespace sh ### open container and run shell on it

    helm template -f values.yaml . > deployChart.yaml ### run the chart against template but just output to file

    helm install -name appName . -n namespace --create-namespace ### make stuff from current folder from Chart.yaml

    helm install -name appName. -n namespace --debug --dry-run ### try out creation but don’t actually make

    helm uninstall appName-n namespace ### delete stuff via helm

    kubectl get pods --field-selector=status.phase!=Running -A ### get all the pods that are not running

    kubectl get deployments -A ### get all the deployments

    kubectl edit deployment spark-query -n namespace ### edit the one deployment ‘spark-query’

    kubectl scale deployment portal -n namespace --replicas=1 ### add one pod to ‘portal’ service

    kubectl get deploy -n namespace -o yaml ### output the deployment to new yaml file

    kubectl edit deploy appName -n namespace ### edit the deployment in vi

    kubectl edit cm appName -n namespace

    kubectl describe pod container-tag-6b59cf4fbc-k5wdc -n namespace ### get details on pod

    kubectl get secret -n namespace

    kubectl edit secret default-token-qcnfb -n namespace

    kubectl create secret generic azure-app-secret --from-literal=azurestorageaccountname=storageName --from-literal=azurestorageaccountkey=[key]  -n namespace

    kubectl delete pod --all -n namespace ### delete all the pods in namespace