pg_dump -U [superuser] -Fc [dbname] > db.dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install Portainer | |
# Using Arkade ( Works on arm & amd64 ) | |
# If Arkade shows cluster unreachable, use (kubectl config view --raw >~/.kube/config) | |
$ curl -sLS https://dl.get-arkade.dev | sudo sh | |
$ arkade install portainer | |
# Access Portainer UI on http://http://10.0.1.86:30777 ( Master Server IP : 10.0.1.86 ) | |
# If you are using ( arm64 ( 64 bit OS on Rasps )) | |
$ curl -LO https://raw.githubusercontent.com/portainer/portainer-k8s/master/portainer-nodeport.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On Master Server | |
$ microk8s add-node | |
# It give join command like this: microk8s join 10.0.1.86:25000/6cae23f7273dc6700f439f8c19abc7de | |
# On Worker Nodes | |
$ microk8s join 10.0.1.86:25000/6cae23f7273dc6700f439f8c19abc7de | |
# To Check | |
$ microk8s kubectl get nodes | |
NAME STATUS ROLES AGE VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We use the headless OS, So we have no option to access services other than exposing to the internal network. | |
# By default Kubernetes dashboard is not accessible on the local network, but if you were using raspbionOS ( GUI ), you could access the clusterIP in your Raspberry pi. | |
# --Exposing-- | |
$ kubectl -n kube-system edit service kubernetes-dashboard | |
# Change type: ClusterIP to NodePort | |
# Get service port | |
$ microk8s.kubectl --namespace=kube-system get service kubernetes-dashboard | |
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do this on all the nodes ( Only the Installation step, Rest of the steps are for just master server ) | |
## Install MicroK8s | |
$ sudo snap install microk8s --channel=1.19 --classic | |
# Add user to group microk8s & give user permission to ~/.kube | |
$ sudo usermod -a -G microk8s user | |
$ sudo chown -f -R user ~/.kube | |
-------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do this on all of your nodes ( Rasps ) | |
# Install Docker | |
$ curl -sSL https://get.docker.com | sh | |
-------------------------------------------------------------------------------------- | |
## Enable cgroups (Control Groups). Cgroups allow the Linux kernel to limit and isolate resources. | |
# Practically speaking, this allows Kubernetes to manage better resources used by the containers it runs and increases security by isolating containers from one another. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => General | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Sets how many lines of history VIM has to remember | |
set history=500 | |
" Enable filetype plugins | |
filetype plugin on | |
filetype indent on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.fontFamily": "Fira Code iScript", | |
"editor.detectIndentation": true, | |
"editor.renderIndentGuides": true, | |
"editor.formatOnSave": true, | |
"editor.formatOnPaste": true, | |
"editor.fontSize": 16, | |
"editor.lineHeight": 25, | |
"editor.fontWeight": "700", | |
"editor.tabSize": 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This gist builds on the excellent work done by Graham Garner, Andreas Spiess, and Peter Scargill to make it easy for Makers to install IOTstack on a Raspberry Pi.
One concern with any out-of-the-box Raspberry Pi is the limited lifespan of its SD card. You'd be pretty annoyed if you got your IOTstack up and running, only to find that you were one of the unlucky ones whose SD card wore out in less than six months!
SSDs, on the other hand, while not immune to the same kinds of failure, tend to have projected life expectancies in the hundreds of years.