From 0e147a780e74b54afbd56ff7438077d855d5c1c2 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Fri, 10 Jun 2022 22:20:13 +0200 Subject: ref: Move from HTML to MD Keep and write in html is pain, so I'm rendering md as html. --- content/posts/2019-03-03Welcome_to_my_blog.html | 6 -- content/posts/2019-03-03Welcome_to_my_blog.md | 8 ++ ...ing_desktop_setup_with_ansible-pull_part-1.html | 94 ------------------- ...ating_desktop_setup_with_ansible-pull_part-1.md | 97 ++++++++++++++++++++ ...ing_desktop_setup_with_ansible-pull_part-2.html | 70 -------------- ...ating_desktop_setup_with_ansible-pull_part-2.md | 68 ++++++++++++++ ...Compiling_emacs_from_source_code_on_fedora.html | 31 ------- ...16Compiling_emacs_from_source_code_on_fedora.md | 31 +++++++ content/posts/2020-07-12Road_to_local_K8S.html | 101 --------------------- content/posts/2020-07-13Road_to_local_K8S.md | 73 +++++++++++++++ .../posts/2020-07-14Friz_box_turned_off_DHCP.html | 19 ---- .../posts/2020-07-14Friz_box_turned_off_DHCP.md | 10 ++ ...020-08-22Moving_from_Github_to_Gilab_pages.html | 38 -------- .../2020-08-22Moving_from_Github_to_Gilab_pages.md | 34 +++++++ ...2-28K8S_private_gitlab_registry_using_podman.md | 49 ++++++++++ content/posts/2021-12-26Enable_NFS_on_K3S.html | 61 ------------- content/posts/2021-12-26Enable_NFS_on_K3S.md | 56 ++++++++++++ ...28K8S_private_gitlab_registry_using_podman.html | 38 -------- 18 files changed, 426 insertions(+), 458 deletions(-) delete mode 100644 content/posts/2019-03-03Welcome_to_my_blog.html create mode 100644 content/posts/2019-03-03Welcome_to_my_blog.md delete mode 100644 content/posts/2019-03-07Automating_desktop_setup_with_ansible-pull_part-1.html create mode 100644 content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-1.md delete mode 100644 content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.html create mode 100644 content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.md delete mode 100644 content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.html create mode 100644 content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.md delete mode 100644 content/posts/2020-07-12Road_to_local_K8S.html create mode 100644 content/posts/2020-07-13Road_to_local_K8S.md delete mode 100644 content/posts/2020-07-14Friz_box_turned_off_DHCP.html create mode 100644 content/posts/2020-07-14Friz_box_turned_off_DHCP.md delete mode 100644 content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.html create mode 100644 content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.md create mode 100644 content/posts/2020-12-28K8S_private_gitlab_registry_using_podman.md delete mode 100644 content/posts/2021-12-26Enable_NFS_on_K3S.html create mode 100644 content/posts/2021-12-26Enable_NFS_on_K3S.md delete mode 100644 content/posts/2021-12-28K8S_private_gitlab_registry_using_podman.html (limited to 'content') diff --git a/content/posts/2019-03-03Welcome_to_my_blog.html b/content/posts/2019-03-03Welcome_to_my_blog.html deleted file mode 100644 index 10b1f05..0000000 --- a/content/posts/2019-03-03Welcome_to_my_blog.html +++ /dev/null @@ -1,6 +0,0 @@ -
-

- On this blog, I'll be posting some personal projects that I'm working on - or just logging stuff that I don't want to forget. -

-
diff --git a/content/posts/2019-03-03Welcome_to_my_blog.md b/content/posts/2019-03-03Welcome_to_my_blog.md new file mode 100644 index 0000000..a0ec118 --- /dev/null +++ b/content/posts/2019-03-03Welcome_to_my_blog.md @@ -0,0 +1,8 @@ +On this blog, I\'ll be posting some personal projects that I\'m working +on or just logging stuff that I don\'t want to forget. + +*Disclaimer*: English it\'s not my native language so if you find +something that you don\'t understand I\'d love you to open an +[issue](https://gitlab.com/gabrielgio/homestation/-/issuess), or if you +have something to add open a +[MR](phttps://gitlab.com/gabrielgio/homestation/-/merge_requests) diff --git a/content/posts/2019-03-07Automating_desktop_setup_with_ansible-pull_part-1.html b/content/posts/2019-03-07Automating_desktop_setup_with_ansible-pull_part-1.html deleted file mode 100644 index d06a648..0000000 --- a/content/posts/2019-03-07Automating_desktop_setup_with_ansible-pull_part-1.html +++ /dev/null @@ -1,94 +0,0 @@ -
-

- Every time that I do a clean install on my machine it takes a few hours till I - get to point where I was before formatting it, install all packages, select - themes, icons, fonts, install IDEs, extensions and so on. After doing it a few - times I came to the conclusion that I would save time by spending time - automating this chore, and as a result, I could tinker a little more with my - system and not worry about spending a weekend re-installing everything (which - have happened more time that I'd like to remember). -

-

- So after a few attempts using python and bash I ended with many files and - keep everything organized and concise turned out to be more tedious than the - setup itself. So there comes Ansible. - It is an enterprise-graded software used to automate tasks. It has A LOT OF - features and it can be really helpful if you're a sysadmin but for now we're - going to focuson - - Ansible Pull - - and - - Playbooks - . As better described: -

- [Ansible-Pull] is used to up a remote copy of ansible on each managed - node, each set to run via cron and update playbook source via a source - repository. This inverts the default push architecture of Ansible into a - pull architecture, which has near-limitless scaling potential. - - Playbooks are Ansible’s configuration, deployment, and orchestration - language. They can describe a policy you want your remote systems to - enforce, or a set of steps in a general IT process. - (source) -
-

-

- The goal is to pull and run a playbook remotely using a git repository. The - playbook will describe the tasks needed to setup our machine from scratch. -
- But first lets tinker a bit a with playbooks locally with ansible-playbook, - to do so we need to add localhost to ansible's hosts list. Add it to - /etc/ansible/hosts: -

[all]
-localhost
-

-

- As an experiment we're going to write a asks to install vim. Currently, I'm - using Fedora thus we going to use dnf modeule to install packages, but if - you're using another distribution look for a equivalent module like apt - module for Ubuntu. - - The playbook to install is quite simple: - -

# main.yaml
-- hosts: all
-  tasks:
-     - name: install vim
-       dnf:
-         name: vim
-         state: latest
-
-
host
-
it is required and it has to match our hosts otherwise the playbook won't run.
-
taks
-
- it is the list of tasks that the playbook will perform, in this case - will be dnf install vim. -
-
-

-

- To run a playbook use the command ansible-playbook commando to run main.yml - direct from disk, do to so just run the following command: -

sudo ansible-playbook --connection=local main.yml
-

-

- After a few seconds, vim will be installed on your machine. -

PLAY [all] *************************************************************
-
-TASK [Gathering Facts] *************************************************
-ok: [localhost]
-
-TASK [install vim] *****************************************************
-ok: [localhost]
-
-PLAY RECAP *************************************************************
-localhost                  : ok=2    changed=0    unreachable=0    failed=0
-

-

- This is the first step, next part we shall create a more complex playbook and - setup repository to run it remotely using ansible-pull. -

-
diff --git a/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-1.md b/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-1.md new file mode 100644 index 0000000..58ecb0d --- /dev/null +++ b/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-1.md @@ -0,0 +1,97 @@ +Every time that I do a clean install on my machine it takes a few hours +till I get to point where I was before formatting it, install all +packages, select themes, icons, fonts, install IDEs, extensions and so +on. After doing it a few times I came to the conclusion that I would +save time by spending time automating this chore, and as a result, I +could tinker a little more with my system and not worry about spending a +weekend re-installing everything (which have happened more time that + I\'d like to remember). + +So after a few attempts using python and bash I ended with many files +and keep everything organized and concise turned out to be more tedious +than the setup itself. So there comes +[Ansible](https://www.ansible.com/). It is an enterprise-graded software +used to automate tasks. It has A LOT OF features and it can be really +helpful if you\'re a sysadmin but for now we\'re going to focus on +[Ansible +Pull](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#ansible-pull) +and +[Playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html). +As better described: + +> \[Ansible-Pull\] is used to up a remote copy of ansible on each +> managed node, each set to run via cron and update playbook source via +> a source repository. This inverts the default push architecture of +> Ansible into a pull architecture, which has near-limitless scaling +> potential. +> +> Playbooks are Ansible's configuration, deployment, and orchestration +> language. They can describe a policy you want your remote systems to +> enforce, or a set of steps in a general IT process. +> +> [source](https://docs.ansible.com/ansible/latest/cli/ansible-pull.html) + +The goal is to pull and run a playbook remotely using a git repository. +The playbook will describe the tasks needed to setup our machine from +scratch. + +But first lets tinker a bit a with playbooks locally with +`ansible-playbook`, to do so we need to add `localhost` to ansible\'s +hosts list. Add it to `/etc/ansible/hosts`: + +``` service +[all] +localhost +``` + +As an experiment we\'re going to write a asks to install vim. Currently, + I\'m using [Fedora](https://getfedora.org/) thus we going to use [dnf + modeule](https://docs.ansible.com/ansible/latest/modules/dnf_module.html) + to install packages, but if you\'re using another distribution look for + a equivalent module like [apt + module](https://docs.ansible.com/ansible/latest/modules/apt_module.html) + for [Ubuntu](https://ubuntu.com/). + + The playbook to install is quite simple: + + ``` yaml +# main.yaml + - hosts: all + tasks: + - name: install vim + dnf: +name: vim +state: latest +``` + +`hosts:` is required and it has to match our hosts otherwise the +playbook won\'t run. + +`tasks:` is the list of tasks that the playbook will perform, in this +case will be `dnf install vim`. + +To run a playbook use the command `ansible-playbook` commando to run +`main.yml` direct from disk, do to so just run the following command: + + +``` bash +sudo ansible-playbook --connection=local main.yml +``` + +After a few seconds, vim will be installed on your machine. + +``` bash +PLAY [all] ************************************************************* + +TASK [Gathering Facts] ************************************************* +ok: [localhost] + +TASK [install vim] ***************************************************** +ok: [localhost] + +PLAY RECAP ************************************************************* +localhost : ok=2 changed=0 unreachable=0 failed=0 +``` + +This is the first step, next part we shall create a more complex +playbook and setup repository to run it remotely using `ansible-pull`. diff --git a/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.html b/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.html deleted file mode 100644 index 707ba7d..0000000 --- a/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.html +++ /dev/null @@ -1,70 +0,0 @@ -
- See part 1 -

- Now we're going to setup ansible to work with a git repository. The process is - quite similar to ansible-playbook, the only difference is that the source for - the playbook will be a remote repository and not a local file. Following the - previous example we'll get vim setup automated. -

-

- Create a git repository wherever you see - fit, gitlab - and github offer free repositories. For - this task we need to add only two file: one for the yml file describing the - tasks and the .vimrc file. -

-

- In the .vimrc add your own configuration, you can see - mine - - over here - , it is pretty simple as I don't use it but for simple text editing - (like this post) so you can start with that if you don't have one. -

-

- The yml file will have two tasks, one is to install vim, just like we did in the part 1. -

# main.yml
----
-- name: install vim
-  dnf:
-    name: vim
-    state: latest
-

-

- To copy .vimrc file to your $HOME we going to - use copy - module: -

-

- After we've added those two files to repository you will have be something - - like this. - -
- Parms: -

-

-

- Remember man is your best friend, take a look at man ansible-pull to know - more about its parameters. -

-

- The best part you can quickly test and see the result by running my sample: -

ansible-pull \
-    -U https://gitlab.com/gabrielgio/homestation.git \
-    -C debcf3458df511aef9f7dca0cb73f6cf6baddd5d \
-    -i all \
-    main.yml
-

-

- The idea here is to keep your repository as a source of truth when comes to - configuration, you can add ansible-pull to a CRON tab, so you just need to - push something to your repository and after a few minutes not only your - machine but all the machines that have it setup will run the playbooks. You - can use this method as a simple way to install software, update machines or - even distribute tooling company-wise. -

-
diff --git a/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.md b/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.md new file mode 100644 index 0000000..2e56463 --- /dev/null +++ b/content/posts/2019-04-22Automating_desktop_setup_with_ansible-pull_part-2.md @@ -0,0 +1,68 @@ +Now we\'re going to setup ansible to work with a git repository. The +process is quite similar to `ansible-playbook`, the only difference is +that the source for the playbook will be a remote repository and not a +local file. Following the previous example we\'ll get vim setup +automated. + +Create a git repository wherever you see fit, +[gitlab](https://about.gitlab.com/) and [github](https://github.com/) offer +free repositories. For this task we need to add only two file: one for the +`yml` file describing the tasks and the `.vimrc` file. + +In the `.vimrc` add your own configuration, you can see mine [over +here](https://gitlab.com/gabrielgio/homestation/-/blob/debcf3458df511aef9f7dca0cb73f6cf6baddd5d/.vimrc), +it is pretty simple as I don\'t use it but for simple text editing (like this +post) so you can start with that if you don\'t have one. + +The `yml` file will have two tasks, one is to install vim, just like we did in +the part 1. + +```yaml # main.yml --- +- name: install vim dnf: name: vim state: latest +``` + +To copy `.vimrc` file to your `$HOME` we going to use [copy +module](https://docs.ansible.com/ansible/latest/modules/copy_module.html): + +``` yaml +# main.yml +--- +- name: copy vimrc file + copy: + src: config/.vimrc + dest: ~/ + mode: 0644 +``` + +After we\'ve added those two files to repository you will have be something +[like +this](https://gitlab.com/gabrielgio/homestation/-/tree/debcf3458df511aef9f7dca0cb73f6cf6baddd5d). + +And now we just need to run `ansible-pull` command + +``` shell +# you may need run it as a sudo +ansible-pull -U $YOUR_REPO -i all main.yml +``` + +Params: + +- **`-i`** is a list of hosts. +- **`-U`** is the git repository URL. + +Remember `man` is your best friend, take a look at `man ansible-pull` to +know more about its parameters. + +The best part you can quickly test and see the result by running my +sample: + +``` shell +ansible-pull -U https://gitlab.com/gabrielgio/homestation.git -C debcf3458df511aef9f7dca0cb73f6cf6baddd5d -i all main.yml +``` + +The idea here is to keep your repository as a source of truth when comes to +configuration, you can add `ansible-pull` to a CRON tab, so you just need to +push something to your repository and after a few minutes not only your machine +but all the machines that have it setup will run the playbooks. You can use +this method as a simple way to install software, update machines or even +distribute tooling company-wise. diff --git a/content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.html b/content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.html deleted file mode 100644 index f47040f..0000000 --- a/content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.html +++ /dev/null @@ -1,31 +0,0 @@ -
-

- Compiling emacs from source and installing on fedora. -

-

Installing packages

-

- Install the following packages: -

sudo dnf install git autoconf make gcc texinfo \
-    gnutls-devel giflib-devel ncurses-devel \
-    libjpeg-turbo-devel giflib-devel gtk3-devel \
-    libXpm-devel libtiff-devel libxml2-devel -y
-

-

Cloning Repository

-

- Clone repository - savannah.gnu.org -

git clone -b master git://git.sv.gnu.org/emacs.git
-

-

Compiling

-

- Navigate to the emacs folder cd emacs and execute the following - steps: -

./autogen.sh
-./configure
-make -j$(nproc)
-sudo make install
-
- After verify version with ./emacs --version, it - should be equal or higher than 28.0.50. -

-
diff --git a/content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.md b/content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.md new file mode 100644 index 0000000..d316f40 --- /dev/null +++ b/content/posts/2019-11-16Compiling_emacs_from_source_code_on_fedora.md @@ -0,0 +1,31 @@ +Compiling emacs from source and installing on fedora. + +# Installing Packages + +Install the following packages: + + sudo dnf install git autoconf make gcc texinfo \ + gnutls-devel giflib-devel ncurses-devel \ + libjpeg-turbo-devel giflib-devel gtk3-devel \ + libXpm-devel libtiff-devel libxml2-devel -y + +# Cloning Repository + +Clone repository +[savannah.gnu.org](http://savannah.gnu.org/projects/emacs/): + + git clone -b master git://git.sv.gnu.org/emacs.git + +# Compiling + +Navigate to emacs folder (`cd emacs`) and execute the following steps + +```shell +./autogen.sh +./configure +make -j$(nproc) +sudo make install +``` + +After verify version with `emacs --version`, it should be equal or +higher than `28.0.50`{.verbatim}. diff --git a/content/posts/2020-07-12Road_to_local_K8S.html b/content/posts/2020-07-12Road_to_local_K8S.html deleted file mode 100644 index 52820b3..0000000 --- a/content/posts/2020-07-12Road_to_local_K8S.html +++ /dev/null @@ -1,101 +0,0 @@ -
-

Goal

-

- The goal is to deploy kubernetes on my local networks, and keep everything - as reproducible as possible. -

-

Stack

-

- I'll use Fedora Core OS, Matchbox and Terraform - 1, a match the requirements for - Tectonic2.

-

Steps

- -

Network Setup DHCP/TFTP/DNS

-

First learning the basics

- -

- To check open ports -

lsof -Pni | grep LISTEN
-

-

- Run the provided6 image with dnsmasq and - PXE toolkit -

docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \
-  -d -q \
-  --dhcp-range=192.168.1.3,192.168.1.254 \
-  --enable-tftp --tftp-root=/var/lib/tftpboot \
-  --dhcp-match=set:bios,option:client-arch,0 \
-  --dhcp-boot=tag:bios,undionly.kpxe \
-  --dhcp-match=set:efi32,option:client-arch,6 \
-  --dhcp-boot=tag:efi32,ipxe.efi \
-  --dhcp-match=set:efibc,option:client-arch,7 \
-  --dhcp-boot=tag:efibc,ipxe.efi \
-  --dhcp-match=set:efi64,option:client-arch,9 \
-  --dhcp-boot=tag:efi64,ipxe.efi \
-  --dhcp-userclass=set:ipxe,iPXE \
-  --dhcp-boot=tag:ipxe,http://matchbox.example.com:8080/boot.ipxe \
-  --address=/matchbox.example/192.168.1.2 \
-  --log-queries \
-  --log-dhcp
-

-

Matchbox

-

...

-

PXE network boot enviroment

-

...

-

Terraform Tectonic

-

...

-

Links

-
- 1 - - https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html - -
-
- 2 - - https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html - -
diff --git a/content/posts/2020-07-13Road_to_local_K8S.md b/content/posts/2020-07-13Road_to_local_K8S.md new file mode 100644 index 0000000..a3ca530 --- /dev/null +++ b/content/posts/2020-07-13Road_to_local_K8S.md @@ -0,0 +1,73 @@ +# Goal + +The goal is to deploy kubernetes on my local networks, and keep +everything as reproducible as possible. + +# Stack + +I\'ll use Fedora Core OS, Matchbox and Terraform [^1], a match the +requirements for Tectonic [^2] + +## Steps + +- Network Setup DHCP/TFTP/DNS [^3] +- Matchbox [^4] +- PXE network boot environment +- Terraform Tectonic [^5] + +## Network Setup DHCP/TFTP/DNS + +First learning the basics again: + +- +- + +To check open ports + +``` {.bash org-language="sh"} +lsof -Pni | grep LISTEN +``` + +Run the provided [^6] image with `dnsmasq` and PXE toolkit + +``` {.bash org-language="sh"} +docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \ + -d -q \ + --dhcp-range=192.168.1.3,192.168.1.254 \ + --enable-tftp --tftp-root=/var/lib/tftpboot \ + --dhcp-match=set:bios,option:client-arch,0 \ + --dhcp-boot=tag:bios,undionly.kpxe \ + --dhcp-match=set:efi32,option:client-arch,6 \ + --dhcp-boot=tag:efi32,ipxe.efi \ + --dhcp-match=set:efibc,option:client-arch,7 \ + --dhcp-boot=tag:efibc,ipxe.efi \ + --dhcp-match=set:efi64,option:client-arch,9 \ + --dhcp-boot=tag:efi64,ipxe.efi \ + --dhcp-userclass=set:ipxe,iPXE \ + --dhcp-boot=tag:ipxe,http://matchbox.example.com:8080/boot.ipxe \ + --address=/matchbox.example/192.168.1.2 \ + --log-queries \ + --log-dhcp +``` + +## Matchbox + +## PXE network boot environment + +## Terraform Tectonic + +------------------------------------------------------------------------ + +# Links + +[^1]: + +[^2]: + +[^3]: + +[^4]: + +[^5]: + +[^6]: diff --git a/content/posts/2020-07-14Friz_box_turned_off_DHCP.html b/content/posts/2020-07-14Friz_box_turned_off_DHCP.html deleted file mode 100644 index 3ee5daf..0000000 --- a/content/posts/2020-07-14Friz_box_turned_off_DHCP.html +++ /dev/null @@ -1,19 +0,0 @@ -
-

- If you turned off your DHCP server follow these steps to connect to - FritzBox settings.
-

    -
  • - Set your computer IP to 170.254.1.2 and your mask to 255.255.0.0 -
  • -
  • Then go to 169.254.1.1, login and re-enable the DHCP server:
  • -
-

-

- On gnome turn the wired connection off on again to apply the settings. -

-

- Note: why in the hell does FritzBox 7490 require a - land-line telephone to be physically factory reset? -

-
diff --git a/content/posts/2020-07-14Friz_box_turned_off_DHCP.md b/content/posts/2020-07-14Friz_box_turned_off_DHCP.md new file mode 100644 index 0000000..865067f --- /dev/null +++ b/content/posts/2020-07-14Friz_box_turned_off_DHCP.md @@ -0,0 +1,10 @@ +If you turned off your DHCP server follow these steps to connect to +FritzBox settings. + +- Set your computer IP to `169.254.1.2` and your mask to `255.255.0.0` +- Then go to `169.254.1.1`, login and re-enable the DHCP server. + +On gnome turn the wired connection off on again to apply the settings. + +Note: why in the hell does FritzBox 7490 require a land-line telephone +to be physically factory reset? diff --git a/content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.html b/content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.html deleted file mode 100644 index 5fb1d78..0000000 --- a/content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.html +++ /dev/null @@ -1,38 +0,0 @@ -
-

- This was quite simple, I had just to create a simple Gitlab pipeline job and - publish to pages this is done by: -

-
image: clojure:lein-2.7.0
-
-before_script:
-  - lein deps
-
-test:
-  script:
-    - lein test
-
-pages:
-  stage: deploy
-  script:
-    - lein package
-  artifacts:
-    paths:
-      - public
-  only:
-    - master
-
-
before_script
-
will download all the dependencies with lein deps.
-
test
-
it is self explanatory
-
pages
-
- it will compile cljs into js with lein package into - public folder to later be published into gitlab pages. Take a - look at the artifacts property, it is used to say wich will - will be collected. -
-
- -
diff --git a/content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.md b/content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.md new file mode 100644 index 0000000..f971a75 --- /dev/null +++ b/content/posts/2020-08-22Moving_from_Github_to_Gilab_pages.md @@ -0,0 +1,34 @@ +--- title: \"Moving from Github to Gitlab pages\" date: 2020-08-22 tags: +\[\'gitlab\'\] --- + +This was quite simple, I had just to create a simple Gitlab pipeline job +and publish to pages this is done by: + + image: clojure:lein-2.7.0 + + before_script: + - lein deps + + test: + script: + - lein test + + pages: + stage: deploy + script: + - lein package + artifacts: + paths: + - public + only: + - master + +before~script~ +: will download all the dependencies with `lein deps`. + +test +: is self explanatory. + +pages +: will compile the cljs into js with `lein package` and publish it + into pages. diff --git a/content/posts/2020-12-28K8S_private_gitlab_registry_using_podman.md b/content/posts/2020-12-28K8S_private_gitlab_registry_using_podman.md new file mode 100644 index 0000000..c72e9ac --- /dev/null +++ b/content/posts/2020-12-28K8S_private_gitlab_registry_using_podman.md @@ -0,0 +1,49 @@ +This is based on [Log in to Docker +Hub](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). +It is just a bit different to use podman + +First we should take a look at podman-login man page: + +``` bash +man podman login +``` + +It will give some valueable information like the location of auth.json +file. Now we can login using podman: + +``` bash +podman login registry.gitlab.com +``` + +Then check the `auth.json` file located at +`${XDG_RUNTIME_DIR}/containers/auth.json` (as described by the manual). + +``` bash +cat "${XDG_RUNTIME_DIR}/containers/auth.json" +``` + +It will print your auth config: + +``` json +{ + "auths": { + "registry.gitlab.com": { + "auth": "..." + } + } +} +``` + +Now copy that file over to the server and register it in k8s with the +following command: + +``` bash +kubectl create secret generic regcred \ + --from-file=.dockerconfigjson=auth.json \ + --type=kubernetes.io/dockerconfigjson +``` + +Once you have created you can list by `kubectl get secret`: + + NAME TYPE DATA AGE + regcred kubernetes.io/dockerconfigjson 1 53s diff --git a/content/posts/2021-12-26Enable_NFS_on_K3S.html b/content/posts/2021-12-26Enable_NFS_on_K3S.html deleted file mode 100644 index 22ddf33..0000000 --- a/content/posts/2021-12-26Enable_NFS_on_K3S.html +++ /dev/null @@ -1,61 +0,0 @@ -
-

- By default K3S comes only - with local-path - storage class, and if you are running with more than one node in your - cluster you may want to use a more “distributed” solution. - For may case I opted for NFS. -

-

- To check the current storage class you can run: -

-
k3s kubectl get storageclasses
-

- And it will print something like: -

-
NAME                   PROVISIONER                                     RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
-local-path (default)   rancher.io/local-path                           Delete          WaitForFirstConsumer   false                  154d
-

- To start adding First you need to - install helm on your server. - To do so you may run: -

- -
curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
-

- Be careful when running scripts directly into bash always check the - source Sometimes is also recommended to do not pipe directly to bash -

-

- Once it is installed we need to add - the NFS - storage classes. It has two providers, I have - chose NFS - Subdir External Provisioner. -

-

- Add the helm repo -

- -
helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
-

- Then we need to actually install the provider -

-
-
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner
---set nfs.server=x.x.x.x
---set nfs.path=/exported/path
-
-

- Set the nfs.server and nfs.path accordingly - with your setup. -

-

- After that if we run k3s kubectl get storageclasses it will - now print another NFS provider: -

- -
NAME                   PROVISIONER                                     RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
-local-path (default)   rancher.io/local-path                           Delete          WaitForFirstConsumer   false                  154d
-nfs-client             cluster.local/nfs-subdir-external-provisioner   Delete          Immediate              true                   76m
-
diff --git a/content/posts/2021-12-26Enable_NFS_on_K3S.md b/content/posts/2021-12-26Enable_NFS_on_K3S.md new file mode 100644 index 0000000..426bf3d --- /dev/null +++ b/content/posts/2021-12-26Enable_NFS_on_K3S.md @@ -0,0 +1,56 @@ +By default [K3S](https://k3s.io/) comes only with +[local-path](https://github.com/rancher/local-path-provisioner) storage +class, and if you are running with more than one node in your cluster +you may want to use a more \"distributed\" solution. For may case I +opted for NFS. + +To check the current storage class you can run: + +``` bash +k3s kubectl get storageclasses +``` + +And it will print something like: + + NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE + local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d + +To start adding First you need to install +[helm](https://github.com/helm/helm) on your server. To do so you may +run: + +``` bash +curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash +``` + +**Be careful when running scripts directly into bash always check the +source** **Sometimes is also recommended to do not pipe directly to +bash** + +Once it is installed we need to add the [NFS storage +classes](https://kubernetes.io/docs/concepts/storage/storage-classes/#nfs). +It has two providers, I have chose [NFS Subdir External +Provisioner](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner). + +Add the helm repo + +``` bash +helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/ +``` + +Then we need to actually install the provider + +``` bash +helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \ + --set nfs.server=x.x.x.x \ + --set nfs.path=/exported/path +``` + +Set the `nfs.server` and `nfs.path` accordingly with your setup. + +After that if we run `k3s kubectl get storageclasses` it will now print +another NFS provider: + + NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE + local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d + nfs-client cluster.local/nfs-subdir-external-provisioner Delete Immediate true 76m diff --git a/content/posts/2021-12-28K8S_private_gitlab_registry_using_podman.html b/content/posts/2021-12-28K8S_private_gitlab_registry_using_podman.html deleted file mode 100644 index 470965c..0000000 --- a/content/posts/2021-12-28K8S_private_gitlab_registry_using_podman.html +++ /dev/null @@ -1,38 +0,0 @@ -
-

- This is based on Log in to - Docker Hub. It is just a bit different to use podman. -

-

- First we should take a look at podman-login man page: -

man podman login
-

-

- It will give some valueable information like the location of auth.json file. Now we can login using podman: -

podman login registry.gitlab.com
-

-

Then check the auth.json file located at ${XDG_RUNTIME_DIR}/containers/auth.json (as described - by the manual). It will contain your auth config: -

{
-	"auths": {
-		"registry.gitlab.com": {
-			"auth": "..."
-		}
-	}
-}
-

-

- Now copy that file over to the server and register it in k8s with the following command: -


-kubectl create secret generic regcred \
-    --from-file=.dockerconfigjson=auth.json \
-    --type=kubernetes.io/dockerconfigjson
-

-

- Once you have created you can list by kubectl get secret: -


-NAME     TYPE                                  DATA   AGE
-regcred  kubernetes.io/dockerconfigjson        1      53s
-

-
-- cgit v1.2.3