Skip to content

Commit

Permalink
Merge pull request #14 from KusionStack/add-karpor
Browse files Browse the repository at this point in the history
  • Loading branch information
Eikykun committed Apr 30, 2024
1 parent 4ca4b24 commit 8be6ef3
Show file tree
Hide file tree
Showing 10 changed files with 305 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/karpor
23 changes: 23 additions & 0 deletions versions/karpor/0.3.14-alpha.5/.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/
24 changes: 24 additions & 0 deletions versions/karpor/0.3.14-alpha.5/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: karpor
description: A Helm chart for Karpor

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.14-alpha.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 0.3.14-alpha.5
65 changes: 65 additions & 0 deletions versions/karpor/0.3.14-alpha.5/templates/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
namespace: {{ .Values.namespace }}
spec:
ports:
- port: 9200
selector:
app: elasticsearch
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: elasticsearch
name: elasticsearch
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- env:
- name: discovery.type
value: single-node
- name: xpack.security.enabled
value: "false"
- name: xpack.security.http.ssl.enabled
value: "false"
- name: xpack.security.transport.ssl.enabled
value: "false"
- name: KIBANA_PASSWORD
value: dangerous0
- name: ELASTIC_PASSWORD
value: elastic
- name: ES_JAVA_OPTS
value: -Xms1g -Xmx1g
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
imagePullPolicy: IfNotPresent
name: elasticsearch
ports:
- containerPort: 9200
protocol: TCP
resources:
limits:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
requests:
cpu: "2"
memory: 4Gi
ephemeral-storage: 10Gi
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: data
volumes:
- emptyDir: { }
name: data
50 changes: 50 additions & 0 deletions versions/karpor/0.3.14-alpha.5/templates/etcd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: v1
kind: Service
metadata:
name: etcd
namespace: {{ .Values.namespace }}
spec:
ports:
- port: 2379
selector:
app: etcd
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: etcd
namespace: {{ .Values.namespace }}
spec:
serviceName: etcd
replicas: 1
selector:
matchLabels:
app: etcd
template:
metadata:
labels:
app: etcd
spec:
containers:
- name: etcd
image: quay.io/coreos/etcd:v3.5.11
command:
- /usr/local/bin/etcd
- --listen-client-urls=http://0.0.0.0:2379
- --advertise-client-urls=http://localhost:2379
env:
- name: ETCD_DATA_DIR
value: /etcd-data/default.etcd
ports:
- containerPort: 2379
volumeMounts:
- name: data
mountPath: /etcd-data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
42 changes: 42 additions & 0 deletions versions/karpor/0.3.14-alpha.5/templates/job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: batch/v1
kind: Job
metadata:
name: karpor-generate-cert
namespace: {{ .Values.namespace }}
spec:
ttlSecondsAfterFinished: 300
template:
spec:
containers:
- name: karpor-generate-cert
image: golang:1.19
command:
- /bin/sh
- -c
args:
- go install github.com/KusionStack/kube-utils/tools/cert-generator@latest && cert-generator --ca-name=karpor-secret --kubeconfig-name=karpor-kubeconfig
restartPolicy: OnFailure
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: {{ .Values.namespace }}
name: karpor-generate-cert
rules:
- apiGroups: [""]
resources: ["secrets", "configmaps"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: karpor-generate-cert
namespace: {{ .Values.namespace }}
subjects:
- kind: ServiceAccount
name: default
namespace: {{ .Values.namespace }}
roleRef:
kind: Role
name: karpor-generate-cert
apiGroup: rbac.authorization.k8s.io
49 changes: 49 additions & 0 deletions versions/karpor/0.3.14-alpha.5/templates/karpor-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: v1
kind: Service
metadata:
name: karpor-server
namespace: {{ .Values.namespace }}
spec:
ports:
- port: {{ .Values.port }}
selector:
app: karpor-server
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: karpor-server
name: karpor-server
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: karpor-server
template:
metadata:
labels:
app: karpor-server
spec:
containers:
- args:
- --search-storage-type=elasticsearch
- --elastic-search-addresses=http://elasticsearch.karpor.svc:9200
- --etcd-servers=http://etcd.karpor.svc:2379
- --secure-port={{ .Values.port }}
- --client-ca-file=/etc/karpor/ca.crt
command:
- /karpor
image: kusionstack/karpor:{{ .Values.tag }}
name: karpor-server
ports:
- containerPort: {{ .Values.port }}
volumeMounts:
- mountPath: /etc/karpor/
name: karpor-secret
volumes:
- name: karpor-secret
secret:
defaultMode: 420
secretName: karpor-secret
37 changes: 37 additions & 0 deletions versions/karpor/0.3.14-alpha.5/templates/karpor-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: karpor-syncer
name: karpor-syncer
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: karpor-syncer
template:
metadata:
labels:
app: karpor-syncer
spec:
containers:
- command:
- /karpor
args:
- syncer
- --elastic-search-addresses=http://elasticsearch.karpor.svc:9200
env:
- name: KUBECONFIG
value: /etc/karpor/config
image: kusionstack/karpor:{{ .Values.tag }}
name: karpor-server
ports:
- containerPort: {{ .Values.port }}
volumeMounts:
- mountPath: /etc/karpor/
name: karpor-kubeconfig
volumes:
- name: karpor-kubeconfig
configMap:
name: karpor-kubeconfig
6 changes: 6 additions & 0 deletions versions/karpor/0.3.14-alpha.5/templates/namespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{- if .Values.namespaceEnabled -}}
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace }}
{{- end }}
8 changes: 8 additions & 0 deletions versions/karpor/0.3.14-alpha.5/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Default values for karpor.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

namespace: karpor
namespaceEnabled: true
port: 7443
tag: 0.3.14-alpha.5

0 comments on commit 8be6ef3

Please sign in to comment.