mirror of
https://github.com/funkypenguin/geek-cookbook/
synced 2025-12-13 01:36:23 +00:00
Use mkdocs snippets to template common content blocks (#135)
This commit is contained in:
@@ -87,9 +87,8 @@ A day after writing this, my environment suffered a fault whereby all 3 VMs were
|
||||
|
||||
Upon restore, docker failed to start on one of the VMs due to local disk space issue[^1]. However, the other two VMs started, established the swarm, mounted their shared storage, and started up all the containers (services) which were managed by the swarm.
|
||||
|
||||
In summary, although I suffered an **unplanned power outage to all of my infrastructure**, followed by a **failure of a third of my hosts**... ==all my platforms are 100% available with **absolutely no manual intervention**==.
|
||||
In summary, although I suffered an **unplanned power outage to all of my infrastructure**, followed by a **failure of a third of my hosts**... ==all my platforms are 100% available[^1] with **absolutely no manual intervention**==.
|
||||
|
||||
[^1]: Since there's no impact to availability, I can fix (or just reinstall) the failed node whenever convenient.
|
||||
|
||||
|
||||
## Chef's Notes 📓
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -167,6 +167,8 @@ Launch shepherd by running ```docker stack deploy shepherd -c /var/data/config/s
|
||||
|
||||
## Summary
|
||||
|
||||
--8<-- "5-min-install.md"
|
||||
|
||||
What have we achieved?
|
||||
|
||||
!!! summary "Summary"
|
||||
@@ -174,7 +176,4 @@ What have we achieved?
|
||||
|
||||
* [X] [Docker swarm cluster](/ha-docker-swarm/design/)
|
||||
|
||||
|
||||
--8<-- "5-min-install.md"
|
||||
|
||||
## Chef's Notes 📓
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -81,8 +81,7 @@ What have we achieved?
|
||||
|
||||
--8<-- "5-min-install.md"
|
||||
|
||||
|
||||
## Chef's notes 📓
|
||||
|
||||
[^1]: Some hosting platforms (*OpenStack, for one*) won't allow you to simply "claim" a virtual IP. Each node is only able to receive traffic targetted to its unique IP, unless certain security controls are disabled by the cloud administrator. In this case, keepalived is not the right solution, and a platform-specific load-balancing solution should be used. In OpenStack, this is Neutron's "Load Balancer As A Service" (LBAAS) component. AWS, GCP and Azure would likely include similar protections.
|
||||
[^2]: More than 2 nodes can participate in keepalived. Simply ensure that each node has the appropriate priority set, and the node with the highest priority will become the master.
|
||||
[^2]: More than 2 nodes can participate in keepalived. Simply ensure that each node has the appropriate priority set, and the node with the highest priority will become the master.
|
||||
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -1,83 +0,0 @@
|
||||
# Introduction
|
||||
|
||||
## Adding a host
|
||||
|
||||
## Adding storage
|
||||
|
||||
gluster volume add-brick VOLNAME NEW_BRICK
|
||||
|
||||
example
|
||||
|
||||
# gluster volume add-brick test-volume server4:/exp4
|
||||
Add Brick successful
|
||||
|
||||
# Replacing failed host
|
||||
|
||||
Followed https://access.redhat.com/documentation/en-US/Red_Hat_Storage/3/html/Administration_Guide/sect-Replacing_Hosts.html
|
||||
|
||||
|
||||
[root@glusterfs-server /]# gluster peer status
|
||||
Number of Peers: 1
|
||||
|
||||
Hostname: ds1
|
||||
Uuid: db9c80da-11e4-461d-8ea5-66dd12ca897c
|
||||
State: Peer in Cluster (Disconnected)
|
||||
[root@glusterfs-server /]#
|
||||
|
||||
Grab UUID above
|
||||
|
||||
edit /var/lib/glusterd/glusterd.info
|
||||
change:
|
||||
UUID=aee45c2c-aa19-4d29-bc94-4833f2b22863
|
||||
to
|
||||
UUID=db9c80da-11e4-461d-8ea5-66dd12ca897c
|
||||
|
||||
My peer's id (ds2):
|
||||
[root@glusterfs-server /]# gluster system:: uuid get
|
||||
UUID: 38ca4e8b-8ef5-4165-9f41-5c8b3f0103cc
|
||||
[root@glusterfs-server /]#
|
||||
|
||||
vi /var/lib/glusterd/peers/38ca4e8b-8ef5-4165-9f41-5c8b3f0103cc
|
||||
|
||||
UUID=38ca4e8b-8ef5-4165-9f41-5c8b3f0103cc
|
||||
state=3
|
||||
hostname=ds3
|
||||
|
||||
|
||||
|
||||
Got volume info
|
||||
|
||||
|
||||
[root@glusterfs-server /]# gluster volume info
|
||||
|
||||
Volume Name: gv0
|
||||
Type: Replicate
|
||||
Volume ID: 84e1169c-41dc-467a-9ae1-a474efaf789f
|
||||
Status: Started
|
||||
Snapshot Count: 0
|
||||
Number of Bricks: 1 x 2 = 2
|
||||
Transport-type: tcp
|
||||
Bricks:
|
||||
Brick1: ds1:/var/no-direct-write-here/brick1/gv0
|
||||
Brick2: ds3:/var/no-direct-write-here/brick1/gv0
|
||||
Options Reconfigured:
|
||||
nfs.disable: on
|
||||
transport.address-family: inet
|
||||
[root@glusterfs-server /]#
|
||||
|
||||
|
||||
|
||||
----
|
||||
[root@glusterfs-server /]# getfattr -d -m. -ehex /var/no-direct-write-here/brick1/gv0/
|
||||
getfattr: Removing leading '/' from absolute path names
|
||||
# file: var/no-direct-write-here/brick1/gv0/
|
||||
security.selinux=0x73797374656d5f753a6f626a6563745f723a756e6c6162656c65645f743a733000
|
||||
trusted.gfid=0x00000000000000000000000000000001
|
||||
trusted.glusterfs.dht=0x000000010000000000000000ffffffff
|
||||
trusted.glusterfs.volume-id=0x84e1169c41dc467a9ae1a474efaf789f
|
||||
|
||||
[root@glusterfs-server /]#
|
||||
|
||||
|
||||
|
||||
setfattr -n trusted.glusterfs.volume-id -v 0x84e1169c41dc467a9ae1a474efaf789f /var/no-direct-write-here/brick1/gv0
|
||||
@@ -76,4 +76,4 @@ After completing the above, you should have:
|
||||
* At least 20GB disk space (_but it'll be tight_)
|
||||
* [X] Connectivity to each other within the same subnet, and on a low-latency link (_i.e., no WAN links_)
|
||||
|
||||
## Chef's Notes 📓
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -110,4 +110,4 @@ systemctl restart docker-latest
|
||||
!!! tip ""
|
||||
Note the extra comma required after "false" above
|
||||
|
||||
## Chef's notes 📓
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -39,6 +39,8 @@ mkdir -p /etc/ceph
|
||||
|
||||
The process takes about 30 seconds, after which, you'll have a MVC (*Minimum Viable Cluster*)[^1], encompassing a single monitor and mgr instance on your chosen node. Here's the complete output from a fresh install:
|
||||
|
||||
[^1]: Minimum Viable Cluster acronym copyright, trademark, and whatever else, to Funky Penguin for 1,000,000 years.
|
||||
|
||||
??? "Example output from a fresh cephadm bootstrap"
|
||||
```
|
||||
root@raphael:~# MYIP=`ip route get 1.1.1.1 | grep -oP 'src \K\S+'`
|
||||
@@ -216,9 +218,7 @@ What have we achieved?
|
||||
* [X] Resiliency in the event of the failure of a single node
|
||||
* [X] Beautiful dashboard
|
||||
|
||||
## The easy, 5-minute install
|
||||
|
||||
I share (_with [sponsors][github_sponsor] and [patrons][patreon]_) a private "_premix_" GitHub repository, which includes an ansible playbook for deploying the entire Geek's Cookbook stack, automatically. This means that members can create the entire environment with just a ```git pull``` and an ```ansible-playbook deploy.yml``` 👍
|
||||
--8<-- "5-min-install.md"
|
||||
|
||||
Here's a screencast of the playbook in action. I sped up the boring parts, it actually takes ==5 min== (*you can tell by the timestamps on the prompt*):
|
||||
|
||||
@@ -226,6 +226,8 @@ Here's a screencast of the playbook in action. I sped up the boring parts, it ac
|
||||
[patreon]: https://www.patreon.com/bePatron?u=6982506
|
||||
[github_sponsor]: https://github.com/sponsors/funkypenguin
|
||||
|
||||
## Chef's Notes 📓
|
||||
|
||||
[^1]: Minimum Viable Cluster acronym copyright, trademark, and whatever else, to Funky Penguin for 1,000,000 years.
|
||||
|
||||
|
||||
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -164,9 +164,8 @@ After completing the above, you should have:
|
||||
* [X] Persistent storage available to every node
|
||||
* [X] Resiliency in the event of the failure of a single (gluster) node
|
||||
|
||||
## Chef's Notes 📓
|
||||
[^1]: Future enhancements to this recipe include:
|
||||
1. Migration of shared storage from GlusterFS to Ceph ()[#2](https://gitlab.funkypenguin.co.nz/funkypenguin/geeks-cookbook/issues/2))
|
||||
2. Correct the fact that volumes don't automount on boot ([#3](https://gitlab.funkypenguin.co.nz/funkypenguin/geeks-cookbook/issues/3))
|
||||
|
||||
Future enhancements to this recipe include:
|
||||
|
||||
1. Migration of shared storage from GlusterFS to Ceph ()[#2](https://gitlab.funkypenguin.co.nz/funkypenguin/geeks-cookbook/issues/2))
|
||||
2. Correct the fact that volumes don't automount on boot ([#3](https://gitlab.funkypenguin.co.nz/funkypenguin/geeks-cookbook/issues/3))
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -83,10 +83,7 @@ If you're not confident that forward authentication is working, add a simple "wh
|
||||
- traefik.frontend.auth.forward.trustForwardHeader=true
|
||||
```
|
||||
|
||||
!!! tip
|
||||
I share (_with my [sponsors](https://github.com/sponsors/funkypenguin)_) a private "_premix_" git repository, which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a ```git pull``` and a ```docker stack deploy``` 👍
|
||||
|
||||
|
||||
--8<-- "premix-cta.md"
|
||||
|
||||
## Serving
|
||||
|
||||
@@ -107,9 +104,7 @@ What have we achieved? By adding an additional three simple labels to any servic
|
||||
|
||||
* [X] Traefik-forward-auth configured to authenticate against an OIDC provider
|
||||
|
||||
[^1]: Traefik forward auth replaces the use of [oauth_proxy containers](/reference/oauth_proxy/) found in some of the existing recipes
|
||||
[^2]: I reviewed several implementations of forward authenticators for Traefik, but found most to be rather heavy-handed, or specific to a single auth provider. @thomaseddon's go-based docker image is 7MB in size, and can be extended to work with any OIDC provider.
|
||||
|
||||
|
||||
## Chef's Notes 📓
|
||||
|
||||
1. Traefik forward auth replaces the use of [oauth_proxy containers](/reference/oauth_proxy/) found in some of the existing recipes
|
||||
2. I reviewed several implementations of forward authenticators for Traefik, but found most to be rather heavy-handed, or specific to a single auth provider. @thomaseddon's go-based docker image is 7MB in size, and can be extended to work with any OIDC provider.
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -80,8 +80,7 @@ If you're not confident that forward authentication is working, add a simple "wh
|
||||
- traefik.frontend.auth.forward.trustForwardHeader=true
|
||||
```
|
||||
|
||||
!!! tip
|
||||
I share (_with my [sponsors](https://github.com/sponsors/funkypenguin)_) a private "_premix_" git repository, which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a `git pull` and a `docker stack deploy` 👍
|
||||
--8<-- "premix-cta.md"
|
||||
|
||||
## Serving
|
||||
|
||||
@@ -114,6 +113,6 @@ Created:
|
||||
|
||||
* [X] Traefik-forward-auth configured to authenticate against KeyCloak
|
||||
|
||||
## Chef's Notes 📓
|
||||
[^1]: KeyCloak is very powerful. You can add 2FA and all other clever things outside of the scope of this simple recipe ;)
|
||||
|
||||
1. KeyCloak is very powerful. You can add 2FA and all other clever things outside of the scope of this simple recipe ;)
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -103,9 +103,7 @@ networks:
|
||||
- subnet: 172.16.200.0/24
|
||||
```
|
||||
|
||||
!!! tip
|
||||
I share (_with my [sponsors](https://github.com/sponsors/funkypenguin)_) a private "_premix_" git repository, which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a ```git pull``` and a ```docker stack deploy``` 👍
|
||||
|
||||
--8<-- "premix-cta.md"
|
||||
|
||||
Create `/var/data/config/traefik/traefik-app.yml` as follows:
|
||||
|
||||
@@ -203,7 +201,7 @@ ID NAME IMAGE
|
||||
|
||||
### Check Traefik Dashboard
|
||||
|
||||
You should now be able to access your traefik instance on http://<node IP\>:8080 - It'll look a little lonely currently (*below*), but we'll populate it as we add recipes :)
|
||||
You should now be able to access[^1] your traefik instance on http://<node IP\>:8080 - It'll look a little lonely currently (*below*), but we'll populate it as we add recipes :)
|
||||
|
||||

|
||||
|
||||
@@ -216,7 +214,6 @@ You should now be able to access your traefik instance on http://<node IP\>:8080
|
||||
* [X] Frontend proxy which will dynamically configure itself for new backend containers
|
||||
* [X] Automatic SSL support for all proxied resources
|
||||
|
||||
[^1]: Did you notice how no authentication was required to view the Traefik dashboard? Eek! We'll tackle that in the next section, regarding [Traefik Forward Authentication](/ha-docker-swarm/traefik-forward-auth/)!
|
||||
|
||||
## Chef's Notes 📓
|
||||
|
||||
1. Did you notice how no authentication was required to view the Traefik dashboard? Eek! We'll tackle that in the next section, regarding [Traefik Forward Authentication](/ha-docker-swarm/traefik-forward-auth/)!
|
||||
--8<-- "recipe-footer.md"
|
||||
Reference in New Issue
Block a user