33e9adae1c5b4d888f900815f35ce745dcba2e7a
wiki/info/landscape/amazon-ec2.md
| ... | ... | @@ -60,6 +60,8 @@ The webserver is registered as target in various locations: |
| 60 | 60 | * as regular instance target in all load balancers' default rule's target group, such as ``DefDynsapsailing-com``, ``DNSMapped-0``, ``DNSMapped-1``, and so on; the names of the target groups are ``CentralWebServerHTTP-Dyn``, ``DDNSMapped-0-HTTP``, ``DDNSMapped-1-HTTP``, and so on, respectively. |
| 61 | 61 | * as target of the elastic IP address ``54.229.94.254`` |
| 62 | 62 | |
| 63 | +Note that the elastic IP address ``54.229.94.254`` is in turn the target of the DNS record ``mail.sapsailing.com`` as well as the ``TXT`` DNS record for ``sapsailing.com`` for SPF e-mail validation. |
|
| 64 | + |
|
| 63 | 65 | Furthermore, it is helpful to ensure that the ``/internal-server-status`` path will resolve correctly to the Apache httpd server status page. For this, the ``/etc/httpd/conf.d/001-events.conf`` file contains three rules at the very beginning: |
| 64 | 66 | |
| 65 | 67 | ``` |
| ... | ... | @@ -71,6 +73,10 @@ Use Status 127.0.0.1 internal-server-status |
| 71 | 73 | |
| 72 | 74 | The second obviously requires maintenance as the internal IP changes, e.g., when instantiating a new Webserver copy by creating an image and restoring from the image. When upgrading / moving / copying the webserver you may try to be smart and copy the contents of ``/etc/ssh``, in particular the ``ssh_host_...`` files that contain the host keys. As you switch, users will then not have to upgrade their ``known_hosts`` file, and even internal accounts such as the Wiki account or the sailing accounts on other hosts that clone the git, or the build infrastructure won't be affected. |
| 73 | 75 | |
| 76 | +After (re-)booting the webserver, check that all services have come up before adding the instance to its respective target groups. For example, ensure that the Wiki "Gollum" service has been launched (see ``/home/wiki/serve.sh``). Furthermore, ensure that the Docker daemon is running and that it runs the Docker registry containers (``registry-ui-1`` and ``registry-registry-1``). See [here](https://wiki.sapsailing.com/wiki/info/landscape/docker-registry) for how this is set up. |
|
| 77 | + |
|
| 78 | +The webserver must be tagged with key ``CentralReverseProxy`` where the value is ignored, but ``true`` is a good default. |
|
| 79 | + |
|
| 74 | 80 | ### DNS and Application Load Balancers (ALBs) |
| 75 | 81 | |
| 76 | 82 | We distinguish between DNS-mapped and non-DNS-mapped content. The basic services offered by the web server as listed above are DNS-mapped, with the DNS entries being CNAME records pointing to an ALB (DNSMapped-0-1286577811.eu-west-1.elb.amazonaws.com) which handles SSL offloading with the Amazon-managed certificate and forwards those requests to the web server. Furthermore, longer-running application replica sets can have a sub-domain declared in Route53's DNS, pointing to an ALB which then forwards to the public and master target groups for this replica set based on hostname, header fields and request method. A default redirect for the ``/`` path can also be defined, obsoleting previous Apache httpd reverse proxy redirects for non-archived ALB-mapped content. |
wiki/info/landscape/docker-registry.md
| ... | ... | @@ -98,7 +98,16 @@ To run a garbage collection in the registry, try this: |
| 98 | 98 | docker exec -it registry-registry-1 registry garbage-collect /etc/docker/registry/config.yml |
| 99 | 99 | ``` |
| 100 | 100 | |
| 101 | +This process is automated by adding the line |
|
| 102 | + |
|
| 103 | +``` |
|
| 104 | + 0 7 2 * * export PATH=/bin:/usr/bin:/usr/local/bin; docker exec -it registry-registry-1 registry garbage-collect /etc/docker/registry/config.yml |
|
| 105 | +``` |
|
| 106 | + |
|
| 107 | +to /root/crontab and running ``crontab crontab`` as the ``root`` user. See also ``crontab -l`` for whether this has already been set up. |
|
| 108 | + |
|
| 101 | 109 | If you want to delete an entire repository, e.g., because you pushed images under an incorrect repository tag, try this: |
| 102 | 110 | ``` |
| 103 | 111 | docker exec -it registry-registry-1 rm -rf /var/lib/registry/docker/registry/v2/repositories/{your-repository-name} |
| 104 | 112 | ``` |
| 113 | + |