### Setup and Run Pre-commit Hooks Source: https://github.com/frappe/helm/blob/main/CONTRIBUTING.md Set up a Python virtual environment, install pre-commit, and run all pre-commit hooks on the repository files. Ensure that pre-commit does not report any failures before proceeding. ```shell python3 -m venv env . ./env/bin/activate pip install -U pip pre-commit pre-commit run --all-files ``` -------------------------------- ### Install Frappe / ERPNext Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Installs the Frappe/ERPNext chart in the 'erpnext' namespace, utilizing the 'nfs' storage class and enabling MariaDB. ```shell kubectl create namespace erpnext helm repo add frappe https://helm.erpnext.com helm upgrade --install frappe-bench --namespace erpnext frappe/erpnext --set persistence.worker.storageClass=nfs --set mariadb-sts.enabled=true ``` -------------------------------- ### Setup Release Wizard Source: https://github.com/frappe/helm/blob/main/CONTRIBUTING.md Prepare the environment for the release wizard by setting up the necessary scripts and activating the virtual environment. This is a prerequisite for running the release wizard. ```shell $ ./release_wizard/setup.sh $ . ./venv/bin/activate ``` -------------------------------- ### Install ERPNext Helm Chart Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Installs the ERPNext Helm chart with a specified release name, namespace, and custom values file. ```shell helm install frappe-bench -n erpnext -f custom-values.yaml frappe/erpnext ``` -------------------------------- ### Install NFS Server Provisioner Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Installs the NFS server provisioner in a dedicated namespace. This is a prerequisite for making NFS storage available with RWX capabilities. ```shell kubectl create namespace nfs helm repo add nfs-ganesha-server-and-external-provisioner https://kubernetes-sigs.github.io/nfs-ganesha-server-and-external-provisioner helm upgrade --install -n nfs in-cluster nfs-ganesha-server-and-external-provisioner/nfs-server-provisioner --set 'storageClass.mountOptions={vers=4.1}' --set persistence.enabled=true --set persistence.size=8Gi ``` -------------------------------- ### Create Full Backup Job Source: https://github.com/frappe/helm/blob/main/erpnext/MIGRATION.md Execute a backup job using Helm to create a full backup of your site before starting the migration. Ensure the backup is verified. ```bash # Replace and with your current values helm template frappe/erpnext \ -f your-values.yaml \ --set jobs.backup.enabled=true \ --set jobs.backup.siteName= \ -s templates/job-backup.yaml | kubectl apply -f - ``` -------------------------------- ### Retrieve New MariaDB Root Password Source: https://github.com/frappe/helm/blob/main/erpnext/MIGRATION.md Use kubectl to get the MariaDB root password from a Kubernetes secret. This password is required for restoring data to the new database. ```bash kubectl get secret -mariadb-sts -o jsonpath='{.data.mariadb-root-password}' | base64 -d ``` -------------------------------- ### Apply Configure Bench Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Apply the generated `job-configure-bench.yaml` file to create the Configure Bench Job resource in Kubernetes. ```shell kubectl apply -f job-configure-bench.yaml ``` -------------------------------- ### Apply Create Site Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Applies the generated 'create-new-site-job.yaml' to create the site resource in Kubernetes. ```shell kubectl apply -f create-new-site-job.yaml ``` -------------------------------- ### Restore Backup to New Database Source: https://github.com/frappe/helm/blob/main/erpnext/MIGRATION.md Execute the bench restore command from within a pod to import data into the new MariaDB StatefulSet. Ensure you provide the correct paths to your backup files and database credentials. ```bash # Example conceptual command from within a pod bench --site restore /path/to/your/backup.sql \ --with-private-files /path/to/your/private-files.tar \ --with-public-files /path/to/your/public-files.tar \ --db-host -mariadb-sts \ --db-port 3306 \ --db-root-username root \ --db-root-password ``` -------------------------------- ### Configure Clear Cache Job and Init Container Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Enable the clear cache job and configure the init container with image, deployment details, and timeout in `custom-values.yaml`. ```yaml jobs: clearCache: enabled: true # Configure initContainer to wait for rollout initContainer: enabled: true image: alpine/kubectl:1.35.0 deployment: name: "gunicorn" timeout: 600s ``` -------------------------------- ### Apply Site Backup Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Applies the generated 'job-backup.yaml' to create the site backup job resource in Kubernetes. ```shell kubectl apply -f job-backup.yaml ``` -------------------------------- ### Run Release Wizard for Chart Versioning Source: https://github.com/frappe/helm/blob/main/CONTRIBUTING.md Execute the release wizard script to automatically fetch the latest Frappe/ERPNext versions, update chart and app versions, and create a Git tag. Specify the version increment type (major, minor, or patch). ```shell $ ./release_wizard/wizard major|minor|patch ``` -------------------------------- ### Enable Drop Site Job Configuration Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Configure the `custom-values.yaml` file to enable and specify the site name for the drop site job. Ensure the specified site exists. ```yaml jobs: dropSite: enabled: true siteName: "erp.example.com" ``` -------------------------------- ### Add Frappe Helm Repository Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Adds the Frappe Helm repository to your local Helm configuration. ```shell helm repo add frappe https://helm.erpnext.com ``` -------------------------------- ### Apply Ingress Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Applies the generated 'ingress.yaml' to create the Ingress resource in Kubernetes. ```shell kubectl apply -f ingress.yaml ``` -------------------------------- ### Apply Site Migration Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Applies the generated 'job-migrate-site.yaml' to create the site migration job resource in Kubernetes. ```shell kubectl apply -f job-migrate-site.yaml ``` -------------------------------- ### Configure Site Creation Job Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Enables and configures the 'createSite' job in custom-values.yaml to create a new ERPNext site. ```yaml jobs: createSite: enabled: true siteName: "erp.example.com" adminPassword: "secret" ``` -------------------------------- ### Create Kubernetes Namespace Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Creates a new namespace named 'erpnext' for ERPNext deployment. ```shell kubectl create namespace erpnext ``` -------------------------------- ### Generate Create Site Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generates the Kubernetes YAML for the 'create-site' job using helm template. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-create-site.yaml > create-new-site-job.yaml ``` -------------------------------- ### Configure Site Backup Job Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Enables and configures the 'backup' job in custom-values.yaml for site backups, with optional S3 push configuration. ```yaml jobs: backup: enabled: true siteName: "erp.example.com" withFiles: true push: enabled: false bucket: "erpnext" region: "us-east-1" accessKey: "ACCESSKEY" secretKey: "SECRETKEY" endpoint: http://store.storage.svc.cluster.local ``` -------------------------------- ### Apply HTTPRoute Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Applies the generated 'httproute.yaml' to create the HTTPRoute resource in Kubernetes. ```shell kubectl apply -f httproute.yaml ``` -------------------------------- ### Upgrade Helm Chart to Provision New Database Source: https://github.com/frappe/helm/blob/main/erpnext/MIGRATION.md Upgrade the Helm release to provision the new built-in database StatefulSet. The application will continue to use the old database during this stage. ```bash helm upgrade frappe/erpnext --version -f your-values.yaml ``` -------------------------------- ### Apply Drop Site Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Use `kubectl apply` to create the Drop Site Job resource in your Kubernetes cluster. ```shell kubectl apply -f job-drop-site.yaml ``` -------------------------------- ### Apply Clear Cache Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Apply the generated `job-clear-cache.yaml` file to create the Clear Cache Job resource in Kubernetes. ```shell kubectl apply -f job-clear-cache.yaml ``` -------------------------------- ### Configure External Database Connection Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Disable the built-in databases and provide connection details for an external database service. Use 'dbExistingSecret' for production environments to securely manage credentials. ```yaml # Disable all in-cluster databases mariadb-sts: enabled: false postgresql-sts: enabled: false mariadb-subchart: enabled: false postgresql-subchart: enabled: false dbHost: "1.2.3.4" dbPort: "3306" dbRootUser: "admin" # Use dbExistingSecret for production environments dbExistingSecret: "my-external-db-secret" dbExistingSecretPasswordKey: "password" ``` -------------------------------- ### Generate Drop Site Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Use `helm template` to generate the Kubernetes YAML for the drop site job based on the custom values. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-drop-site.yaml > job-drop-site.yaml ``` -------------------------------- ### Generate Configure Bench Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generate the Kubernetes YAML for the configure bench job using `helm template` with the specified custom values and job template. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-configure-bench.yaml > job-configure-bench.yaml ``` -------------------------------- ### Generate Site Backup Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generates the Kubernetes YAML for the site backup job using helm template. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-backup.yaml > job-backup.yaml ``` -------------------------------- ### Configure Site Migration Job Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Enables and configures the 'migrate' job in custom-values.yaml for site migrations. ```yaml jobs: migrate: enabled: true siteName: "erp.example.com" ``` -------------------------------- ### Generate Site Migration Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generates the Kubernetes YAML for the site migration job using helm template. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-migrate-site.yaml > job-migrate-site.yaml ``` -------------------------------- ### Configure Ingress Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Enables and configures Ingress settings in custom-values.yaml for external access to ERPNext. ```yaml ingress: enabled: true ingressName: "erp-example-com" annotations: cert-manager.io/cluster-issuer: letsencrypt-prod kubernetes.io/ingress.class: nginx kubernetes.io/tls-acme: "true" hosts: - host: erp.example.com paths: - path: / pathType: ImplementationSpecific tls: - secretName: erp-example-com-tls hosts: - erp.example.com ``` -------------------------------- ### Apply Volume Permissions Job Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Apply the generated `job-fix-volume-permission.yaml` file to create the Volume Permissions Job resource in Kubernetes. ```shell kubectl apply -f job-fix-volume-permission.yaml ``` -------------------------------- ### Enable Volume Permissions Job Configuration Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Set `jobs.volumePermissions.enabled` to `true` in `custom-values.yaml` to enable the volume permissions job. ```yaml jobs: volumePermissions: enabled: true ``` -------------------------------- ### Update values.yaml for Switchover Source: https://github.com/frappe/helm/blob/main/erpnext/MIGRATION.md Modify your values.yaml file to disable the old Bitnami MariaDB subchart and ensure the new MariaDB StatefulSet is enabled. This configuration change directs Helm to re-run the configure job, pointing to the new database. ```yaml # your-values.yaml # Disable the classic Bitnami subchart mariadb: enabled: false mariadb-subchart: enabled: false # Keep the new built-in StatefulSet enabled mariadb-sts: enabled: true persistence: # storageClass: "default" size: 8Gi ``` -------------------------------- ### Generate Clear Cache Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generate the Kubernetes YAML for the clear cache job using `helm template`. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-clear-cache.yaml > job-clear-cache.yaml ``` -------------------------------- ### Enable Legacy Bitnami Subcharts Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Disable the new built-in database and cache components to enable the classic Bitnami subcharts for MariaDB and Valkey. This is useful for backward compatibility or specific deployment needs. ```yaml # Disable new built-in MariaDB and Valkey mariadb-sts: enabled: false valkey-cache: enabled: false valkey-queue: enabled: false ``` -------------------------------- ### Configure External Services and Disable In-Cluster Databases Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Modify `custom-values.yaml` to disable in-cluster databases and caches, and configure external service hosts for MariaDB and Redis. ```yaml # Disable in-cluster databases and caches mariadb-sts: enabled: false valkey-cache: enabled: false valkey-queue: enabled: false # Configure external services dbHost: "db-instance.123456789012.us-east-1.rds.amazonaws.com" dbPort: 3306 externalRedis: cache: "redis://redis-cache.7abc2d.0001.usw2.cache.amazonaws.com:6379" queue: "redis://redis-queue.7abc2d.0001.usw2.cache.amazonaws.com:6379" jobs: configure: enabled: true ``` -------------------------------- ### Update values.yaml for Built-in StatefulSet Source: https://github.com/frappe/helm/blob/main/erpnext/MIGRATION.md Modify your values.yaml to enable the new built-in database StatefulSet while keeping the old Bitnami subchart active. Configure persistence settings for the new StatefulSet. ```yaml # your-values.yaml # Keep the classic Bitnami subchart enabled mariadb: enabled: true # Or mariadb-subchart.enabled: true # Enable the new built-in StatefulSet and configure it mariadb-sts: enabled: true persistence: # storageClass: "default" # or your preferred storage class size: 8Gi ``` -------------------------------- ### Generate HTTPRoute YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generates the Kubernetes YAML for the HTTPRoute resource using helm template. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/httproute.yaml > httproute.yaml ``` -------------------------------- ### Specify Existing Storage Class Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Use this configuration to point to an existing storage class for persistent volumes. Ensure the specified storage class is available in your Kubernetes cluster. ```yaml persistence: worker: storageClass: "rook-cephfs" ``` -------------------------------- ### Configure HTTPRoute Resource Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Enables and configures HTTPRoute settings in custom-values.yaml for GatewayAPI integration. ```yaml httproute: enabled: true name: "erp-example-com-httproute" annotations: {} parentRefs: - gatewayName: "public-gateway" # name of your Gateway resource gatewayNamespace: "networking" # namespace where the Gateway is defined gatewaySectionName: "http" # listener name (optional), check your gateway requirements hostnames: - "erp.example.com" rules: - matches: - pathType: "PathPrefix" path: "/" ``` -------------------------------- ### Configure Storage Access Modes Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Set the access mode for persistent volumes. 'ReadWriteMany' is the default for multi-node access, but 'ReadWriteOnce' can be used for single-node clusters or specific node deployments. ```yaml persistence: worker: accessModes: - ReadWriteMany # default mode ``` -------------------------------- ### Generate Volume Permissions Job YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generate the Kubernetes YAML for the volume permissions job using `helm template`. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/job-fix-volume-permission.yaml > job-fix-volume-permission.yaml ``` -------------------------------- ### Generate Ingress YAML Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Generates the Kubernetes YAML for the Ingress resource using helm template. ```shell helm template frappe-bench -n erpnext frappe/erpnext -f custom-values.yaml -s templates/ingress.yaml > ingress.yaml ``` -------------------------------- ### Uninstall Frappe Bench Helm Chart Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Delete the `frappe-bench` Helm release and all associated Kubernetes components using the `helm delete` command. ```shell helm --namespace erpnext delete frappe-bench ``` -------------------------------- ### Specify Existing Persistent Volume Claim Source: https://github.com/frappe/helm/blob/main/erpnext/README.md Configure the chart to use an existing Persistent Volume Claim (PVC). Make sure the PVC with the specified name exists in the target namespace. ```yaml persistence: worker: existingClaim: existing-sites ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.