Skip to content

Commit

Permalink
feat: modified environment variables for monitor service (#36)
Browse files Browse the repository at this point in the history
* feat: added monitor container in plane-enterprise
* chore: bumped version of plane ee helm

---------

Co-authored-by: Manish Gupta <[email protected]>
Co-authored-by: Akshat Jain <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent 1cacda9 commit e4b5f79
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 48 deletions.
2 changes: 0 additions & 2 deletions charts/plane-ce/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Plane CE Helm Chart

## Pre-requisite

- A working Kubernetes cluster
Expand Down
59 changes: 28 additions & 31 deletions charts/plane-enterprise/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
# Plane One Helm Chart

## Pre-requisite

- A Plane One license
> If you don’t have a license, get it at [prime.plane.so](https://prime.plane.so)
- A working Kubernetes cluster
- `kubectl` and `helm` on the client system that you will use to install our Helm charts

## Installing Plane One
## Installing Plane Enterprise

1. Open Terminal or any other command-line app that has access to Kubernetes tools on your local system.
2. Set the following environment variables.

Copy the format of constants below, paste it on Terminal to start setting environment variables, set values for each variable, and hit ENTER or RETURN.
> You will get the values for the variables from [prime.plane.so](https://prime.plane.so) under the Kuberntes tab of your license's details page. When installing Plane One for the first time, remember to specify a domain name.

```bash
LICENSE_KEY=<your_license_key>
REG_USER_ID=<license-XXXXX+XXXX-XXXX-XXX-XXXXX>
REG_PASSWORD=<******>
PLANE_VERSION=<v1.xx.x>
DOMAIN_NAME=<subdomain.domain.tld or domain.tld>
```
Expand All @@ -40,24 +32,22 @@
Continue to be on the same Terminal window as you have so far, copy the code below, and paste it on your Terminal screen.

```bash
helm install one-app plane/plane-enterprise \
helm install plane-app plane/plane-enterprise \
--create-namespace \
--namespace plane-one \
--set dockerRegistry.loginid=${REG_USER_ID} \
--set dockerRegistry.password=${REG_PASSWORD} \
--set license.licenseKey=${LICENSE_KEY} \
--namespace plane \
--set license.licenseDomain=${DOMAIN_NAME} \
--set license.licenseServer=https://prime.plane.so \
--set planeVersion=${PLANE_VERSION} \
--set ingress.enabled=true \
--set ingress.ingressClass=nginx \
--set env.storageClass=longhorn \
--timeout 10m \
--wait \
--wait-for-jobs
```

> This is the minimum required to set up Plane One. You can change the default namespace from `plane-one`, the default appname
from `one-app`, the default storage class from `env.storageClass`, and the default ingress class from `ingress.ingressClass` to
> This is the minimum required to set up Plane Enterprise. You can change the default namespace from `plane`, the default appname
from `plane-app`, the default storage class from `longhorn`, and the default ingress class from `nginx` to
whatever you would like to.<br> <br>
You can also pass other settings referring to `Configuration Settings` section.

Expand All @@ -72,11 +62,9 @@

Make sure you set the minimum required values as below.
- `planeVersion: <v1.xx.x>`
- `dockerRegistry.loginid: <REG_USER_ID as on prime.plane.so>`
- `dockerRegistry.password: <REG_PASSWORD as on prime.plane.so>`
- `license.licenseKey: <LICENSE_KEY as on prime.plane.so>`
- `license.licenseDomain: <The domain you have specified to host Plane>`
- `license.licenseServer: https://prime.plane.so`
- `ingress.enabled: <true | false>`
- `ingress.ingressClass: <nginx or any other ingress class configured in your cluster>`
- `env.storageClass: <longhorn or any other storage class configured in your cluster>`

Expand All @@ -85,9 +73,9 @@
After saving the `values.yaml` file, continue to be on the same Terminal window as on the previous steps, copy the code below, and paste it on your Terminal screen.

```bash
helm install one-app plane/plane-enterprise \
helm install plane-app plane/plane-enterprise \
--create-namespace \
--namespace plane-one \
--namespace plane \
-f values.yaml \
--timeout 10m \
--wait \
Expand All @@ -100,7 +88,7 @@

| Setting | Default | Required | Description |
|---|:---:|:---:|---|
| dockerRegistry.enabled | true | Yes | Plane uses a private Docker registry which needs authenticated login. This must be set to `true` to install Plane One. |
| dockerRegistry.enabled | false | | Plane uses a private Docker registry which needs authenticated login. This must be set to `true` to install Plane Enterprise. |
| dockerRegistry.registry | registry.plane.tools| Yes | The host that will serve the required Docker images; Don't change this. |
| dockerRegistry.loginid | | Yes | Sets the `loginid` for the Docker registry. This is the same as the REG_USER_ID value on prime. plane.so |
| dockerRegistry.password | | Yes | Sets the `password` for the Docker registry. This is the same as the REG_PASSWORD value on prime.plane.so|
Expand All @@ -109,9 +97,8 @@
| Setting | Default | Required | Description |
|---|:---:|:---:|---|
| planeVersion | v1.1.1 | Yes | Specifies the version of Plane to be deployed. Copy this from prime.plane.so. |
| planeVersion | v1.2.1 | Yes | Specifies the version of Plane to be deployed. Copy this from prime.plane.so. |
| license.licenseServer | <https://prime.plane.so> | Yes | Sets the value of the `licenseServer` that gets you your license and validates it periodically. Don't change this. |
| license.licenseKey | | Yes | Holds your license key to Plane One. Copy this from prime.plane.so. |
| license.licenseDomain | 'plane.example.com' | Yes | The fully-qualified domain name (FQDN) in the format `sudomain.domain.tld` or `domain.tld` that the license is bound to. It is also attached to your `ingress` host to access Plane. |

### Postgres
Expand Down Expand Up @@ -187,6 +174,16 @@
| services.admin.image| registry.plane.tools/plane/admin-enterprise | | This deployment needs a preconfigured docker image to function. Docker image name is provided by the owner and must not be changed for this deployment |
| services.admin.assign_cluster_ip | false | | Set it to `true` if you want to assign `ClusterIP` to the service |

### Monitor Deployment

| Setting | Default | Required | Description |
|---|:---:|:---:|---|
| services.monitor.memoryLimit | 1000Mi | | Every deployment in kubernetes can be set to use maximum memory they are allowed to use. This key sets the memory limit for this deployment to use.|
| services.monitor.cpuLimit | 500m | | Every deployment in kubernetes can be set to use maximum cpu they are allowed to use. This key sets the cpu limit for this deployment to use.|
| services.monitor.image| registry.plane.tools/plane/monitor-enterprise | | This deployment needs a preconfigured docker image to function. Docker image name is provided by the owner and must not be changed for this deployment |
| services.monitor.volumeSize | 100Mi | | While setting up the stateful deployment, while creating the persistant volume, volume allocation size need to be provided. This key helps you set the volume allocation size. Unit of this value must be in Mi (megabyte) or Gi (gigabyte) |
| services.monitor.assign_cluster_ip | false | | Set it to `true` if you want to assign `ClusterIP` to the service |

### API Deployment

| Setting | Default | Required | Description |
Expand Down Expand Up @@ -243,10 +240,10 @@ If you are planning to use 3rd party ingress providers, here is the available ro
| Host | Path | Service |
|--- |:---:|---|
| plane.example.com | / | <http://plane-web.plane-one:3000> |
| plane.example.com | /spaces/* | <http://plane-space.plane-one:3000> |
| plane.example.com | /god-mode/* | <http://plane-admin.plane-one:3000> |
| plane.example.com | /api/* | <http://plane-api.plane-one:8000> |
| plane.example.com | /auth/* | <http://plane-api.plane-one:8000> |
| plane.example.com | /uploads/* | <http://plane-minio.plane-one:9000> |
| plane-minio.example.com | / | <http://plane-minio.plane-one:9090> |
| plane.example.com | / | <http://plane-app-web.plane:3000> |
| plane.example.com | /spaces/* | <http://plane-app-space.plane:3000> |
| plane.example.com | /god-mode/* | <http://plane-app-admin.plane:3000> |
| plane.example.com | /api/* | <http://plane-app-api.plane:8000> |
| plane.example.com | /auth/* | <http://plane-app-api.plane:8000> |
| plane.example.com | /uploads/* | <http://plane-app-minio.plane:9000> |
| plane-minio.example.com | / | <http://plane-app-minio.plane:9090> |
31 changes: 26 additions & 5 deletions charts/plane-enterprise/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ questions:
- variable: dockerRegistry.enabled
label: Docker Registry Enabled
type: boolean
default: true
default: false
group: "Docker Registry"
show_subquestion_if: true
subquestions:
Expand All @@ -20,7 +20,7 @@ questions:
- variable: planeVersion
label: Plane Version (Docker Image Tag)
type: string
default: latest
default: v1.2.0
required: true
group: "Docker Registry"
subquestions:
Expand All @@ -39,6 +39,11 @@ questions:
type: string
required: true
default: "registry.plane.tools/plane/admin-enterprise"
- variable: services.monitor.image
label: Monitor Docker Image
type: string
required: true
default: "registry.plane.tools/plane/monitor-enterprise"
- variable: services.api.image
label: Backend Docker Image
type: string
Expand All @@ -56,9 +61,6 @@ questions:
required: true
group: "License Setup"
subquestions:
- variable: license.licenseKey
label: "License Key"
type: string
- variable: license.licenseDomain
label: "License Domain"
type: string
Expand Down Expand Up @@ -121,6 +123,25 @@ questions:
type: boolean
default: false

- variable: services.monitor.memoryLimit
label: "Memory Limit"
type: string
default: 1000Mi
group: "Monitor Setup"
subquestions:
- variable: services.monitor.cpuLimit
label: "CPU Limit"
type: string
default: 500m
- variable: services.monitor.volumeSize
label: "Volume Size"
type: string
default: "100Mi"
- variable: services.monitor.assign_cluster_ip
label: "Assign Cluster IP"
type: boolean
default: false

- variable: services.api.replicas
label: "Default Replica Count"
type: int
Expand Down
4 changes: 2 additions & 2 deletions charts/plane-enterprise/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
{{- end }}

{{- define "hashString" -}}
{{- printf "%s%s%s%s%s" .Values.license.licenseServer .Values.license.licenseDomain .Values.license.licenseKey .Release.Namespace .Release.Name | sha256sum -}}
{{- end -}}
{{- printf "%s%s%s%s" .Values.license.licenseServer .Values.license.licenseDomain .Release.Namespace .Release.Name | sha256sum -}}
{{- end -}}
8 changes: 4 additions & 4 deletions charts/plane-enterprise/templates/config-secrets/app-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ metadata:
name: {{ .Release.Name }}-app-vars
data:
PRIME_HOST: {{ .Values.license.licenseServer | quote }}
LICENSE_KEY: {{ .Values.license.licenseKey | quote }}
MACHINE_SIGNATURE: {{ include "hashString" . | quote }}
LICENSE_DOMAIN: {{ .Values.license.licenseDomain | quote }}
LICENSE_VERSION: {{ .Values.planeVersion | quote }}
DEPLOY_PLATFORM: "KUBERNETES"
APP_DOMAIN: {{ .Values.license.licenseDomain | quote }}
APP_VERSION: {{ .Values.planeVersion | quote }}
PAYMENT_SERVER_BASE_URL: "http://{{ .Release.Name }}-monitor.{{ .Release.Namespace }}.svc.cluster.local/"
FEATURE_FLAG_SERVER_BASE_URL: "http://{{ .Release.Name }}-monitor.{{ .Release.Namespace }}.svc.cluster.local/"

SENTRY_DSN: {{ .Values.env.sentry_dsn | default "" | quote}}
SENTRY_ENVIRONMENT: {{ .Values.env.sentry_environment | default "" | quote}}
Expand Down
12 changes: 12 additions & 0 deletions charts/plane-enterprise/templates/config-secrets/monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-monitor-vars
data:
PRIME_HOST: {{ .Values.license.licenseServer | quote }}
MACHINE_SIGNATURE: {{ include "hashString" . | quote }}
APP_DOMAIN: {{ .Values.license.licenseDomain | quote }}
APP_VERSION: {{ .Values.planeVersion | quote }}
DEPLOY_PLATFORM: "KUBERNETES"
API_URL: "http://{{ .Release.Name }}-api.{{ .Release.Namespace }}.svc.cluster.local:8000/"
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ spec:

serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account

---
---
74 changes: 74 additions & 0 deletions charts/plane-enterprise/templates/workloads/monitor.stateful.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-monitor
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-monitor
spec:
{{- if not .Values.services.monitor.assign_cluster_ip }}
clusterIP: None
{{- end }}
ports:
- name: monitor-80
port: 80
protocol: TCP
targetPort: 80
selector:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-monitor
---

apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-monitor-wl
spec:
selector:
matchLabels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-monitor
serviceName: {{ .Release.Name }}-monitor
template:
metadata:
labels:
app.name: {{ .Release.Namespace }}-{{ .Release.Name }}-monitor
spec:
containers:
- image: {{ .Values.services.monitor.image | default "registry.plane.tools/plane/monitor-enterprise" }}:{{ .Values.planeVersion }}
imagePullPolicy: Always
name: {{ .Release.Name }}-monitor
stdin: true
tty: true
resources:
requests:
memory: "50Mi"
cpu: "50m"
limits:
memory: {{ .Values.services.monitor.memoryLimit | default "1000Mi" | quote }}
cpu: {{ .Values.services.monitor.cpuLimit | default "500m" | quote}}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-monitor-vars
optional: false
volumeMounts:
- mountPath: /app
name: pvc-{{ .Release.Name }}-monitor-vol
subPath: ''
serviceAccount: {{ .Release.Name }}-srv-account
serviceAccountName: {{ .Release.Name }}-srv-account
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
namespace: {{ .Release.Namespace }}
name: pvc-{{ .Release.Name }}-monitor-vol
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.services.monitor.volumeSize | default "100Mi" | quote }}
storageClassName: {{ .Values.env.storageClass | quote }}
volumeMode: Filesystem

10 changes: 8 additions & 2 deletions charts/plane-enterprise/values.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
planeVersion: v1.2.1

dockerRegistry:
enabled: true
enabled: false
registry: registry.plane.tools
loginid: ''
password: ''

license:
licenseServer: https://prime.plane.so
licenseKey: ''
licenseDomain: 'plane.example.com'

ingress:
Expand Down Expand Up @@ -71,6 +70,13 @@ services:
image: registry.plane.tools/plane/web-enterprise
assign_cluster_ip: false

monitor:
memoryLimit: 1000Mi
cpuLimit: 500m
image: registry.plane.tools/plane/monitor-enterprise
volumeSize: 100Mi
assign_cluster_ip: false

space:
replicas: 1
memoryLimit: 1000Mi
Expand Down

0 comments on commit e4b5f79

Please sign in to comment.