[jetbrains-projector] - New Chart (#776)

* add initial push of jetbrains-projector

* Working version

* Update charts/stable/jetbrains-projector/README_CHANGELOG.md.gotmpl

Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>

* link is totally broken

* cleanup and final push

* add a forced fail on image.repository

* add testing values

* move ct values

* fix ct test folder name

Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
Nicholas St. Germain 2021-04-13 16:41:18 -05:00 committed by GitHub
parent 9477520291
commit ea6d401f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 554 additions and 1 deletions

View File

@ -0,0 +1,56 @@
apiVersion: v2
description: Projector is a technology to run and access JetBrains IDEs remotely
name: jetbrains-projector
version: 1.0.0
kubeVersion: ">=1.16.0-0"
keywords:
- jetbrains
- projector
- jetbrains-projector
home: https://github.com/k8s-at-home/charts/tree/master/charts/stable/jetbrains-projector
icon: https://pbs.twimg.com/profile_images/1369990348580216834/dorDbokA_400x400.png
sources:
- https://github.com/JetBrains/projector-server
maintainers:
- name: DirtyCajunRice
email: nick@cajun.pro
dependencies:
- name: common
repository: https://library-charts.k8s-at-home.com
version: 2.2.0
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/links: |
- name: Chart Source
url: https://github.com/k8s-at-home/charts/tree/master/charts/stable/jetbrains-projector
- name: Upstream Project
url: https://github.com/JetBrains/projector-server
- name: Original Containers
url: https://github.com/JetBrains/projector-docker
- name: Support
url: https://discord.com/invite/sTMX7Vh
- name: Containers
url: https://github.com/orgs/k8s-at-home/packages?tab=packages&q=projector
artifacthub.io/maintainers: |
- name: Nicholas St. Germain
email: nick@cajun.pro
url: https://github.com/DirtyCajunRice
artifacthub.io/images: |
- name: CLion
image: ghcr.io/k8s-at-home/projector-clion:v2021.1
- name: DataGrip
image: ghcr.io/k8s-at-home/projector-datagriip:v2021.1
- name: GoLand
image: ghcr.io/k8s-at-home/projector-goland:v2021.1
- name: Intellij Idea Community
image: ghcr.io/k8s-at-home/projector-idea-c:v2021.1
- name: Intellij dea Ultimate
image: ghcr.io/k8s-at-home/projector-idea-u:v2021.1
- name: PhpStorm
image: ghcr.io/k8s-at-home/projector-phpstorm:v2021.1
- name: PyCharm Community
image: ghcr.io/k8s-at-home/projector-pycharm-c:v2021.1
- name: Pycharm Professional
image: ghcr.io/k8s-at-home/projector-pycharm-p:v2021.1
- name: WebStorm
image: ghcr.io/k8s-at-home/projector-webstorm:v2021.1

View File

@ -0,0 +1,122 @@
# jetbrains-projector
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square)
Projector is a technology to run and access JetBrains IDEs remotely
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)**
## Source Code
* <https://github.com/JetBrains/projector-server>
## Requirements
Kubernetes: `>=1.16.0-0`
## Dependencies
| Repository | Name | Version |
|------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 2.2.0 |
## TL;DR
```console
helm repo add k8s-at-home https://k8s-at-home.com/charts/
helm repo update
helm install jetbrains-projector k8s-at-home/jetbrains-projector
```
## Installing the Chart
To install the chart with the release name `jetbrains-projector`
```console
helm install jetbrains-projector k8s-at-home/jetbrains-projector
```
## Uninstalling the Chart
To uninstall the `jetbrains-projector` deployment
```console
helm uninstall jetbrains-projector
```
The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.
## Configuration
Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.
Other values may be used from the [values.yaml](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml) from the [common library](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common).
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
helm install jetbrains-projector \
--set env.TZ="America/New York" \
k8s-at-home/jetbrains-projector
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
```console
helm install jetbrains-projector k8s-at-home/jetbrains-projector -f values.yaml
```
## Custom configuration
These environment variables will set write and read-only keys respectively:
```yaml
env:
ORG_JETBRAINS_PROJECTOR_SERVER_HANDSHAKE_TOKEN: "admin-password"
ORG_JETBRAINS_PROJECTOR_SERVER_RO_HANDSHAKE_TOKEN: "read-only-password"
```
## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| env | object | `{}` | |
| idea | object | `{}` | IDE settings overrides. See the prospective IDE docs (like pycharm)[https://www.jetbrains.com/help/pycharm/tuning-the-ide.html#common-platform-properties] for more info. Default config paths will be /config/* E.G. `idea.system.path=/config/system` |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.registry | string | `"ghcr.io/k8s-at-home"` | registry that hosts the image |
| image.repository | string | `""` | image repository. *MUST SPECIFY AN IMAGE* |
| image.tag | string | `"v2021.1"` | image tag |
| ingress.enabled | bool | `false` | |
| persistence.config.emptyDir.enabled | bool | `false` | |
| persistence.config.enabled | bool | `false` | |
| persistence.config.mountPath | string | `"/config"` | |
| service.port.port | int | `8887` | |
| sslGen.certs.crt | string | `"tls.crt"` | key that holds the tls crt |
| sslGen.certs.key | string | `"tls.key"` | key that holds the tls key |
| sslGen.certs.secret | string | `""` | name of secret to mount that has the TLS certs |
| sslGen.enabled | bool | `false` | enable automatic conversion of mounted TLS certs to JKS for WSS protocol |
| sslGen.jks.dest | string | `"/tmp/cert.jks"` | location of generated cert.jks used |
| sslGen.properties.existingSecret | string | `""` | pre-existing ssl.properties secret |
| sslGen.properties.key | string | `"ssl.properties"` | key that holds ssl.properties file |
| strategy.type | string | `"Recreate"` | |
## Changelog
All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common#changelog).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [1.0.0]
#### Added
- Initial version
[1.0.0]: #1.0.0
## Support
- See the [Docs](https://docs.k8s-at-home.com/our-helm-charts/introduction/)
- Open an [issue](https://github.com/k8s-at-home/charts/issues/new/choose)
- Ask a [question](https://github.com/k8s-at-home/organization/discussions)
- Join our [Discord](https://discord.gg/sTMX7Vh) community

View File

@ -0,0 +1,145 @@
{{- define "custom.repository.organization" -}}
k8s-at-home
{{- end -}}
{{- define "custom.repository.url" -}}
https://github.com/k8s-at-home/charts
{{- end -}}
{{- define "custom.helm.url" -}}
https://k8s-at-home.com/charts/
{{- end -}}
{{- define "custom.helm.path" -}}
{{ template "custom.repository.organization" . }}/{{ template "chart.name" . }}
{{- end -}}
{{- define "custom.notes" -}}
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)**
{{- end -}}
{{- define "custom.requirements" -}}
## Requirements
{{ template "chart.kubeVersionLine" . }}
{{- end -}}
{{- define "custom.dependencies" -}}
## Dependencies
{{ template "chart.requirementsTable" . }}
{{- end -}}
{{- define "custom.install.tldr" -}}
## TL;DR
```console
helm repo add {{ template "custom.repository.organization" . }} {{ template "custom.helm.url" . }}
helm repo update
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.install" -}}
## Installing the Chart
To install the chart with the release name `{{ template "chart.name" . }}`
```console
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.uninstall" -}}
## Uninstalling the Chart
To uninstall the `{{ template "chart.name" . }}` deployment
```console
helm uninstall {{ template "chart.name" . }}
```
The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release.
{{- end -}}
{{- define "custom.configuration.header" -}}
## Configuration
{{- end -}}
{{- define "custom.configuration.readValues" -}}
Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values.
Other values may be used from the [values.yaml](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml) from the [common library](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common).
{{- end -}}
{{- define "custom.configuration.example.set" -}}
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
helm install {{ template "chart.name" . }} \
--set env.TZ="America/New York" \
{{ template "custom.helm.path" . }}
```
{{- end -}}
{{- define "custom.configuration.example.file" -}}
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.
```console
helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -f values.yaml
```
{{- end -}}
{{- define "custom.valuesSection" -}}
## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
{{ template "chart.valuesTable" . }}
{{- end -}}
{{- define "custom.support" -}}
## Support
- See the [Docs](https://docs.k8s-at-home.com/our-helm-charts/introduction/)
- Open an [issue](https://github.com/k8s-at-home/charts/issues/new/choose)
- Ask a [question](https://github.com/k8s-at-home/organization/discussions)
- Join our [Discord](https://discord.gg/sTMX7Vh) community
{{- end -}}
{{ template "chart.header" . }}
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "chart.description" . }}
{{ template "custom.notes" . }}
{{ template "chart.sourcesSection" . }}
{{ template "custom.requirements" . }}
{{ template "custom.dependencies" . }}
{{ template "custom.install.tldr" . }}
{{ template "custom.install" . }}
{{ template "custom.uninstall" . }}
{{ template "custom.configuration.header" . }}
{{ template "custom.configuration.readValues" . }}
{{ template "custom.configuration.example.set" . }}
{{ template "custom.configuration.example.file" . }}
{{ template "custom.custom.configuration" . }}
{{ template "custom.valuesSection" . }}
{{ template "custom.changelog" . }}
{{ template "custom.support" . }}
{{ template "helm-docs.versionFooter" . }}

View File

@ -0,0 +1,19 @@
{{- define "custom.changelog.header" -}}
## Changelog
{{- end -}}
{{- define "custom.changelog" -}}
{{ template "custom.changelog.header" . }}
All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common#changelog).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [1.0.0]
#### Added
- Initial version
[1.0.0]: #1.0.0
{{- end -}}

View File

@ -0,0 +1,13 @@
{{- define "custom.custom.configuration.header" -}}
## Custom configuration
{{- end -}}
{{- define "custom.custom.configuration" -}}
{{ template "custom.custom.configuration.header" . }}
These environment variables will set write and read-only keys respectively:
```yaml
env:
ORG_JETBRAINS_PROJECTOR_SERVER_HANDSHAKE_TOKEN: "admin-password"
ORG_JETBRAINS_PROJECTOR_SERVER_RO_HANDSHAKE_TOKEN: "read-only-password"
```
{{- end -}}

View File

@ -0,0 +1,3 @@
image:
repository: "projector-pycharm-c"
tag: v2021.1

View File

@ -0,0 +1 @@
{{- include "common.notes.defaultNotes" . -}}

View File

@ -0,0 +1,53 @@
{{- define "print-or-recurse" -}}
{{- if and (kindIs "string" .value) .value -}}
{{- printf "%s=%s" .key .value | nindent 0 -}}
{{- else if and (kindIs "map" .value) .value -}}
{{- $key := .key -}}
{{- range $subKey, $value := .value -}}
{{- template "print-or-recurse" (dict "key" (printf "%s.%s" $key $subKey) "value" $value) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "jetbrains-projector.configmap.volume" -}}
name: idea-properties
configMap:
name: {{ template "common.names.fullname" . }}-config
{{- end -}}
{{- define "jetbrains-projector.configmap.volumeMount" -}}
name: idea-properties
mountPath: /tmp/idea.properties
subPath: idea.properties
{{- end -}}
{{- define "jetbrains-projector.certs.volume" -}}
name: certs
secret:
secretName: {{ required "a secret name is required when sslGen is enabled" .Values.sslGen.certs.secret }}
{{- end -}}
{{- define "jetbrains-projector.certs.volumeMount" -}}
name: certs
mountPath: /tmp/certs
{{- end -}}
{{- define "jetbrains-projector.secret.volume" -}}
name: ssl-properties
secret:
secretName: {{ default (printf "%s-secrets" (include "common.names.fullname" .)) .Values.sslGen.properties.existingSecret }}
{{- end -}}
{{- define "jetbrains-projector.secret.volumeMount" -}}
name: ssl-properties
mountPath: /tmp/{{ .Values.sslGen.properties.key }}
subPath: {{ .Values.sslGen.properties.key }}
{{- end -}}
{{- define "jetbrains-projector.ide" -}}
{{- $ide := without (splitList "-" (last (splitList "/" .Values.image.repository))) "projector" "c" "u" "p" | first -}}
{{- if eq $ide "webstorm" -}}
{{- $ide = "webide" -}}
{{- end -}}
{{- $ide -}}
{{- end -}}

View File

@ -0,0 +1,48 @@
{{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }}
{{/* Append the configMap to the additionalVolumes */}}
{{- $volume := include "jetbrains-projector.configmap.volume" . | fromYaml -}}
{{- $additionalVolumes := append .Values.additionalVolumes $volume -}}
{{/* Append the configMap volume to the additionalVolumeMounts */}}
{{- $volumeMount := include "jetbrains-projector.configmap.volumeMount" . | fromYaml -}}
{{- $additionalVolumeMounts := append .Values.additionalVolumeMounts $volumeMount -}}
{{/* Use .Values.image.registry if it exists because of jetbrains extremely long registry */}}
{{- if .Values.image.registry -}}
{{- $_ := set .Values.image "repository" (printf "%s/%s" .Values.image.registry .Values.image.repository) -}}
{{- end -}}
{{/* Add the *_PROPERTIES environment variable */}}
{{- $ide := include "jetbrains-projector.ide" . }}
{{- $_ := set .Values.env (printf "%s_PROPERTIES" (upper $ide)) "/tmp/idea.properties" -}}
{{- if .Values.sslGen.enabled -}}
{{/* Add the tls cert and ssl.properties volumes */}}
{{- $certsVolume := include "jetbrains-projector.certs.volume" . | fromYaml -}}
{{- $sslPropsVolume := include "jetbrains-projector.secret.volume" . | fromYaml -}}
{{- $additionalVolumes = concat $additionalVolumes (list $certsVolume) (list $sslPropsVolume) -}}
{{/* Add the tls cert and ssl.properties volume mounts */}}
{{- $certsVolumeMount := include "jetbrains-projector.certs.volumeMount" . | fromYaml -}}
{{- $sslPropsVolumeMount := include "jetbrains-projector.secret.volumeMount" . | fromYaml -}}
{{- $additionalVolumeMounts = concat $additionalVolumeMounts (list $certsVolumeMount) (list $sslPropsVolumeMount) -}}
{{/* Add the ssl.properties env var */}}
{{- $_ := set .Values.env "ORG_JETBRAINS_PROJECTOR_SERVER_SSL_PROPERTIES_PATH" (printf "/tmp/%s" .Values.sslGen.properties.key) -}}
{{/* Add the cert file env vars */}}
{{- $_ := set .Values.env "TLS_CRT" .Values.sslGen.certs.crt -}}
{{- $_ := set .Values.env "TLS_KEY" .Values.sslGen.certs.key -}}
{{- end -}}
{{- $_ := set .Values "additionalVolumes" (deepCopy $additionalVolumes) -}}
{{- $_ := set .Values "additionalVolumeMounts" (deepCopy $additionalVolumeMounts) -}}
{{- if not .Values.image.repository -}}
{{- fail "an image is required in .Values.image.repository" -}}
{{- end -}}
{{/* Render the templates */}}
{{ include "common.all" . }}

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}-config
labels:
{{- include "common.labels" . | nindent 4 }}
data:
idea.properties: |
{{- include "print-or-recurse" (dict "key" "idea" "value" .Values.idea) | indent 4 }}

View File

@ -0,0 +1,14 @@
{{- if and .Values.sslGen.enabled (not .Values.sslGen.properties.existingSecret) -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "common.names.fullname" . }}-secrets
labels:
{{- include "common.labels" . | nindent 4 }}
stringData:
{{ .Values.sslGen.properties.key }}: |
STORE_TYPE=JKS
FILE_PATH={{ .Values.sslGen.jks.dest }}
STORE_PASSWORD=k8s@home
KEY_PASSWORD=k8s@home
{{- end -}}

View File

@ -0,0 +1,70 @@
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#
# See list of available images [here](ttps://github.com/orgs/k8s-at-home/packages?tab=packages&q=projector)
image:
# -- registry that hosts the image
registry: ghcr.io/k8s-at-home
# -- image repository. *MUST SPECIFY AN IMAGE*
repository: ""
# -- image pull policy
pullPolicy: IfNotPresent
# -- image tag
tag: v2021.1
strategy:
type: Recreate
# See more environment variables in the projector-docker documentation
# https://github.com/JetBrains/projector-docker
env: {}
# ORG_JETBRAINS_PROJECTOR_SERVER_HANDSHAKE_TOKEN: "admin-password"
# ORG_JETBRAINS_PROJECTOR_SERVER_RO_HANDSHAKE_TOKEN: "read-only-password"
# -- IDE settings overrides. See the prospective IDE docs (like pycharm)[https://www.jetbrains.com/help/pycharm/tuning-the-ide.html#common-platform-properties]
# for more info. Default config paths will be /config/* E.G. `idea.system.path=/config/system`
idea: {}
# config:
# path: "/config
# system:
# path: "/config/system"
# plugins:
# path: "/config/plugins"
# log:
# path: "/config/log"
sslGen:
# -- enable automatic conversion of mounted TLS certs to JKS for WSS protocol
enabled: false
certs:
# -- name of secret to mount that has the TLS certs
secret: ""
# -- key that holds the tls crt
crt: "tls.crt"
# -- key that holds the tls key
key: "tls.key"
jks:
# -- location of generated cert.jks used
dest: "/tmp/cert.jks"
properties:
# -- pre-existing ssl.properties secret
existingSecret: ""
# -- key that holds ssl.properties file
key: "ssl.properties"
service:
port:
port: 8887
ingress:
enabled: false
persistence:
config:
enabled: false
emptyDir:
enabled: false
mountPath: /config

View File

@ -100,7 +100,7 @@ helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -
{{- define "custom.support" -}}
## Support
- See the [Docs](https://docs.k8s-at-home.com/our-helm-charts/getting-started/)
- See the [Docs](https://docs.k8s-at-home.com/our-helm-charts/introduction/)
- Open an [issue](https://github.com/k8s-at-home/charts/issues/new/choose)
- Ask a [question](https://github.com/k8s-at-home/organization/discussions)
- Join our [Discord](https://discord.gg/sTMX7Vh) community