Hosting infrastructure & DevOps blueprint 🥳
hosty deploy deploys the images that hosty build --push built for the code, found in the image repository,
instead of looking up the latest releases of the base images on Docker Hub again. When Wodby published a release
between the build and the deployment, or Docker Hub listed it to one of them only, the deployment looked for an
image that nobody built and failed with "Image ... is not available on Hosty", until the build ran again. Of several
images built for the code, i.e. on two releases of the base image, the last pushed one is deployed; images of
another version than the one in Hosty.yaml are not. Run tofu apply, which lets users and CI list the images
(ecr:DescribeImages): until then, Hosty CLI warns and looks up the base images on Docker Hub as before.version: "22" of Node.js, images are built on the releases of Wodby
(22.23.5-r0) only, not on the tags of the version lines (22.23-r14), which Wodby publishes a few minutes before
the release of the same build: the images of an application were built twice.tofu apply.tofu apply, which changes the
configuration of CoreDNS without restarting it.tofu apply.ecr:GetDownloadUrlForLayer, as the image of nginx or Apache is built from the image of the application. Run
tofu apply.hosts for it. The domain generated for an environment points to the load balancer of development
environments, so production never answered on it.port of Node.js other than 3000. The load balancers and the network policies of the cluster
reach Node.js on that port only, and the setting was ignored anyway.features of an application is no longer checked: it wasn't used for anything.terraform/main.tf.example is a template of main.tf for new installs, as main.tf belongs to the install of
SystemSeed.docs/ of the repository, which Archbee publishes on every push to main.application-data-backup of production, which writes and
deletes the backups of a project. An admission policy refuses deployments, single pods and jobs with it, unless a job
is a backup: the lifecycle image, a backup command, the lifecycle scripts and the storages of the environment, as the
cron job of backups and hosty backup:create make. Lead developers could run any command of their image with it in a
job, and CI could put it on any pod.--delete, can be restored for
that time. Run tofu apply before the next backups.database-admin is
created, i.e. on a new cluster: a new role takes some seconds to reach all of AWS, and the first pod of each job failed
with AccessDenied, leaving a pod with an error in hosty-system next to the one that succeeded. tofu apply creates
the pause once on existing clusters, without running the jobs again.wodby/php:8.4) is compared with the one in
the release (8.4.27-r4). When Wodby changed how it names releases, Hosty kept finding the last release named the old
way, and a fix of a vulnerability of PHP didn't get to production. A newer version with tags of its own that Hosty
doesn't recognise now stops the command; a newer version that Wodby hasn't released yet only gives a warning, and so
does a failure to read the versions from Docker Hub. Setting tag of the container in hosty.yaml skips the check.readOnlyCode: false in hosty.yaml.
Python keeps writable code for now, as its packages are installed outside of the folder of the application. Tags of
images change, so the first deployment of every environment with this version builds its images again.tofu apply turns on network policies in the vpc-cni add-on and adds them to all projects.unrestricted_access of projects is removed, and with it the old roles create-read-update-delete and
create-read-update: all projects are limited to their roles. Before tofu apply, move every project that still
has the option: deploy all its environments with Hosty v1.5.0 or newer and remove the option, as described for
v1.5.0.<project>_development for development environments and
<project>_production for production, created by tofu apply with a job only administrators can reach. Environments
switch to them on their next deployment, and their import and cleanup no longer need the master user of the database,
which can reach all projects of the cluster. The password of an account doesn't change when an environment is created
again. Development environments get databases named <project>_development_<environment>_<application>. Run tofu apply before updating Hosty CLI: on MySQL, the new version needs the accounts. Existing development databases have
to be renamed to the new names, and their environments deployed right after that: until then they can't reach their
databases. Production keeps its names. PostgreSQL clusters work as before.tofu apply, set the new option unrestricted_access = true
on all existing projects, and remove it from a project once all its environments are deployed with this version. A
restricted project has no master user of the database, and is limited to its roles:
exec and copy, and hosty run and hosty delete
on development environments. Lead developers also have logs, exec, copy, hosty run and hosty backup:create on
production.baseline is enforced, which rejects privileged pods and access to nodes, and only administrators can
delete production.ClusterIP, and pods can't use direct volumes such as nfs.hosty run no longer fails with cannot unmarshal array into Go struct field ... securityContext: empty objects of the
template of the pod were sent to Kubernetes as empty lists. Runs are now deleted with their environment, as their
finished pods kept its persistent volume claim for a day and a new environment with the same name couldn't start.tofu apply.backup.partial in hosty.yaml: with false, the scheduled backups of a project create only a full dump
of the database. It suits projects without development environments, or whose partial dump is the same as the full
one, as they dump and store the database twice. Partial backups stay on by default. With them off, a deployment of a
new development environment and the --partial options of the backup commands stop with an error, as the import
would restore an old partial backup while there is one, and leave the database empty afterwards.backup.hours in hosty.yaml is optional, so that backup may contain only partial.database_backup_retention_days of a project in Terraform, to keep its database backups for less time than
those of the other projects, up to 30 or from 120 days. Existing backups older than that are deleted too.nil pointer evaluating interface {}.image since v1.4.0. The charts defined the template of the pods of runs and cron jobs under
the same name, and Helm shares names of templates between the charts of a release, so all applications got the
template of one type. Projects with applications of a single type aren't affected.maxSurge: 1, maxUnavailable: 0). An old pod was stopped
first, so a new version that doesn't start left production on one pod, and every deployment halved the capacity
while it ran. Now the old pods keep serving until the new ones are ready, and a failed deployment leaves all of them
running, with the broken pod next to them until the next deployment. replicas: 1 still stops the old pod first.hosty.yaml that match the environment apply, in the order of the list. Each
matching override was merged into the configuration without overrides, so only the last one took effect, i.e. a
production override with hosts was lost when an override with negate matched production too.set -e).
The hook ran as one script that failed only when its last command did, so i.e. a failed composer install
followed by a successful command built and pushed an image without the dependencies, and builds of the same commit
reused it. A command that may fail on purpose needs || true after it.backup:create runs the backup of the application given with --application. kubectl took only the last of the
two selectors of the command, the one of the component, so it ran the backup of whichever application of the
project came first, i.e. of "backend" for --application frontend.hosty.yaml or of the way Hosty builds images builds a new image. The tag depended only on the code, the
environment variables and the base image, so i.e. with appRoot in a subfolder a new build hook deployed the image
built with the old one. Images of nginx and apache are built again whenever the image of their backend is, as they
copy its code. Tags of all images change, so the first deployment of every environment with this version builds
its images again.tag of a container in hosty.yaml pins its base image to a release of the version line, i.e. tag: r10 for
wodby/php:8.4-r10, instead of the latest release. The tag was checked against Docker Hub but never used. A tag
of Python includes the flavour of its image, so tag: r7 of Python 3.12 is wodby/python:3.12-dev-r7.environmentFiles) are taken literally. The files were parsed as
dotenv files, which expand variables and run commands like a shell, so values with "$", i.e. hashes of passwords
($2y$10$...) that CI writes from its secrets, were cut, and $NAME gave the variables of the CLI. Lines are
NAME=value, optionally after export; blank lines and lines starting with # are skipped, and quotes around a
whole value are removed. A file that referred to other variables (${NAME}) or ran commands needs the values
written out.--password-stdin) instead of the arguments of
docker login, where other processes could see it, and a failed login printed it with the command line, i.e. to
the logs of CI.-vvv) no longer shows the credentials of the MFA session (access key, secret key and session
token), which gave access to the account for 12 hours to anyone who saw the output. The error about a user without
an MFA device names the user, which it left empty.'self' in a Content Security Policy of nginx became self (a host
named "self"), and a value with a single quote (i.e. "Bob's") failed the build. A value with a line break, which a
Dockerfile can't hold and whose rest became instructions of the Dockerfile, fails with an error that names the
variable. Tags of all images change, so the first deployment of every environment with this version builds its
images again.backup:files:upload shows how many files of the backup it would upload and delete, and asks for a confirmation
before it changes the backup (--yes skips the question and is required without a terminal, i.e. in CI). It
refuses a source folder that doesn't exist or is empty. The upload makes the backup the same as the folder, so a
wrong or empty folder deleted the files of the backup of production for good, without a question, and a failed
upload was reported as done.backup:files:download shows how many files it would download and delete locally, and asks for a confirmation
before it deletes local files (--yes skips the question and is required for that without a terminal). It
refuses the root of the project and folders outside it. The download makes the folder the same as the backup, so
a wrong folder (i.e. "." or "web") lost all local files that the backup didn't have, code included, and a failed
download was reported as done.backup:database:list and backup:database:download fail with the error of AWS when they can't list the backups,
i.e. when the MFA session has expired or the access is denied. The error was lost in a shell pipe, so it looked
like there were no backups. Names of backups with spaces are shown whole. backup:database:download shows the
progress of the download and the error when it fails, which it printed only at the end and without the error.logs fails with the error of kubectl, i.e. for a wrong container or an expired login to the cluster, which was
lost in a shell pipe, so the command printed nothing and succeeded. It has no time limit, which was a minute, too
short for the logs of all replicas of a busy production. Lines are sorted by time only, so lines with the same
time (i.e. of a stack trace) keep their order, and fractions of a second of different lengths compare right.
logs --watch works without a terminal (i.e. in CI or with the output to a file), and follows up to 50 pods
instead of 5, so it no longer fails on production with more replicas, i.e. during a deployment.backup:create fails as soon as the backup fails, with the reason, the last lines of its logs and the command to
see them. It waited only for the backup to complete, so a failed backup kept it waiting for an hour (i.e. a job of
CI), and then it failed with "timed out waiting for the condition". A backup still running after an hour fails the
command with the command to follow it.composer install doesn't download all packages again after a change of the code: about 40
seconds less for a Drupal site. The caches aren't part of the image. They are kept where Docker keeps its data
between builds, i.e. locally or in CI with the cache of Docker layers; elsewhere builds take as long as before.shell and logs) find only the environment with the exact name: the
check found "stage" when only "stage2" existed, and the command failed later with an unclear error.hosty.yaml that YAML reads as a number without its trailing zero, i.e. 1.30
without quotes (1.3), fails the check with a hint to quote it. It passed the check, and the build failed with
"Docker image tag for wodby/nginx not found". Versions like 8.4 keep working without quotes.-nt shortcut of exec --no-tty is removed: it never worked, as it's read as -n and -t.cli/project.application.Dockerfile and cli/project.webserver.Dockerfile are removed. Dockerfiles of
applications are generated by the CLI.helm ls and helm history is just the release, i.e. "1.3.1", for a released CLI. Only a
build with unreleased changes has the commit it was built from added, i.e. "1.3.1+66c836a" ("1.3.1+local" for an
image built locally), instead of "+unreleased". The commit was added to releases too.HOSTY_SKIP_VERSION_CHECK=1 (i.e.
for an urgent fix of production before the update).run (environment:run) runs a command in a pod of its own, like a run of a cron job, on the development nodes,
i.e. hosty run production -- drush cim -y. It shows the output of the command and exits with its exit code. The
run goes on in the cluster when the command is interrupted (i.e. by Ctrl+C or a lost connection), and the command
shows how to follow and stop it. A run is stopped after its time limit, an hour by default (--timeout, in
seconds, up to a day), isn't repeated when it fails, and is deleted with its output a day after it finishes.
--memory asks for more memory (in MiB), and --detach only starts the run. The pod of a run comes from a new
template in the charts (podtemplate.run.yaml), the same pod as the one of cron jobs, so an environment needs a
deployment with this version first.systemseed/hosty with
the notes of the latest releases from the changelog./.healthz answers 200, not only 204. Applications
answering 200 (i.e. a page or a route of a framework) were never healthy for the load balancer, which then sent
requests to all of them regardless of their state; with the readiness gate their new pods would never be ready.
The first deployment with this version updates the health check of the target groups.Content type
Image
Digest
sha256:d9db21fb6…
Size
201.7 MB
Last updated
7 days ago
docker pull systemseed/hosty