Skip to content

Commit

Permalink
Merge pull request #38 from KusionStack/support-custom-replicas-and-r…
Browse files Browse the repository at this point in the history
…esources-in-karpor-chart

feat: support custom replicas and resources in karpor chart
  • Loading branch information
elliotxx authored Jul 24, 2024
2 parents 4f52af1 + 00bb542 commit 62d1225
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 25 deletions.
2 changes: 1 addition & 1 deletion charts/karpor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v2
name: karpor
# The Chart Version
version: 0.5.1
version: 0.5.2
type: application
# The Application Version in the Chart
appVersion: 0.4.2
Expand Down
14 changes: 11 additions & 3 deletions charts/karpor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Karpor Chart

![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.2](https://img.shields.io/badge/AppVersion-0.4.2-informational?style=flat-square)
![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.2](https://img.shields.io/badge/AppVersion-0.4.2-informational?style=flat-square)

A Helm chart for Karpor, a modern kubernetes visualization tool.

Expand Down Expand Up @@ -65,8 +65,10 @@ The Karpor Server Component is main backend server. It itself is an `apiserver`,
|-----|------|---------|-------------|
| server.image.repo | string | `"kusionstack/karpor"` | Repository for Karpor server image. |
| server.image.tag | string | `""` | Tag for Karpor server image. Defaults to the chart's appVersion if not specified. |
| server.name | string | `"karpor-server"` | Component name for Karpor server. |
| server.port | int | `7443` | Port for Karpor server. |
| server.name | string | `"karpor-server"` | Component name for karpor server. |
| server.port | int | `7443` | Port for karpor server. |
| server.replicas | int | `1` | The number of karpor server pods to run. |
| server.resources | object | `{"limits":{"cpu":"500m","ephemeral-storage":"10Gi","memory":"1Gi"},"requests":{"cpu":"250m","ephemeral-storage":"2Gi","memory":"256Mi"}}` | Resource limits and requests for the karpor server pods. |

### Karpor Syncer

Expand All @@ -78,6 +80,8 @@ The Karpor Syncer Component is independent server to synchronize cluster resourc
| syncer.image.tag | string | `""` | Tag for Karpor syncer image. Defaults to the chart's appVersion if not specified. |
| syncer.name | string | `"karpor-syncer"` | Component name for Karpor syncer. |
| syncer.port | int | `7443` | Port for Karpor syncer. |
| syncer.replicas | int | `1` | The number of karpor syncer pods to run. |
| syncer.resources | object | `{"limits":{"cpu":"500m","ephemeral-storage":"10Gi","memory":"1Gi"},"requests":{"cpu":"250m","ephemeral-storage":"2Gi","memory":"256Mi"}}` | Resource limits and requests for the karpor syncer pods. |

### ElasticSearch

Expand All @@ -89,6 +93,8 @@ The ElasticSearch Component to store the synchronized resources and user data.
| elasticsearch.image.tag | string | `"8.6.2"` | Specific tag for ElasticSearch image. |
| elasticsearch.name | string | `"elasticsearch"` | Component name for ElasticSearch. |
| elasticsearch.port | int | `9200` | Port for ElasticSearch. |
| elasticsearch.replicas | int | `1` | The number of ElasticSearch pods to run. |
| elasticsearch.resources | object | `{"limits":{"cpu":"2","ephemeral-storage":"10Gi","memory":"4Gi"},"requests":{"cpu":"2","ephemeral-storage":"10Gi","memory":"4Gi"}}` | Resource limits and requests for the karpor elasticsearch pods. |

### ETCD

Expand All @@ -100,6 +106,8 @@ The ETCD Component is the storage of Karpor Server as `apiserver`.
| etcd.image.tag | string | `"v3.5.11"` | Specific tag for ETCD image. |
| etcd.name | string | `"etcd"` | Component name for ETCD. |
| etcd.port | int | `2379` | Port for ETCD. |
| etcd.replicas | int | `1` | The number of etcd pods to run. |
| etcd.resources | object | `{"limits":{"cpu":"500m","ephemeral-storage":"10Gi","memory":"1Gi"},"requests":{"cpu":"250m","ephemeral-storage":"2Gi","memory":"256Mi"}}` | Resource limits and requests for the karpor etcd pods. |

### Job

Expand Down
11 changes: 2 additions & 9 deletions charts/karpor/templates/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: elasticsearch
namespace: {{ .Values.namespace }}
spec:
replicas: 1
replicas: {{ .Values.elasticsearch.replicas }}
selector:
matchLabels:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.elasticsearch.name) | nindent 6 }}
Expand Down Expand Up @@ -49,14 +49,7 @@ spec:
- containerPort: {{ .Values.elasticsearch.port }}
protocol: TCP
resources:
limits:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
requests:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
{{- toYaml .Values.elasticsearch.resources | nindent 12 }}
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: data
Expand Down
4 changes: 3 additions & 1 deletion charts/karpor/templates/etcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
{{- include "karpor.labels" (dict "context" . "component" .Values.etcd.name) | nindent 4 }}
spec:
serviceName: etcd
replicas: 1
replicas: {{ .Values.etcd.replicas }}
selector:
matchLabels:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.etcd.name) | nindent 6 }}
Expand All @@ -43,6 +43,8 @@ spec:
volumeMounts:
- name: data
mountPath: /etcd-data
resources:
{{- toYaml .Values.etcd.resources | nindent 12 }}
volumeClaimTemplates:
- metadata:
name: data
Expand Down
4 changes: 3 additions & 1 deletion charts/karpor/templates/karpor-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: karpor-server
namespace: {{ .Values.namespace }}
spec:
replicas: 1
replicas: {{ .Values.server.replicas }}
selector:
matchLabels:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.server.name) | nindent 6 }}
Expand All @@ -43,6 +43,8 @@ spec:
volumeMounts:
- mountPath: /etc/karpor/
name: karpor-secret
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
volumes:
- name: karpor-secret
secret:
Expand Down
4 changes: 3 additions & 1 deletion charts/karpor/templates/karpor-syncer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: karpor-syncer
namespace: {{ .Values.namespace }}
spec:
replicas: 1
replicas: {{ .Values.syncer.replicas }}
selector:
matchLabels:
{{- include "karpor.selectorLabels" (dict "context" . "component" .Values.syncer.name) | nindent 6 }}
Expand All @@ -32,6 +32,8 @@ spec:
volumeMounts:
- mountPath: /etc/karpor/
name: karpor-kubeconfig
resources:
{{- toYaml .Values.syncer.resources | nindent 12 }}
volumes:
- name: karpor-kubeconfig
configMap:
Expand Down
67 changes: 58 additions & 9 deletions charts/karpor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,100 @@ global:

# Configuration for Karpor server
server:
# -- Component name for Karpor server.
# -- Component name for karpor server.
name: karpor-server
# -- The number of karpor server pods to run.
replicas: 1
# -- Port for karpor server.
port: 7443
image:
# -- Repository for Karpor server image.
repo: kusionstack/karpor
# -- Tag for Karpor server image. Defaults to the chart's appVersion if not specified.
tag: ""
# -- Port for Karpor server.
port: 7443
# -- Resource limits and requests for the karpor server pods.
resources:
requests:
cpu: 250m
memory: 256Mi
ephemeral-storage: 2Gi
limits:
cpu: 500m
memory: 1Gi
ephemeral-storage: 10Gi


# Configuration for Karpor syncer
syncer:
# -- Component name for Karpor syncer.
name: karpor-syncer
# -- The number of karpor syncer pods to run.
replicas: 1
# -- Port for Karpor syncer.
port: 7443
image:
# -- Repository for Karpor syncer image.
repo: kusionstack/karpor
# -- Tag for Karpor syncer image. Defaults to the chart's appVersion if not specified.
tag: ""
# -- Port for Karpor syncer.
port: 7443
# -- Resource limits and requests for the karpor syncer pods.
resources:
requests:
cpu: 250m
memory: 256Mi
ephemeral-storage: 2Gi
limits:
cpu: 500m
memory: 1Gi
ephemeral-storage: 10Gi

# Configuration for ElasticSearch
elasticsearch:
# -- Component name for ElasticSearch.
name: elasticsearch
# -- The number of ElasticSearch pods to run.
replicas: 1
# -- Port for ElasticSearch.
port: 9200
image:
# -- Repository for ElasticSearch image.
repo: docker.elastic.co/elasticsearch/elasticsearch
# -- Specific tag for ElasticSearch image.
tag: "8.6.2"
# -- Port for ElasticSearch.
port: 9200
# -- Resource limits and requests for the karpor elasticsearch pods.
resources:
requests:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
limits:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi

# Configuration for ETCD
etcd:
# -- Component name for ETCD.
name: etcd
# -- The number of etcd pods to run.
replicas: 1
# -- Port for ETCD.
port: 2379
image:
# -- Repository for ETCD image.
repo: quay.io/coreos/etcd
# -- Specific tag for ETCD image.
tag: "v3.5.11"
# -- Port for ETCD.
port: 2379
# -- Resource limits and requests for the karpor etcd pods.
resources:
requests:
cpu: 250m
memory: 256Mi
ephemeral-storage: 2Gi
limits:
cpu: 500m
memory: 1Gi
ephemeral-storage: 10Gi

# Configuration for Jobs
job:
Expand Down

0 comments on commit 62d1225

Please sign in to comment.