You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: apps/argocd.md
+7
Original file line number
Diff line number
Diff line change
@@ -145,3 +145,10 @@ spec:
145
145
server: '{{server}}'
146
146
namespace: default
147
147
```
148
+
149
+
## Further information
150
+
151
+
More examples and tutorials regarding ArgoCD can be found in the link list below:
152
+
153
+
- Basic tutorial for installation and configuration: [Let loose the squid - Deploy ArgoCD the declarative way](https://thedatabaseme.de/2022/06/05/let-loose-the-squid-deploy-argocd-the-declarative-way/)
More examples and tutorials regarding Proxmox can be found in the link list below:
27
+
28
+
- Ansible playbook that automates Linux VM updates running on Proxmox (including snapshots): [TheDatabaseMe - update_proxmox_vm](https://github.com/thedatabaseme/update_proxmox_vm)
29
+
- Manage Proxmox VM templates with Packer: [Use Packer to build Proxmox images](https://thedatabaseme.de/2022/10/16/what-a-golden-boy-use-packer-to-build-proxmox-images/)
Copy file name to clipboardexpand all lines: databases/postgres.md
+17-2
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,28 @@
1
1
# PostgreSQL Cheat-Sheet
2
2
PostgreSQL or also known as Postgres, is a free and open-source relational database management system. PostgreSQL features transactions with Atomicity, Consistency, Isolation, Durability (ACID) properties automatically updatable views, materialized views, triggers, foreign keys, and stored procedures. It is designed to handle a range of workloads, from single machines to data warehouses or web services with many concurrent users.
### Install / deploy Postgres on Kubernetes with Zalando Postgres Operator
14
+
15
+
Postgres is probably the database which is most common on Cloud platforms and also, running
16
+
on Kubernetes environments. There are several so called "Kubernetes Operators" which handle
17
+
the deployment of Postgres clusters for you. One of it is the [Postgres Operator by Zalando](https://github.com/zalando/postgres-operator).
18
+
19
+
You can find some tutorials regarding deployment of the operator and how to work with it,
20
+
in the link list below:
21
+
22
+
-[Deploy Zalando Postgres Operator on your Kubernetes cluster](https://thedatabaseme.de/2022/03/13/keep-the-elefants-in-line-deploy-zalando-operator-on-your-kubernetes-cluster/)
23
+
-[Configure Zalando Postgres Operator Backup with WAL-G](https://thedatabaseme.de/2022/03/26/backup-to-s3-configure-zalando-postgres-operator-backup-with-wal-g/)
24
+
-[Configure Zalando Postgres Operator Restore with WAL-G](https://thedatabaseme.de/2022/05/03/restore-and-clone-from-s3-configure-zalando-postgres-operator-restore-with-wal-g/)
25
+
11
26
## Initial database connection
12
27
13
28
A local connection (from the database server) can be done by the following command:
@@ -104,4 +119,4 @@ To change the owner of an existing database later, you can use the following com
Copy file name to clipboardexpand all lines: docker/docker.md
+16-4
Original file line number
Diff line number
Diff line change
@@ -140,12 +140,24 @@ COMMAND | DESCRIPTION
140
140
`docker volume prune` | Delete all volumes (not referenced by any container)
141
141
142
142
### Backup a container
143
-
Backup docker data from inside container volumes and package it in a tarball archive.
144
-
`docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox tar cvfz /backup/backup.tar CONTAINERPATH`
143
+
144
+
Backup docker data from inside container volumes and package it in a tarball archive:
145
+
146
+
```shell
147
+
docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox tar cvfz /backup/backup.tar CONTAINERPATH
148
+
```
149
+
150
+
An automated backup can be done also by this [Ansible playbook](https://github.com/thedatabaseme/docker_backup). The output is also a (compressed) tar. The playbook can also manage the backup retention. So older backups will get deleted automatically.
151
+
152
+
To also create and backup the container configuration itself, you can use `docker-replay`for that. If you lose the entire container, you can recreate it with the export from `docker-replay`. A more detailed tutorial on how to use docker-replay can be found [here](https://thedatabaseme.de/2022/03/18/shorty-generate-docker-run-commands-using-docker-replay/).
145
153
146
154
### Restore container from backup
147
-
Restore the volume with a tarball archive.
148
-
`docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox sh -c "cd CONTAINERPATH && tar xvf /backup/backup.tar --strip 1"`
155
+
156
+
Restore the volume with a tarball archive:
157
+
158
+
```shell
159
+
docker run --rm --volumes-from CONTAINER -v $(pwd):/backup busybox sh -c "cd CONTAINERPATH && tar xvf /backup/backup.tar --strip 1"
Using the Kind project, you are able to easily deploy a Kubernetes cluster on top of Docker as Docker containers. Kind will spawn separate containers which be shown as the Kubernetes nodes. In this documentation, you can find some examples, as well as a link to a Ansible playbook which can do the cluster creation / deletion for you. This document only describes the basics of Kind. To find more detailed information, you can check the [official Kind documentation](https://kind.sigs.k8s.io/docs/user/quick-start/).
4
+
5
+
Kind is ideal to use in a local development environment or even during a build pipeline run.
6
+
7
+
## Installation on Linux
8
+
9
+
Since Kind deploys Docker containers, it needs to have a Container engine (like Docker) installed.
10
+
11
+
Installing Kind can be done by downloading the latest available release / binary for your platform:
You have to provide a configuration file which tells Kind how you want your Kubernetes cluster to be deployed. Find an example configuration file below:
Not sure what to do next? Check out https://kind.sigs.k8s.io/docs/user/quick-start/
56
+
```
57
+
58
+
Checking for Docker containers running, you can see the following:
59
+
60
+
```bash
61
+
docker ps -a
62
+
63
+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64
+
ac14d8c7a3c9 kindest/node:v1.25.2 "/usr/local/bin/entr..." 2 minutes ago Up About a minute testcluster-worker2
65
+
096dd4bf1718 kindest/node:v1.25.2 "/usr/local/bin/entr..." 2 minutes ago Up About a minute 127.0.0.1:42319->6443/tcp testcluster-control-plane
66
+
e1ae2d701394 kindest/node:v1.25.2 "/usr/local/bin/entr..." 2 minutes ago Up About a minute testcluster-worker
67
+
```
68
+
69
+
### Interacting with your cluster
70
+
71
+
You may have multiple Kind clusters deployed at the same time. To get a list of running clusters, you can use the following command:
72
+
73
+
```bash
74
+
kind get clusters
75
+
kind
76
+
kind-2
77
+
```
78
+
79
+
After cluster creation, the Kubernetes context is set automatically to the newly created cluster. In order to set the currently used kubeconfig, you may use some tooling like [kubectx](https://github.com/ahmetb/kubectx). You may also set the current context used by `kubectl` with the `--context` option, which refers to the Kind cluster name.
80
+
81
+
### Cluster deletion
82
+
83
+
To delete a Kind cluster, you can use the following command. Kind will also delete the kubeconfig of the deleted cluster. So you don't need to do this on your own.
84
+
85
+
```bash
86
+
kind delete cluster -n testcluster
87
+
Deleting cluster "testcluster" ...
88
+
```
89
+
90
+
## Further information
91
+
92
+
More examples and tutorials regarding Proxmox can be found in the link list below:
93
+
94
+
- Creating an Ansible playbook to manage Kind cluster: [Lightweight Kubernetes cluster using Kind and Ansible](https://thedatabaseme.de/2022/04/22/lightweight-kubernetes-cluster-using-kind-and-ansible/)
Git can easily be installed on Linux systems with the available package managers (e.g. for Debian based systems by `apt install git`).
24
+
25
+
For other systems, see the [git download page](https://git-scm.com/downloads).
26
+
27
+
## Configuration
28
+
29
+
Git can be configured from the command line using the `git config` command. For first configuration it is necessary to configure at least the parameters `user.name` and `user.email`. This can be done with the following commands:
|`git init`| Initialize a directory as git managed repository |
46
+
|`git clone <repo_url>`| Clone a remote repository to your local client |
47
+
|`git status`| Shows uncommited changes, new files etc. |
48
+
|`git add <wildcard_or_filename>`| Stage an updated / new file to the next commit |
49
+
|`git rm <wildcard_or_filename>`| Remove a file and stage the removal for the next commit |
50
+
|`git commit -m "<commit message">`| Commit staged changes under a new commit |
51
+
|`git commit`| Will open an editor to write more descriptive commit messages.<br> See [here](https://cbea.ms/git-commit/) for a guide on good commit messages |
52
+
|`git checkout <branch_name>`| Switch to another branch |
53
+
|`git branch`| Shows a list of existing branches |
54
+
|`git branch <branch_name>`| Creates a new branch (from the currently checked out branch) |
55
+
|`git merge <branch_name>`| Merge changes from `branch_name` to the currently checked out branch |
56
+
|`git push`| Push commited changes to the remote repository |
57
+
|`git pull`| Pull current state from the remote repository to your local repo |
58
+
59
+
### Working with git-flow
60
+
61
+
Git-flow assists you by combining multiple steps of `git` commands to one `git-flow` command which will do a workflow of steps. Although `git-flow` makes live easier in some cases, it makes it also more complex sometimes and you need to execute some steps before or after using a `git-flow` command as regular `git` command. (See below)
62
+
63
+
As an example, here is the comparison between the regular `git` commands and the appropriate `git-flow` command for creating a release.
Another `git-flow` cheat sheet can be found [here](https://danielkummer.github.io/git-flow-cheatsheet/).
73
+
74
+
## Using git-crypt
75
+
76
+
Having secret or sensitive information in your git repository is never a good choice. But sometimes it's necessary. Never push unencrypted data to your remote repository.
77
+
78
+
Git-crypt is a transparent encryption tool that works seamless with your Git repository. All sensitive information is encrypted before pushed to the remote repository. Once you've unlocked the repository locally, all data will be decrypted automatically when pulling from the remote repo. This makes development with encrypted data effortless.
79
+
80
+
To install git-crypt, you can use the distribution package manager (e.g. `apt`):
81
+
82
+
```bash
83
+
sudo apt install git-crypt
84
+
```
85
+
86
+
To initialize a new repository with git-crypt, you can use `git-crypt init` when located in the repository directory. An already encrypted git repository can be unlocked by `git-crypt unlock`. This requires you to have either the repository encryption key in your GPG keychain, or that your private GPG key has been added to the allowed keys in the repository. For more details, see the links below.
87
+
88
+
For more information, check out the [official Github repository](https://github.com/AGWA/git-crypt). A tutorial on git-crypt can be found [here](https://thedatabaseme.de/2022/04/13/lets-keep-this-our-secret-transparent-git-encryption-using-git-crypt/).
89
+
90
+
## Example usage
22
91
23
92
### Create a Repository
24
93
Create a new local repository
@@ -288,18 +357,24 @@ A `.gitignore` file specifies intentionally untracked files that Git should igno
Copy file name to clipboardexpand all lines: tools/vagrant.md
+4
Original file line number
Diff line number
Diff line change
@@ -34,3 +34,7 @@ COMMAND | DESCRIPTION
34
34
`vagrant box outdated` | Check for updates vagrant box update
35
35
`vagrant box remove <BOXNAME>` | Deletes a box from the machine
36
36
`vagrant package` | Packages a running virtualbox env in a reusable box
37
+
38
+
## Vagrant with WSL2
39
+
40
+
Vagrant is able to run inside your Windows Subsystem for Linux environment. A tutorial on how to install and use it with your Windows installed Virtualbox can be found [here](https://thedatabaseme.de/2022/02/20/vagrant-up-running-vagrant-under-wsl2/).
With WSL2 it's possible to install and run a Linux desktop environment (XFCE). A tutorial on how to implement that, can be found [here](https://thedatabaseme.de/2022/05/15/shorty-running-xfce-linux-desktop-on-wsl2/).
0 commit comments