### Install Mkdocs and Serve Locally Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/documentation.md Install the necessary mkdocs packages and then start the local development server. This is an alternative to using the Docker-based serve command. ```bash pip3 install -r docs/requirements.txt mkdocs serve ``` -------------------------------- ### Start Application using NPM Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/nodejs.md Command to start the Node.js application using NPM's 'start' script defined in package.json. ```bash npm start ``` -------------------------------- ### Install Drupal Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/step-by-step-getting-drupal-ready-to-run-on-lagoon.md Run 'drush site-install' to perform a fresh installation of Drupal. This command will prompt for confirmation before dropping existing tables and then proceeds with the installation process. ```bash drush site-install ``` -------------------------------- ### Start Application using Yarn Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/nodejs.md Command to start the Node.js application using Yarn's 'start' script defined in package.json. ```bash yarn start ``` -------------------------------- ### Setting an initial user and organization Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/lagoon-core.md Example configuration for setting an initial user and organization during Lagoon installation. ```yaml lagoonSeedUsername: test@example.com lagoonSeedPassword: password lagoonSeedOrganization: example-org ``` -------------------------------- ### Install and Run Docker Mac Net Connect Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Installs, starts, and stops the docker-mac-net-connect service for MacOS users to enable direct routing to Docker container IPs. ```bash # Install via Homebrew $ brew install chipmk/tap/docker-mac-net-connect # Run the service and register it to launch at boot $ sudo brew services start chipmk/tap/docker-mac-net-connect # Stop the service $ sudo brew services stop chipmk/tap/docker-mac-net-connect ``` -------------------------------- ### Example SSH Connection Source: https://github.com/uselagoon/lagoon/blob/main/docs/interacting/ssh.md This is a concrete example of connecting to the 'main' environment of the 'drupal-example' project. It includes the optional port flag if a non-standard SSH port is configured. ```bash ssh {% if defaults.sshport != 22 %}-p {{ defaults.sshport }} {% endif %}drupal-example-main@{{ defaults.sshhostname }} ``` -------------------------------- ### Drush status result example Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/step-by-step-getting-drupal-ready-to-run-on-lagoon.md An example output of the 'drush status' command, showing Drupal version, database connection details, PHP configuration, and Drush version. It may indicate missing database tables like 'key_value' which is normal before installation. ```bash [drupal-example]cli-drupal:/app$ drush status [notice] Missing database table: key_value Drupal version : 8.6.1 Site URI : http://drupal.docker.amazee.io Database driver : mysql Database hostname : mariadb Database port : 3306 Database username : drupal Database name : drupal PHP binary : /usr/local/bin/php PHP config : /usr/local/etc/php/php.ini PHP OS : Linux Drush script : /app/vendor/drush/drush/drush Drush version : 9.4.0 Drush temp : /tmp Drush configs : /home/.drush/drush.yml /app/vendor/drush/drush/drush.yml Drupal root : /app/web Site path : sites/default ``` -------------------------------- ### Install Elasticsearch Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/opendistro.md Installs Elasticsearch using Helm. Ensure you have created the elasticsearch-values.yaml file and filled in all placeholders. ```bash helm upgrade --namespace elasticsearch --create-namespace --install elasticsearch opendistro-es-X.Y.Z.tgz --values elasticsearch-values.yaml ``` -------------------------------- ### Install Homebrew Packages Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Installs necessary command-line tools like wget and gettext for Mac users via Homebrew. ```bash brew install wget gettext ``` -------------------------------- ### Update Node.js Version Source: https://github.com/uselagoon/lagoon/blob/main/docs/docker-images/php-cli.md If you need a different Node.js version than the default, you can remove the current version and install your desired version. This example shows how to install Node.js 16. ```bash RUN apk del nodejs-current \ && apk add --no-cache nodejs=~16 ``` -------------------------------- ### Drupal docker-compose.yml Example Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/docker-compose-yml.md A comprehensive `docker-compose.yml` example for a Drupal project, demonstrating how to define services like nginx, php, and mariadb with Lagoon-specific labels. ```yaml x-lagoon-project: # Lagoon project name (leave `&lagoon-project` when you edit this) &lagoon-project drupal-example x-volumes: &default-volumes # Define all volumes you would like to have real-time mounted into the docker containers volumes: - .:/app:delegated x-environment: &default-environment LAGOON_PROJECT: *lagoon-project # Route that should be used locally, if you are using pygmy, this route *must* end with .docker.amazee.io LAGOON_ROUTE: http://drupal-example.docker.amazee.io # Uncomment if you want to have the system behave as it will in production #LAGOON_ENVIRONMENT_TYPE: production # Uncomment to enable Xdebug and then restart via `docker compose up -d` #XDEBUG_ENABLE: "true" x-user: &default-user # The default user under which the containers should run. Change this if you are on linux and run with another user than ID `1000` user: '1000' services: nginx: build: context: . dockerfile: nginx.dockerfile labels: lagoon.type: nginx-php-persistent # (1) lagoon.persistent: /app/web/sites/default/files/ php: build: context: . dockerfile: php.dockerfile labels: lagoon.type: nginx-php-persistent # (2) lagoon.name: nginx lagoon.persistent: /app/web/sites/default/files/ mariadb: image: uselagoon/mariadb-10.11-drupal labels: lagoon.type: mariadb ``` -------------------------------- ### Install a Clean Drupal Instance Source: https://github.com/uselagoon/lagoon/blob/main/docs/lagoonizing/index.md Run 'drush site-install' from the Docker CLI to perform a fresh installation of Drupal. This command will prompt for confirmation to drop existing tables. ```bash [drupal-example]cli-drupal:/app$ drush site-install ``` -------------------------------- ### Run composer install in CLI Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/step-by-step-getting-drupal-ready-to-run-on-lagoon.md Connect to the CLI container and run 'composer install' to download and install project dependencies locally. This is necessary because volume mounts can overwrite dependencies installed during the Docker build. ```bash docker compose exec cli bash composer install ``` -------------------------------- ### Deploy Local Stack with Stable Core, Remote, and Build/Deploy Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Installs the local Lagoon stack using the stable versions of the core, remote, and build/deploy charts. This is a convenient way to get a fully functional Lagoon environment without building all service images. ```bash make k3d/stable-local-stack # which is a shorter target for make k3d/local-stack INSTALL_STABLE_LAGOON=true ``` -------------------------------- ### Install lagoon-logging using Helm Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/lagoon-logging.md Installs or upgrades the lagoon-logging Helm chart. Ensure the Helm repository is added and the namespace is created. ```bash helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm upgrade --install --create-namespace \ --namespace lagoon-logging \ -f lagoon-logging-values.yaml \ lagoon-logging lagoon/lagoon-logging ``` -------------------------------- ### Serve Local Documentation Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/documentation.md Run this command from the root of the Lagoon repository to start a local development server for the documentation. It uses Docker and live-reloads on updates. ```bash make docs/serve ``` -------------------------------- ### SSH to php container example Source: https://github.com/uselagoon/lagoon/blob/main/docs/interacting/ssh.md An example of connecting to the 'php' container within the 'nginx' pod using specific Lagoon host and port details. ```bash ssh {% if defaults.sshport != 22 %}-p {{ defaults.sshport }} {% endif %}-t drupal-example-main@{{ defaults.sshhostname }} service=nginx container=php ``` -------------------------------- ### Example .lagoon.yml Configuration Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md This snippet shows a complete `.lagoon.yml` file with all possible settings. Adapt it to your specific project needs. ```yaml docker-compose-yaml: docker-compose.yml environment_variables: git_sha: 'true' tasks: pre-rollout: - run: name: drush sql-dump command: mkdir -p /app/web/sites/default/files/private/ && drush sql-dump --ordered-dump --gzip --result-file=/app/web/sites/default/files/private/pre-deploy-dump.sql.gz service: cli post-rollout: - run: name: drush cim command: drush -y cim service: cli shell: bash - run: name: drush cr command: drush -y cr service: cli routes: autogenerate: insecure: Redirect environments: main: routes: - nginx: - example.com - example.net - "www.example.com": tls-acme: true insecure: Redirect hstsEnabled: true - "example.ch": annotations: nginx.ingress.kubernetes.io/permanent-redirect: https://www.example.ch$request_uri - www.example.ch types: mariadb: mariadb cronjobs: - name: drush cron schedule: "M * * * *" # This will run the cron once per hour. command: drush cron service: cli staging: cronjobs: - name: drush cron schedule: "M * * * *" # This will run the cron once per hour. command: drush cron service: cli feature/feature-branch: cronjobs: - name: drush cron schedule: "H * * * *" # This will run the cron once per hour. command: drush cron service: cli ``` -------------------------------- ### Enable K8up in Local Stack Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Use this command to install both v1 and v2 versions of K8up into the local stack for backup testing. ```bash make k3d/local-stack INSTALL_K8UP=true ``` -------------------------------- ### Start Lagoon Test Suite Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Run the full Lagoon test suite using the default Makefile configurations. Use 'k3d/retest' if a local stack is already running. ```bash make k3d/test ``` ```bash make k3d/retest ``` -------------------------------- ### Node.js Application Start Script in package.json Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/nodejs.md Defines the 'start' script in a package.json file to run the Node.js application using 'node index.js'. This is a common practice for managing Node.js projects. ```json { "name": "node", "version": "1.0.0", "main": "index.js", "license": "MIT", "dependencies": { "express": "^4.15.3" }, "scripts": { "start": "node index.js" } } ``` -------------------------------- ### Conditional Post-Rollout Task (Drupal Install Check) Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md Run a task only if Drupal is not installed, using a multi-line bash script. ```bash tasks: post-rollout: - run: name: IF no Drupal installed command: | if tables=$(drush sqlq "show tables like 'node';") && [ -z "$tables" ]; then #### whatever you like fi service: cli shell: bash ``` -------------------------------- ### Install Purge and Varnish Purge Modules Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/services/varnish.md Installs the necessary Drupal modules for Varnish cache integration using Composer and Drush. ```bash composer require drupal/purge drupal/varnish_purge drush en purge purge_drush purge_tokens purge_ui purge_processor_cron purge_processor_lateruntime purge_queuer_coretags varnish_purger varnish_purge_tags ``` -------------------------------- ### Install All Stable then Upgrade Lagoon Core Only Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Installs a local stack with all stable components, then upgrades only the Lagoon core. This is useful for verifying upgrade paths from stable chart versions. ```bash # install a local stack with all stable components make k3d/local-stack INSTALL_STABLE_LAGOON=true # optionally checkout a new version of the charts branch if there are changes made make k3d/checkout-charts # make changes to a lagoon service or the lagoon-core charts and re-install lagoon make k3d/install-lagoon INSTALL_STABLE_REMOTE=true INSTALL_STABLE_BUILDDEPLOY=true ``` -------------------------------- ### Install Local Logging Support Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Sets up a standalone OpenDistro for Elasticsearch cluster locally and configures Lagoon to dispatch all logs to it. ```bash make k3d/local-dev-logging ``` -------------------------------- ### Install Harbor using Helm Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/install-harbor.md Installs or upgrades the Harbor Helm chart in the 'harbor' namespace. It applies the custom configuration from 'harbor-values.yml' and waits for the deployment to complete. ```bash helm upgrade --install --create-namespace \ --namespace harbor --wait \ -f harbor-values.yml \ harbor harbor/harbor ``` -------------------------------- ### Install logs-concentrator with Helm Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/logs-concentrator.md Use this Helm command to install or upgrade the logs-concentrator in your Kubernetes cluster. It requires a namespace and a values file for configuration. ```bash helm upgrade --install --create-namespace \ --namespace lagoon-logs-concentrator \ -f logs-concentrator-values.yaml \ lagoon-logs-concentrator lagoon/lagoon-logs-concentrator ``` -------------------------------- ### Install K8up using Helm Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/lagoon-backups.md Installs or upgrades the K8up Helm chart in the 'k8up' namespace. This command uses a custom values file and specifies the chart version. ```bash helm upgrade --install --create-namespace \ --namespace k8up \ -f k8up-values.yaml \ --version 1.1.0 \ k8up appuio/k8up ``` -------------------------------- ### Dockerfile CMD using Yarn Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/nodejs.md Specifies the command to run when a Docker container starts, using Yarn to execute the 'start' script. This can lead to issues with signal handling. ```dockerfile CMD ["yarn", "start"] ``` -------------------------------- ### Install Lagoon Remote with Helm Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/install-lagoon-remote.md Installs or upgrades the Lagoon Remote using Helm, specifying the namespace and configuration file. ```bash helm upgrade --install --create-namespace \ --namespace lagoon \ -f lagoon-remote-values.yml \ lagoon-remote lagoon/lagoon-remote ``` -------------------------------- ### Example Output of docker port Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/services/mariadb.md Example output showing the mapping of the container's internal MySQL port (3306) to a randomly assigned host port (32797). ```text $ docker port drupal_example_mariadb_1 3306/tcp -> 0.0.0.0:32797 ``` -------------------------------- ### Path Based Routes Example Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md An example of a .lagoon.yml file demonstrating path-based routes. It includes global autogenerated routes, per-environment autogenerated routes, and custom routes, allowing traffic to be directed to different backend services based on URL paths. ```yaml docker-compose-yaml: docker-compose.yml # if an environment has `autogeneratePathRoutes` defined like `environments.main.autogeneratePathRoutes` # then thes global lagoon yaml `routes.autogenerate.pathRoutes` are ignored routes: autogenerate: pathRoutes: - fromService: nginx toService: node path: /api/v1 environments: main: # path routes for autogenerated routes for this environment only autogeneratePathRoutes: - fromService: nginx toService: node path: /api/v1 routes: - nginx: - a.example.com: pathRoutes: - toService: node path: /api/v1 ``` -------------------------------- ### API Response for allProjects Query Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/querying-graphql.md This is an example of the expected JSON response when querying for all projects, which will be an empty array if no projects are configured. ```json { "data": { "allProjects": [] } } ``` -------------------------------- ### Example Output of docker compose port Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/services/mariadb.md Example output showing the mapping of the MariaDB service's internal port (3306) to a dynamically assigned host port (0.0.0.0:32797). ```bash docker compose port mariab 3306 0.0.0.0:32797 ``` -------------------------------- ### View All Valkey Service Info Source: https://github.com/uselagoon/lagoon/blob/main/docs/docker-images/valkey.md Use this command to get a comprehensive overview of the Valkey service's status and configuration. ```bash valkey-cli info ``` -------------------------------- ### Start Docker Containers Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/step-by-step-getting-drupal-ready-to-run-on-lagoon.md Starts all defined Docker containers in detached mode. Use 'docker compose ps' to verify they are running and 'docker compose logs -f [servicename]' to troubleshoot. ```bash docker compose up -d ``` -------------------------------- ### Install bulk StorageClass and Secret Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/bulk-storage-provisioner.md Applies the Kubernetes StorageClass and Secret definitions from the specified YAML file to the cluster. ```bash kubectl apply -f csi-driver-nfs-storageclass.yaml ``` -------------------------------- ### Copy files with rsync Source: https://github.com/uselagoon/lagoon/blob/main/docs/interacting/ssh.md Utilize rsync for efficient file synchronization to your Lagoon environment. This example shows how to specify the SSH port if non-standard. ```bash rsync {% if defaults.sshport != 22 %}--rsh='ssh -p {{ defaults.sshport }}'{% else %}--rsh=ssh{% endif %} [local_path] [project_name]-[environment_name]@{{ defaults.sshhostname }}:[remote_path] ``` -------------------------------- ### Basic Express Server Setup Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/nodejs.md Sets up a basic Express server with a 5-second delay on all requests to simulate a long-running operation. This server is used to demonstrate graceful shutdown. ```javascript const express = require('express'); const app = express(); // Adds a 5 second delay for all requests. app.use((req, res, next) => setTimeout(next, 5000)); app.get('/', function (req, res) { res.send("Hello World"); }) const server = app.listen(3000, function () { console.log('Example app listening on port 3000!'); }) ``` -------------------------------- ### Upgrade Remote Controller CRDs with Helm Source: https://github.com/uselagoon/lagoon/blob/main/docs/releases/2.32.0.md Use this command to upgrade the Custom Resource Definitions (CRDs) for the Lagoon remote controller when installing or upgrading to version 0.41.0 or later. Failure to update CRDs may prevent the remote controller from starting. ```bash helm show crds lagoon/lagoon-build-deploy --version 0.41.0 | kubectl apply -f - ``` -------------------------------- ### Install NFS CSI Driver Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/bulk-storage-provisioner.md Installs or upgrades the NFS CSI driver using Helm. It ensures the driver is installed in the 'csi-driver-nfs' namespace and waits for the installation to complete. ```bash helm upgrade --install --create-namespace \ --namespace csi-driver-nfs --wait \ csi-driver-nfs csi-driver-nfs/csi-driver-nfs ``` -------------------------------- ### Configure Environment Routes with SSL and Redirects Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md Set up manual routes for an environment, including custom domain, TLS/SSL configuration, and HTTP to HTTPS redirection. ```yaml environments: main: routes: - nginx: - "www.example.com": tls-acme: true insecure: Redirect hstsEnabled: true ``` -------------------------------- ### Re-run Composer Install in CLI Container Source: https://github.com/uselagoon/lagoon/blob/main/docs/lagoonizing/index.md Executes 'composer install' within the 'cli' container. This is necessary because local volume mounts overwrite dependencies installed during the build, and this step ensures development dependencies are included. ```bash docker compose exec cli bash [drupal-example]cli-drupal:/app$ composer install ``` -------------------------------- ### drush site-install confirmation and output Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/step-by-step-getting-drupal-ready-to-run-on-lagoon.md Example output from 'drush site-install', showing the confirmation prompt for dropping tables and the success message upon completion, including the generated admin username and password. ```bash [drupal-example]cli-drupal:/app$ drush site-install You are about to DROP all tables in your 'drupal' database. Do you want to continue? (y/n): y Starting Drupal installation. This takes a while. Consider using the --notify global option. Installation complete. User name: admin User password: a7kZJekcqh Congratulations, you installed Drupal! ``` -------------------------------- ### Install secrets Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/opendistro.md Installs secrets for Elasticsearch using Helm. Ensure you have created the elasticsearch-secrets-values.yaml file beforehand. ```bash helm repo add incubator https://charts.helm.sh/incubator helm upgrade --namespace elasticsearch --create-namespace --install elasticsearch-secrets incubator/raw --values elasticsearch-secrets-values.yaml ``` -------------------------------- ### Define Environment Configuration Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md Set up specific configurations for different environments like 'main' or 'staging'. ```yaml environments: main: ``` -------------------------------- ### Build and Push Local Build-Deploy-Image Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Build a custom version of the build-deploy-image locally and push it to the local-stack registry. This is useful for testing changes to the build-deploy-tool. ```bash # in `uselagoon/build-deploy-tool` branch make docker-build # in `uselagoon/lagoon` branch make k3d/push-local-build-image ``` -------------------------------- ### Drush Command Error Example Source: https://github.com/uselagoon/lagoon/blob/main/docs/resources/faq.md This is an example of an error message that may appear when running a Drush command, often related to outdated Drush versions. ```bash The command could not be executed successfully (returned: Array [ (error) ] ( [default] => Array ( [default] => Array ( [driver] => mysql [prefix] => Array ( [default] => ) , code: 0 ) Error: no database record could be found for source @main [error] ) ) ``` -------------------------------- ### Run All Local Tests Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/tests.md Execute all defined tests locally using the make command. This command handles downloading and building necessary dependencies. ```bash make tests ``` -------------------------------- ### Set up Private Repository Access in Dockerfile Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/private-repositories.md This snippet shows how to add the necessary commands to your Dockerfile to enable access to private repositories. It ensures the SSH key is set up, dependencies are installed, and the key is removed after use. ```bash RUN /lagoon/entrypoints/05-ssh-key.sh && composer install && rm /home/.ssh/key ``` -------------------------------- ### Build and Serve Hugo Site with NGINX Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/other.md This Dockerfile builds a Hugo static site using the commons image and then serves it with NGINX. It first adds Hugo and Git, copies the project, builds the site, and then copies the built site into an NGINX image, applying a custom NGINX configuration. ```dockerfile FROM uselagoon/commons AS builder RUN apk add hugo git WORKDIR /app COPY . /app RUN hugo FROM uselagoon/nginx COPY --from=builder /app/public/ /app COPY lagoon/static-files.conf /etc/nginx/conf.d/app.conf RUN fix-permissions /usr/local/openresty/nginx ``` -------------------------------- ### Enable br_netfilter module Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Ensures the 'br_netfilter' kernel module is loaded, which may be necessary for k3d internal DNS resolution. ```bash sudo modprobe br_netfilter ``` -------------------------------- ### Install or Upgrade All Lagoon Components Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Installs or upgrades all Lagoon components to the latest versions from the current branch. This is useful for testing upgrades or applying changes to Lagoon services and charts. ```bash make k3d/install-lagoon # or shortcut to a stable lagoon make k3d/stable-install-lagoon # which is a shorter target for make k3d/install-lagoon INSTALL_STABLE_LAGOON=true ``` -------------------------------- ### Drush SQL-Sync Execution Example Source: https://github.com/uselagoon/lagoon/blob/main/docs/applications/drupal/first-deployment-of-drupal.md This output shows the expected results and prompts during a Drush SQL-sync operation, including database dumping, file copying, and import confirmation. ```bash drush sa [drupal-example]cli-drupal:/app$ drush sa @develop @self default drush sql-sync @self @develop [drupal-example]cli-drupal:/app$ drush sql-sync @self @develop You will destroy data in {{ defaults.sshhostname }}/drupal and replace with data from drupal. Do you really want to continue? (y/n): y Starting to dump database on Source. [ok] Database dump saved to /home/drush-backups/drupal/20180227075813/drupal_20180227_075815.sql.gz [success] Starting to discover temporary files directory on Destination. [ok] You will delete files in drupal-example-develop@{{ defaults.sshhostname }}:/tmp/drupal_20180227_075815.sql.gz and replace with data from /home/drush-backups/drupal/20180227075813/drupal_20180227_075815.sql.gz Do you really want to continue? (y/n): y Copying dump file from Source to Destination. [ok] Starting to import dump file onto Destination database. ``` -------------------------------- ### Disable Harbor Installation Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Skips the installation of Harbor and configures 'lagoon-remote' to use an unauthenticated registry. This is necessary on arm64 systems where Harbor images are not available and can be used to skip Harbor on any system. ```bash INSTALL_UNAUTHENTICATED_REGISTRY=true ``` -------------------------------- ### View Available Tests Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/tests.md List all available tests to run individually. Use the output of this command to run specific test suites. ```bash make tests-list ``` -------------------------------- ### Install Local CA Certificate Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Install the locally generated CA certificate into your system's trust store to avoid certificate warnings when accessing local Lagoon services. Use 'make uninstall-ca' to remove it. ```bash make install-ca ``` -------------------------------- ### Configure Persistent Volume Size and Backup Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/docker-compose-yml.md Define custom persistent volume configurations, including size and backup settings, using labels within the volumes block. This example sets a 10Gi size and disables backups. ```yaml volumes: extravol: labels: lagoon.type: persistent lagoon.persistent.size: 10Gi lagoon.backup: false ``` -------------------------------- ### Get RabbitMQ Password Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/install-lagoon-remote.md Retrieves the RabbitMQ password from the lagoon-core-broker secret. This is needed for the lagoon-remote-values.yml configuration. ```bash kubectl -n lagoon-core get secret lagoon-core-broker -o jsonpath="{.data.RABBITMQ_PASSWORD}" | base64 --decode ``` -------------------------------- ### YAML Redirect Example in .lagoon.yml Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md Redirects requests from 'example.ch' to 'https://www.example.ch', preserving the original URI. ```yaml - "example.ch": annotations: nginx.ingress.kubernetes.io/permanent-redirect: https://www.example.ch$request_uri - www.example.ch ``` -------------------------------- ### Pre-Rollout Task Configuration in .lagoon.yml Source: https://github.com/uselagoon/lagoon/blob/main/docs/concepts-basics/lagoon-yml.md Example of defining a pre-rollout task in .lagoon.yml. These tasks run after image builds but before container updates, useful for operations like database dumps. ```yaml tasks: pre-rollout: - run: name: a pre rollout task command: | ### perform an action service: cli ``` -------------------------------- ### List Projects, Clusters, and Groups Source: https://github.com/uselagoon/lagoon/blob/main/docs/interacting/graphql-queries.md Query to get an overview of all projects, clusters, and groups within Lagoon. ```APIDOC ## List Projects, Clusters, and Groups Query to get an overview of all projects, clusters, and groups. ### Method ```graphql query { allProjects { name gitUrl } allKubernetes { name id } allGroups{ id name members { user { id firstName lastName } role } groups { id name } } } ``` ### Response #### Success Response (200) - **allProjects** - An array of projects, each with `name` and `gitUrl`. - **allKubernetes** - An array of Kubernetes clusters, each with `name` and `id`. - **allGroups** - An array of groups, each with `id`, `name`, `members` (including user details and role), and nested `groups`. ``` -------------------------------- ### Get Harbor Secret Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/install-lagoon-remote.md Retrieves the Harbor admin password from the harbor-harbor-core secret. This is required for the lagoon-remote-values.yml configuration. ```bash kubectl -n harbor get secret harbor-harbor-core -o jsonpath="{.data.HARBOR_ADMIN_PASSWORD}" | base64 --decode ``` -------------------------------- ### Upgrade Helm with values.yml Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/lagoon-core.md Installs or upgrades the Lagoon Core Helm chart using a custom values.yml file. ```bash helm upgrade --install --create-namespace --namespace lagoon-core -f values.yml lagoon-core lagoon/lagoon-core ``` -------------------------------- ### Configure Lagoon Remote Values Source: https://github.com/uselagoon/lagoon/blob/main/docs/installing-lagoon/install-lagoon-remote.md Example configuration for lagoon-remote-values.yml, including settings for Harbor, RabbitMQ, and database providers. ```yaml lagoon-build-deploy: enabled: true extraArgs: - "--enable-harbor=true" - "--harbor-url=https://harbor.lagoon.example.com" - "--harbor-api=https://harbor.lagoon.example.com/api/" - "--harbor-username=admin" - "--harbor-password=" rabbitMQUsername: lagoon rabbitMQPassword: rabbitMQHostname: lagoon-core-broker.lagoon-core.svc.cluster.local lagoonTargetName: taskSSHHost: taskSSHPort: "22" taskAPIHost: "api.lagoon.example.com" dbaas-operator: enabled: true mariadbProviders: production: environment: production hostname: 172.17.0.1.nip.io readReplicaHostnames: - 172.17.0.1.nip.io password: password port: '3306' user: root development: environment: development hostname: 172.17.0.1.nip.io readReplicaHostnames: - 172.17.0.1.nip.io password: password port: '3306' user: root ``` -------------------------------- ### View All Microservice Logs Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/tests.md Display logs from all microservices during local testing. This is useful for debugging and understanding the behavior of the system. ```bash make logs ``` -------------------------------- ### Environment Query Results After Switching Source: https://github.com/uselagoon/lagoon/blob/main/docs/using-lagoon-advanced/active-standby.md This JSON output illustrates the state of production and standby environments after an active/standby switch has been executed. The roles of the production and standby environments have been swapped. ```json { "data": { "projectByName": { "productionEnvironment": "prod-right", "standbyProductionEnvironment": "prod-left" } } } ``` -------------------------------- ### Configure K8up Version for lagoon-remote Source: https://github.com/uselagoon/lagoon/blob/main/docs/contributing-to-lagoon/developing-lagoon.md Specify the K8up CRD version (v1 or v2) that lagoon-remote will use when K8up is installed. ```bash make k3d/local-stack INSTALL_K8UP=true REMOTE_CONTROLLER_K8UP_VERSION=v1 ```