Skip to content

Commit

Permalink
Merge pull request #78 from irfanhakim-as/linkstack
Browse files Browse the repository at this point in the history
Add new LinkStack chart
  • Loading branch information
irfanhakim-as authored Jul 13, 2024
2 parents 42a758c + a3052d1 commit a7fd481
Show file tree
Hide file tree
Showing 13 changed files with 837 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |||
Expand Down
73 changes: 73 additions & 0 deletions logos/linkstack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions mika/linkstack/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
19 changes: 19 additions & 0 deletions mika/linkstack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
url: "https://github.com/irfanhakim-as"
162 changes: 162 additions & 0 deletions mika/linkstack/README.md
Original file line number Diff line number Diff line change
@@ -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: `"[email protected]"`. |
| 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. |
46 changes: 46 additions & 0 deletions mika/linkstack/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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.
Loading

0 comments on commit a7fd481

Please sign in to comment.