This commit refactors the CryptPad Kubernetes installer to be more dynamic and configurable structure. Key changes include: - **Dynamic Configuration**: The installer now generates its configuration based on parameters passed from the `.vsh` script, with sensible defaults for any unspecifie d values. - **Templated `config.js`**: Introduced a new `config.js` template to allow for greater flexibility and easier maintenance of the CryptPad configuration. - **Improved Code Structure**: The source code has been updated to be more modular and maintainable. - **Updated Documentation**: The `README.md` has been updated to include instructions on how to run the installer and customize the installation. Co-authored-by: Mahmoud-Emad <mahmmoud.hassanein@gmail.com>
1.5 KiB
1.5 KiB
CryptPad Kubernetes Installer
A Kubernetes installer for CryptPad with TFGrid Gateway integration.
Quick Start
import incubaid.herolib.installers.k8s.cryptpad
// Create and install CryptPad
mut installer := cryptpad.get(
name: 'mycryptpad'
create: true
)!
installer.install()!
to change the hostname and the namespace, you can override the default values:
mut installer := cryptpad.get(
name: 'mycryptpad'
create: true
)!
installer.hostname = 'customhostname'
installer.namespace = 'customnamespace'
installer.install()!
Usage
Running the Installer
You can run the installer directly from the command line using the example script:
./examples/installers/k8s/cryptpad.vsh
This will install CryptPad with the default settings. To customize the installation, you can edit the cryptpad.vsh file.
Create an Instance
mut installer := cryptpad.get(
name: 'mycryptpad' // Unique name for this instance
create: true // Create if doesn't exist
)!
The instance name will be used as:
- Kubernetes namespace name
- Hostname prefix (e.g.,
mycryptpad.gent01.grid.tf)
Install
installer.install()!
This will:
- Generate Kubernetes YAML files for CryptPad and TFGrid Gateway
- Apply them to your k3s cluster
- Wait for deployment to be ready
Destroy
installer.destroy()!
Removes all CryptPad resources from the cluster.
Requirements
- kubectl installed and configured
- k3s cluster running
- Redis server running (for configuration storage)