diff --git a/charts/karpor b/charts/karpor new file mode 120000 index 0000000..d9ebcf6 --- /dev/null +++ b/charts/karpor @@ -0,0 +1 @@ +../versions/karpor/0.3.14-alpha.5 \ No newline at end of file diff --git a/versions/karpor/0.3.14-alpha.5/.helmignore b/versions/karpor/0.3.14-alpha.5/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/.helmignore @@ -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/ diff --git a/versions/karpor/0.3.14-alpha.5/Chart.yaml b/versions/karpor/0.3.14-alpha.5/Chart.yaml new file mode 100644 index 0000000..72006c5 --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/Chart.yaml @@ -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 diff --git a/versions/karpor/0.3.14-alpha.5/templates/elasticsearch.yml b/versions/karpor/0.3.14-alpha.5/templates/elasticsearch.yml new file mode 100644 index 0000000..e1ecd0c --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/templates/elasticsearch.yml @@ -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 diff --git a/versions/karpor/0.3.14-alpha.5/templates/etcd.yml b/versions/karpor/0.3.14-alpha.5/templates/etcd.yml new file mode 100644 index 0000000..d5c325d --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/templates/etcd.yml @@ -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 diff --git a/versions/karpor/0.3.14-alpha.5/templates/job.yml b/versions/karpor/0.3.14-alpha.5/templates/job.yml new file mode 100644 index 0000000..c1d31a3 --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/templates/job.yml @@ -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 diff --git a/versions/karpor/0.3.14-alpha.5/templates/karpor-server.yml b/versions/karpor/0.3.14-alpha.5/templates/karpor-server.yml new file mode 100644 index 0000000..d7ca0de --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/templates/karpor-server.yml @@ -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 diff --git a/versions/karpor/0.3.14-alpha.5/templates/karpor-sync.yml b/versions/karpor/0.3.14-alpha.5/templates/karpor-sync.yml new file mode 100644 index 0000000..8e5c269 --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/templates/karpor-sync.yml @@ -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 diff --git a/versions/karpor/0.3.14-alpha.5/templates/namespace.yml b/versions/karpor/0.3.14-alpha.5/templates/namespace.yml new file mode 100644 index 0000000..749f665 --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/templates/namespace.yml @@ -0,0 +1,6 @@ +{{- if .Values.namespaceEnabled -}} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.namespace }} +{{- end }} diff --git a/versions/karpor/0.3.14-alpha.5/values.yaml b/versions/karpor/0.3.14-alpha.5/values.yaml new file mode 100644 index 0000000..d644946 --- /dev/null +++ b/versions/karpor/0.3.14-alpha.5/values.yaml @@ -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