Files
Terraform_kube/README.md
T
2025-04-04 09:27:29 +01:00

12 KiB

Terraform deploy

variables

name

Define the name optional (string)

image = string

Define the image tag

pvc =

optional specifiy the pvc details

name = string

Name of the PVC

pvc = optional(bool, false)

PVC - Hostpath - Configmap shouldn't be specifiy at the same time Boolean to specify if it is a PVC Example

config_map = optional(bool, false)

Boolean to specify if it is a configmap Example

host_path = optional(string)

Boolean to specify if it is a hostpath Example

pvc_size = optional(string)

mount_path = string

storage_class_name = optional(string, "nfs-storage-intelligent")

This is the storage class, by default it will use nfs-storage-intelligent but it can be changed to something more suitable

environment = optional(map(object({

name = optional(string)

value = optional(string)

value_from = optional(object({

secret_key_ref = object({

name = string

key = optional(string, null)

replicas = optional(number, 1)

namespace = optional(string)

service_port = optional(number)

service_name = optional(string)

liveness_tcp_socket = optional(number)

liveness_http_get = optional(string)

liveness_http_get_path = optional(string)

database = optional(map(string))

redis = optional(map(string))

enabled = optional(bool, true)

secret_ref = optional(list(string))

config_map_ref = optional(list(string))

requirements = optional(map(string), {

limits-cpu = "800m"

limits-memory = "500Mi"

requests-cpu = "200m"

requests-memory = "200Mi"

environment_variables = optional(map(string), { name = "value" })

not in use anymore

Name

Name of the Deployment Not required , the object name will be used if not specified

examples

enabled

Disable the whole object , including PVC , secrets , deployments and services If you just want to remove the pod , you should consider set the replica option to 0

        enabled   = false

replicas

Set the number of replicas , can be used tyo keep the ressources and only remove the pods

replicas     = 0

namespace

Specify a different namespace , by default it will take the name of the object otherwise

    namespace = "testnginx"

image

Specify the image to use , mandatory

    image = "nginx:latest"

Database

Specifying the object (even empty) will automatically create all the objects related to the database (service,deployment,...)

 database = {}

Custom images version

You can select a custom image, by default it will use postgresql , if you do change the image , check if teh port is the same , otgherwise it will use postgresql defaut port

    database = {
      "image"     = "lscr.io/linuxserver/mariadb"
      
    }

Custom database port

You can select a custom database port , by default it will use postgresql , remember to update the secret for that The database service will be automatically updated to reflect this port as well

    database = {
      "image"     = "lscr.io/linuxserver/mariadb"
      "port"      = 3306
      
    }

Custom mountpath

You can select a custom mount path, by default it will use postgresql data folder (/var/lib/postgresql/data)

    database = {
      "mountPath" = "/config"
    }

redis

Specifying the object (even empty) will automatically create all the objects related to Redis (service,deployment,...)

 redis = {}

Custom images version

You can select a custom image, by default it will use redis version 7 (docker.io/library/redis:7)

redis = {
    image = "docker.io/library/redis:7" 
    }

Extra manifest

You can add some extra manifest using this command

    extra_manifest = ["/opt/kubernetes/Bookstack_kube/Bookstack.configmap.yaml","/opt/kubernetes/Bookstack_kube/Bookstack.secret.yaml"]

environment

Simple environment variables

You can specifiy a variable through the environment object

    environment = {
      PORT = {
        value = "80"
      }
    }

environment_variables from a secret

    environment = {
      MYSQL_ROOT_PASSWORD = {
        value_from = {
          secret_key_ref = {
            name = "bookstack-credentials"
            key  = "DB_PASS"
          }
        }
      }
    }

Secret reference

You can have your secret fully mounted instead of specifiying all the variables secret_ref = ["secret1"]

Volumes

Volume as PVC

 pvc = {
      paperless-data = {
        pvc        = true
        name       = "paperless-data"
        pvc_size   = "2Mi"
        mount_path = "/usr/src/paperless/data"
      }
    }

Volume as Hostpath

 pvc = {
      export = {
        #        pvc        = true
        host_path  = "/tmp"
        name       = "export"
        pvc_size   = "2Mi"
        mount_path = "/usr/src/paperless/export"
      }
    }

Volume as configmap

 pvc = {
      media = {
        pvc        = false
        config_map = true
        name       = "gitea-runner-configfile"
        pvc_size   = "2Mi"
        mount_path = "/tmp/usr/src/paperless/media"
      }

    }

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Already a pro? Just edit this README.md and make it your own. Want to make it easy? Use the template at the bottom!

Add your files

[ ] Create or upload files

[ ] Add files using the command line or push an existing Git repository with the following command:

cd existing_repo
git remote add origin https://gitea.tryton.geeraert.eu/pi-ux-ce/Bitwarden_kube.git
git branch -M main
git push -uf origin main

Integrate with your tools

[ ] Set up project integrations

Collaborate with your team

[ ] Invite team members and collaborators

[ ] Create a new merge request

[ ] Automatically close issues from merge requests

[ ] Enable merge request approvals

[ ] Set auto-merge

Test and Deploy

Use the built-in continuous integration in GitLab.

[ ] Get started with GitLab CI/CD

[ ] Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)

[ ] Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy

[ ] Use pull-based deployments for improved Kubernetes management

[ ] Set up protected environments


Editing this README

When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want ### this is just a starting point!). Thanks to makeareadme.com for this template.

Suggestions for a good README

Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.

Name

Choose a self-explaining name for your project.

Description

Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.

Badges

On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.

Visuals

Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.

Installation

Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.

Usage

Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.

Support

Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.

Roadmap

If you have ideas for releases in the future, it is a good idea to list them in the README.

Contributing

State if you are open to contributions and what your requirements are for accepting them.

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.

Authors and acknowledgment

Show your appreciation to those who have contributed to the project.

License

For open source projects, say how it is licensed.

Project status

If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.