diff --git a/README.md b/README.md index fb1a037c..150d2567 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Applications, developed or curated by [mika](https://github.com/irfanhakim-as), | [flex](mika/flex) | Flex is a collection of curated services that aims to provide a complete home media server solution. | ✅ | ✅ | | [grocy](mika/grocy) | Grocy is a web-based self-hosted groceries & household management solution for your home. | ✅ | ✅ | | [kutt](mika/kutt) | Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics. | ✅ | ✅ | +| [linkstack](mika/linkstack) | LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface. | ✅ | ✅ | | [mango](mika/mango) | Mango is an easy to use Mastodon bot framework built on top of Django. | ✅ | 🔒 | | [mariadb-agent](mika/mariadb-agent) | Easily create or delete multiple pairs of databases and users in a remote MariaDB instance. | ✅ | ✅ | | [postgres](mika/postgres) | Easy tool to deploy a PostgreSQL instance on Kubernetes. | ✅ | ✅ | diff --git a/logos/linkstack.svg b/logos/linkstack.svg new file mode 100644 index 00000000..7d34b496 --- /dev/null +++ b/logos/linkstack.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mika/linkstack/.helmignore b/mika/linkstack/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/mika/linkstack/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/mika/linkstack/Chart.yaml b/mika/linkstack/Chart.yaml new file mode 100644 index 00000000..732f7a99 --- /dev/null +++ b/mika/linkstack/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +name: linkstack +description: LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface. +type: application +version: 0.1.0 +appVersion: "latest" +keywords: + - "linkstack" + - "linktree" +home: "https://github.com/irfanhakim-as/charts" +icon: "https://irfanhakim-as.github.io/charts/logos/linkstack.svg" +sources: + - "https://github.com/LinkStackOrg/LinkStack" + - "https://github.com/LinkStackOrg/linkstack-docker" + - "https://github.com/irfanhakim-as/charts" +maintainers: + - name: "Irfan Hakim" + email: "irfanhakim.as@yahoo.com" + url: "https://github.com/irfanhakim-as" diff --git a/mika/linkstack/README.md b/mika/linkstack/README.md new file mode 100644 index 00000000..bccbfa5e --- /dev/null +++ b/mika/linkstack/README.md @@ -0,0 +1,162 @@ +# [LinkStack](https://github.com/LinkStackOrg/LinkStack) + +LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface. + +## Prerequisites + +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + +- Kubernetes 1.19+ +- Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- + +## External dependencies + +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +**This section does not apply to this chart.** + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- + +## How to install or upgrade a chart release + +1. Get the values file of the LinkStack chart or an existing installation (release). + + Get the latest LinkStack chart values file for a new installation: + + ```sh + helm show values mika/linkstack > values.yaml + ``` + + Alternatively, get the values file of an existing LinkStack release: + + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` + + Replace `${releaseName}` and `${namespace}` accordingly. + +2. Edit your LinkStack values file with the intended configurations: + + ```sh + nano values.yaml + ``` + + Pay extra attention to the descriptions and sample values provided in the chart values file. + +3. Install a new release for LinkStack or upgrade an existing LinkStack release: + + ```sh + helm upgrade --install ${releaseName} mika/linkstack --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` + + Replace `${releaseName}` and `${namespace}` accordingly. + +4. Verify that your LinkStack release has been installed: + + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` + + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. + +--- + +## How to uninstall a chart release + +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. + +1. Uninstall the desired release: + + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` + + Replace `${releaseName}` and `${namespace}` accordingly. + +2. Verify that the release has been uninstalled: + + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` + + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. + +--- + +## Chart configurations + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| image.init.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Init container image. Default: `"IfNotPresent"`. | +| image.init.registry | string | `""` | The registry where the Init container image is hosted. Default: `"docker.io"`. | +| image.init.repository | string | `""` | The name of the repository that contains the Init container image used. Default: `"linkstackorg/linkstack"`. | +| image.init.tag | string | `""` | The tag that specifies the version of the Init container image used. Default: `Chart appVersion`. | +| image.linkstack.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the LinkStack container image. Default: `"IfNotPresent"`. | +| image.linkstack.registry | string | `""` | The registry where the LinkStack container image is hosted. Default: `"docker.io"`. | +| image.linkstack.repository | string | `""` | The name of the repository that contains the LinkStack container image used. Default: `"linkstackorg/linkstack"`. | +| image.linkstack.tag | string | `""` | The tag that specifies the version of the LinkStack container image used. Default: `Chart appVersion`. | +| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | +| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting LinkStack services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | +| linkstack.domain | string | `""` | The ingress domain name that hosts the LinkStack server. Default: `"localhost"`. | +| linkstack.initScript | string | `""` | Custom init script to run before the LinkStack container starts. | +| linkstack.logLevel | string | `""` | The level of verbosity of the messages recorded in the error log. Default: `"info"`. | +| linkstack.phpMemLimit | string | `""` | The maximum amount of memory PHP scripts are allowed to allocate. Default: `"256M"`. | +| linkstack.serverAdmin | string | `""` | The Apache server administrator email address. Default: `"admin@example.com"`. | +| linkstack.timezone | string | `""` | The timezone of the LinkStack server. Default: `"UTC"`. | +| linkstack.uploadMaxFilesize | string | `""` | The maximum allowed file size for uploaded files. Default: `"8M"`. | +| replicaCount | string | `""` | The desired number of running replicas for LinkStack. Default: `"1"`. | +| resources.linkstack | object | `{}` | LinkStack container resources. | +| service.http.nodePort | string | `""` | The optional node port to expose for http when the service type is NodePort. | +| service.http.port | string | `""` | The http port on which the LinkStack server should listen. Default: `"80"`. | +| service.https.nodePort | string | `""` | The optional node port to expose for https when the service type is NodePort. | +| service.https.port | string | `""` | The https port on which the LinkStack server should listen. Default: `"443"`. | +| service.type | string | `""` | The type of service used for LinkStack services. Default: `"ClusterIP"`. | +| storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteOnce"`. | +| storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | +| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/htdocs"`. | +| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"1Gi"`. | +| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. | +| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. | \ No newline at end of file diff --git a/mika/linkstack/templates/NOTES.txt b/mika/linkstack/templates/NOTES.txt new file mode 100644 index 00000000..e4f1ca0b --- /dev/null +++ b/mika/linkstack/templates/NOTES.txt @@ -0,0 +1,46 @@ +{{- $ingress := .Values.ingress.enabled }} +{{- $domain := .Values.linkstack.domain | toString }} +{{- $http := .Values.service.http.port | default "80" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-linkstack-svc" .Release.Name | toString }} +{{- $serviceAddress := "" }} +LinkStack has been installed and configured for {{ .Release.Name | toString }} 🎉 + +{{- if $ingress }} +{{- $serviceAddress = printf "https://%s" $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} + +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "linkstack.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $http | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + +{{- end }} + +{{- if $serviceAddress }} + +Visit the following service at the provided address: + + - LinkStack: {{ $serviceAddress }} + +{{- else }} + + ⚠️ This chart may have no accessible services available + +{{- end }} + +For more information on how to use and configure LinkStack, please refer to the official documentation. \ No newline at end of file diff --git a/mika/linkstack/templates/_helpers.tpl b/mika/linkstack/templates/_helpers.tpl new file mode 100644 index 00000000..749f2e0a --- /dev/null +++ b/mika/linkstack/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "linkstack.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "linkstack.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "linkstack.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "linkstack.labels" -}} +helm.sh/chart: {{ include "linkstack.chart" . }} +{{ include "linkstack.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "linkstack.selectorLabels" -}} +app.kubernetes.io/name: {{ include "linkstack.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "linkstack.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "linkstack.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/mika/linkstack/templates/configmap.yaml b/mika/linkstack/templates/configmap.yaml new file mode 100644 index 00000000..15137a8c --- /dev/null +++ b/mika/linkstack/templates/configmap.yaml @@ -0,0 +1,21 @@ +{{- $domain := .Values.linkstack.domain | default "localhost" | toString | quote }} +{{- $logLevel := .Values.linkstack.logLevel | default "info" | toString | quote }} +{{- $phpMemLimit := .Values.linkstack.phpMemLimit | default "256M" | toString | quote }} +{{- $serverAdmin := .Values.linkstack.serverAdmin | default "admin@example.com" | toString | quote }} +{{- $timezone := .Values.linkstack.timezone | default "UTC" | toString | quote }} +{{- $uploadMaxFilesize := .Values.linkstack.uploadMaxFilesize | default "8M" | toString | quote }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-linkstack-cm + labels: + {{- include "linkstack.labels" . | nindent 4 }} +data: + HTTP_SERVER_NAME: {{ $domain }} + HTTPS_SERVER_NAME: {{ $domain }} + LOG_LEVEL: {{ $logLevel }} + PHP_MEMORY_LIMIT: {{ $phpMemLimit }} + SERVER_ADMIN: {{ $serverAdmin }} + TZ: {{ $timezone }} + UPLOAD_MAX_FILESIZE: {{ $uploadMaxFilesize }} diff --git a/mika/linkstack/templates/deployment.yaml b/mika/linkstack/templates/deployment.yaml new file mode 100644 index 00000000..fcd8073e --- /dev/null +++ b/mika/linkstack/templates/deployment.yaml @@ -0,0 +1,111 @@ +{{- $dataPersistence := .Values.storage.data.enabled }} +{{- $linkstack_registry := .Values.image.linkstack.registry | default "docker.io" | toString }} +{{- $linkstack_repository := .Values.image.linkstack.repository | default "linkstackorg/linkstack" | toString }} +{{- $linkstack_tag := .Values.image.linkstack.tag | default .Chart.AppVersion | toString }} +{{- $linkstack_pullPolicy := .Values.image.linkstack.pullPolicy | default "IfNotPresent" | toString | quote }} +{{- $init_registry := .Values.image.init.registry | default "docker.io" | toString }} +{{- $init_repository := .Values.image.init.repository | default "linkstackorg/linkstack" | toString }} +{{- $init_tag := .Values.image.init.tag | default .Chart.AppVersion | toString }} +{{- $init_pullPolicy := .Values.image.init.pullPolicy | default "IfNotPresent" | toString | quote }} +{{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/htdocs" | toString }} +{{- $dataSubPath := .Values.storage.data.subPath | toString }} +{{- $initScript := .Values.linkstack.initScript | toString }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-linkstack + labels: + {{- include "linkstack.labels" . | nindent 4 }} +spec: + replicas: {{ int $replica_count }} + selector: + matchLabels: + {{- include "linkstack.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "linkstack.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if or $dataPersistence $initScript }} + {{- $initDataMountPath := printf "/mnt/%s" ($dataMountPath | trimPrefix "/") | toString }} + initContainers: + - name: init + image: {{ printf "%s/%s:%s" $init_registry $init_repository $init_tag | quote }} + imagePullPolicy: {{ $init_pullPolicy }} + command: ["/bin/sh"] + args: + - -c + - >- + {{- if $initScript }} + {{- $initScript | nindent 14 }} + {{- else }} + if [ -z "$(ls -A {{ $initDataMountPath }} | grep -v 'lost+found')" ]; then + echo "Initialising {{ $initDataMountPath }}" + cp -Ra /htdocs/. {{ $initDataMountPath }} + chown -R apache: {{ $initDataMountPath }} + find {{ $initDataMountPath }} -type d -exec chmod 755 {} \; + find {{ $initDataMountPath }} -type f -exec chmod 644 {} \; + else + echo "Skipping initialisation as {{ $initDataMountPath }} is not empty" + fi + {{- end }} + envFrom: + - configMapRef: + name: {{ .Release.Name }}-linkstack-cm + {{- if or $dataPersistence }} + volumeMounts: + {{- if $dataPersistence }} + - name: {{ .Release.Name }}-linkstack-data + mountPath: {{ $initDataMountPath | quote }} + {{- if $dataSubPath }} + subPath: {{ $dataSubPath | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + containers: + - name: linkstack + image: {{ printf "%s/%s:%s" $linkstack_registry $linkstack_repository $linkstack_tag | quote }} + imagePullPolicy: {{ $linkstack_pullPolicy }} + ports: + - name: linkstack-http + containerPort: 80 + protocol: TCP + - name: linkstack-https + containerPort: 443 + protocol: TCP + resources: + {{- toYaml .Values.resources.linkstack | nindent 12 }} + envFrom: + - configMapRef: + name: {{ .Release.Name }}-linkstack-cm + {{- if or $dataPersistence }} + volumeMounts: + {{- if $dataPersistence }} + - name: {{ .Release.Name }}-linkstack-data + mountPath: {{ $dataMountPath | quote }} + {{- if $dataSubPath }} + subPath: {{ $dataSubPath | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- if or $dataPersistence }} + volumes: + {{- if $dataPersistence }} + - name: {{ .Release.Name }}-linkstack-data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-linkstack-data-pvc + {{- end }} + {{- end }} + securityContext: + fsGroup: 101 diff --git a/mika/linkstack/templates/ingress.yaml b/mika/linkstack/templates/ingress.yaml new file mode 100644 index 00000000..c53b0faf --- /dev/null +++ b/mika/linkstack/templates/ingress.yaml @@ -0,0 +1,60 @@ +{{- $ingress := .Values.ingress.enabled }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.linkstack.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-linkstack-ingress + labels: + {{- include "linkstack.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} + cert-manager.io/private-key-algorithm: "ECDSA" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/proxy-body-size: "100m" + nginx.ingress.kubernetes.io/session-cookie-expires: "172800" + nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} +spec: + ingressClassName: "nginx" + rules: + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-linkstack-svc + port: + name: linkstack-http + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-linkstack-svc + port: + name: linkstack-http + path: / + pathType: Prefix + {{- end }} + tls: + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-linkstack-tls-cert +{{- end }} diff --git a/mika/linkstack/templates/pvc.yaml b/mika/linkstack/templates/pvc.yaml new file mode 100644 index 00000000..67162fdc --- /dev/null +++ b/mika/linkstack/templates/pvc.yaml @@ -0,0 +1,20 @@ +{{- $dataPersistence := .Values.storage.data.enabled }} +{{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteOnce" | toString | quote }} +{{- $dataStorage := .Values.storage.data.storage | default "1Gi" | toString | quote }} +{{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} +{{- if $dataPersistence }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-linkstack-data-pvc + labels: + {{- include "linkstack.labels" . | nindent 4 }} +spec: + accessModes: + - {{ $dataAccessMode }} + resources: + requests: + storage: {{ $dataStorage }} + storageClassName: {{ $dataStorageClassName }} +{{- end }} diff --git a/mika/linkstack/templates/service.yaml b/mika/linkstack/templates/service.yaml new file mode 100644 index 00000000..c8dfc91c --- /dev/null +++ b/mika/linkstack/templates/service.yaml @@ -0,0 +1,31 @@ +{{- $http := .Values.service.http.port | default "80" | toString }} +{{- $httpNodePort := .Values.service.http.nodePort | toString }} +{{- $https := .Values.service.https.port | default "443" | toString }} +{{- $httpsNodePort := .Values.service.https.nodePort | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-linkstack-svc + labels: + {{- include "linkstack.labels" . | nindent 4 }} +spec: + type: {{ $type }} + ports: + - port: {{ int $http }} + targetPort: linkstack-http + {{- if and (eq $type "NodePort") $httpNodePort }} + nodePort: {{ int $httpNodePort }} + {{- end }} + protocol: TCP + name: linkstack-http + - port: {{ int $https }} + targetPort: linkstack-https + {{- if and (eq $type "NodePort") $httpsNodePort }} + nodePort: {{ int $httpsNodePort }} + {{- end }} + protocol: TCP + name: linkstack-https + selector: + {{- include "linkstack.selectorLabels" . | nindent 4 }} diff --git a/mika/linkstack/values.yaml b/mika/linkstack/values.yaml new file mode 100644 index 00000000..a982bf2b --- /dev/null +++ b/mika/linkstack/values.yaml @@ -0,0 +1,208 @@ +# Default values for linkstack. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# The desired number of running replicas for LinkStack. +# Default: "1" +replicaCount: "" + +# Container images used for LinkStack. +image: + # LinkStack container image configurations. + # Source: https://hub.docker.com/r/linkstackorg/linkstack + linkstack: + # The registry where the LinkStack container image is hosted. + # Default: "docker.io" + registry: "" + # The name of the repository that contains the LinkStack container image used. + # Default: "linkstackorg/linkstack" + repository: "" + # The tag that specifies the version of the LinkStack container image used. + # Default: Chart appVersion + tag: "" + # The policy that determines when Kubernetes should pull the LinkStack container image. + # Default: "IfNotPresent" + pullPolicy: "" + # Init container image configurations. + # Source: https://hub.docker.com/_/busybox + init: + # The registry where the Init container image is hosted. + # Default: "docker.io" + registry: "" + # The name of the repository that contains the Init container image used. + # Default: "linkstackorg/linkstack" + repository: "" + # The tag that specifies the version of the Init container image used. + # Default: Chart appVersion + tag: "" + # The policy that determines when Kubernetes should pull the Init container image. + # Default: "IfNotPresent" + pullPolicy: "" + +# Credentials used to securely authenticate and authorise the pulling of container images from private registries. +# Example: +# imagePullSecrets: +# - name: "ghcr-token-secret" +imagePullSecrets: [] + +# LinkStack configurations. +linkstack: + # The ingress domain name that hosts the LinkStack server. + # Default: "localhost" + # Example: + # domain: "linkstack.example.com" + domain: "" + # Custom init script to run before the LinkStack container starts. + # Example: + # initScript: >- + # echo "Hello, World!" + # echo "This is a custom init script." + initScript: "" + # The level of verbosity of the messages recorded in the error log. + # Default: "info" + # Example: + # logLevel: "debug" + logLevel: "" + # The maximum amount of memory PHP scripts are allowed to allocate. + # Default: "256M" + # Example: + # phpMemLimit: "512M" + phpMemLimit: "" + # The Apache server administrator email address. + # Default: "admin@example.com" + # Example: + # serverAdmin: "foo@example.com" + serverAdmin: "" + # The timezone of the LinkStack server. + # Default: "UTC" + # Example: + # timezone: "Asia/Kuala_Lumpur" + timezone: "" + # The maximum allowed file size for uploaded files. + # Default: "8M" + # Example: + # uploadMaxFilesize: "10M" + uploadMaxFilesize: "" + +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting LinkStack services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Additional configuration annotations to be added to the Ingress resource. + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # - prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + +# Service configurations. +service: + # HTTP service port configurations. + http: + # The optional node port to expose for http when the service type is NodePort. + # Example: + # nodePort: "30000" + nodePort: "" + # The http port on which the LinkStack server should listen. + # Default: "80" + # Example: + # port: "8080" + port: "" + # HTTPS service port configurations. + https: + # The optional node port to expose for https when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The https port on which the LinkStack server should listen. + # Default: "443" + # Example: + # port: "8443" + port: "" + # The type of service used for LinkStack services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + +# Storage configurations. +storage: + # Data storage configurations. + data: + # Specifies whether persistent storage should be provisioned for data storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the data storage can be mounted. + # Default: "ReadWriteOnce" + # Example: + # accessMode: "ReadWriteMany" + accessMode: "" + # The path where the data storage should be mounted on the container. + # Default: "/htdocs" + # Example: + # mountPath: "/data" + mountPath: "" + # The subpath within the data storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the data storage. + # Default: "1Gi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the data storage. + # Default: "longhorn" + # Example: + # storageClassName: "longhorn" + storageClassName: "" + +# Resource requirements and limits for LinkStack containers. +resources: + # LinkStack container resources. + # Example: + # linkstack: + # # The minimum amount of resources required by LinkStack to run. + # requests: + # # The minimum amount of CPU resources required by LinkStack. + # # Example: + # # cpu: "10m" + # cpu: "150m" + # # The minimum amount of memory required by LinkStack. + # # Example: + # # memory: "10Mi" + # memory: "250Mi" + # # The maximum amount of resources allowed for LinkStack. + # limits: + # # The maximum amount of CPU resources allowed for LinkStack. + # # Example: + # # cpu: "250m" + # cpu: "300m" + # # The maximum amount of memory allowed for LinkStack. + # # Example: + # # memory: "250Mi" + # memory: "350Mi" + linkstack: {}