Skip to content

Commit d5490d5

Browse files
committed
Create helm chart
1 parent 363c3dc commit d5490d5

File tree

11 files changed

+448
-0
lines changed

11 files changed

+448
-0
lines changed

build/charts/codepair/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

build/charts/codepair/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: yorkie-mongodb
3+
repository: https://yorkie-team.github.io/yorkie/helm-charts
4+
version: 0.4.13
5+
digest: sha256:cc8f0136f05468ef7ad3b79470f59c47b0a2b82ee7826881c5b688f072b1033d
6+
generated: "2025-05-05T15:58:01.457671+09:00"

build/charts/codepair/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: codepair
3+
description: A Helm chart for CodePair, a collaborative coding platform built with Yorkie
4+
type: application
5+
icon: https://raw.githubusercontent.com/yorkie-team/yorkie-team.github.io/main/public/favicon-512x512.png
6+
maintainers:
7+
- name: krapie
8+
9+
10+
version: 0.1.0
11+
appVersion: "0.1.32"
12+
kubeVersion: ">=1.23.0-0"
13+
14+
dependencies:
15+
- name: yorkie-mongodb
16+
version: 0.4.13
17+
repository: https://yorkie-team.github.io/yorkie/helm-charts
18+
condition: yorkie-mongodb.enabled
19+
20+
keywords:
21+
- codepair
22+
- yorkie
23+
- collaboration
24+
- kubernetes

build/charts/codepair/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# CodePair Helm Chart
2+
3+
Installs the CodePair application, a collaborative coding platform powered by Yorkie.
4+
5+
## Prerequisites
6+
7+
- Kubernetes 1.23+
8+
- Helm 3+
9+
10+
## Get Helm Repository Info
11+
12+
```bash
13+
# TODO(krapie): need to centralize the helm repo
14+
helm repo add yorkie-team https://yorkie-team.github.io/yorkie/helm-charts
15+
helm repo update
16+
```
17+
18+
_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._
19+
20+
## Install Helm Chart
21+
22+
```bash
23+
# Create mongodb namespace if not already created
24+
kubectl create namespace mongodb
25+
26+
# Install codepair helm chart with default values
27+
helm install codepair yorkie-team/codepair -n codepair --create-namespace
28+
```
29+
30+
_See [configuration](#configuration) below for custom installation_
31+
32+
_See [`helm install`](https://helm.sh/docs/helm/helm_install/) for command documentation._
33+
34+
## Dependencies
35+
36+
By default, this chart installs the following dependency:
37+
38+
- [yorkie-mongodb](https://github.com/yorkie-team/yorkie/tree/main/charts/yorkie-mongodb)
39+
40+
## Uninstall Helm Chart
41+
42+
```bash
43+
helm uninstall codepair
44+
```
45+
46+
This removes all the Kubernetes components associated with the chart and deletes the release.
47+
48+
_See [`helm uninstall`](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
49+
50+
## Upgrading Chart
51+
52+
```bash
53+
helm upgrade codepair yorkie-team/codepair
54+
```
55+
56+
_See [`helm upgrade`](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
57+
58+
## Configuration
59+
60+
See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments:
61+
62+
```console
63+
helm show values yorkie-team/codepair
64+
```
65+
66+
### Key Parameters
67+
68+
The following table lists the configurable parameters of the CodePair chart and their default values:
69+
70+
| Parameter | Description | Default |
71+
| --------- | ----------- | ------- |
72+
| `codepair.image.repository` | CodePair image repository | `yorkieteam/codepair` |
73+
| `codepair.image.tag` | CodePair image tag | `0.1.32` |
74+
| `codepair.autoscaling.replicaCount` | Number of CodePair replicas | `1` |
75+
| `codepair.env.databaseUrl` | MongoDB connection URI | `mongodb://mongodb.mongodb.svc.cluster.local:27017/codepair` |
76+
| `codepair.env.githubClientId` | GitHub OAuth Client ID | `""` |
77+
| `codepair.env.githubClientSecret` | GitHub OAuth Client Secret | `""` |
78+
| `codepair.env.frontendBaseUrl` | Frontend application URL | `""` |
79+
| `codepair.env.yorkieApiAddr` | Yorkie API address | `""` |
80+
| `ingress.enabled` | Enable ingress | `true` |
81+
| `ingress.className` | Ingress class name | `alb` |
82+
| `ingress.hosts.apiHost` | Host name for API | `codepair-api.yorkie.dev` |
83+
| `yorkie-mongodb.enabled` | Enable MongoDB dependency | `true` |
84+
85+
You may also configure the MongoDB dependency. See the [yorkie-mongodb chart](https://github.com/yorkie-team/yorkie/tree/main/charts/yorkie-mongodb) for additional options.
55.7 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- Install Complete ---
2+
{{ .Release.Name }} successfully installed!
3+
4+
CodePair application has been deployed to the {{ .Values.codepair.namespace }} namespace.
5+
6+
{{- if .Values.ingress.enabled }}
7+
{{- if .Values.ingress.hosts.enabled }}
8+
Your application is available at: https://{{ .Values.ingress.hosts.apiHost }}
9+
{{- end }}
10+
{{- else }}
11+
To expose your service, you need to set up an Ingress or use port-forwarding:
12+
13+
kubectl port-forward service/{{ .Values.codepair.name }} -n {{ .Values.codepair.namespace }} {{ .Values.codepair.ports.serverPort }}:{{ .Values.codepair.ports.serverPort }}
14+
15+
Then access the application at: http://localhost:{{ .Values.codepair.ports.serverPort }}
16+
{{- end }}
17+
18+
To learn more about the release, try:
19+
$ helm status {{ .Release.Name }}
20+
$ helm get all {{ .Release.Name }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "codepair.name" -}}
5+
{{- default .Chart.Name .Values.codepair.name | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
*/}}
12+
{{- define "codepair.fullname" -}}
13+
{{- if .Values.codepair.name }}
14+
{{- .Values.codepair.name | trunc 63 | trimSuffix "-" }}
15+
{{- else }}
16+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
17+
{{- end }}
18+
{{- end }}
19+
20+
{{/*
21+
Create chart name and version as used by the chart label.
22+
*/}}
23+
{{- define "codepair.chart" -}}
24+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
25+
{{- end }}
26+
27+
{{/*
28+
Common labels
29+
*/}}
30+
{{- define "codepair.labels" -}}
31+
helm.sh/chart: {{ include "codepair.chart" . }}
32+
{{ include "codepair.selectorLabels" . }}
33+
{{- if .Chart.AppVersion }}
34+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
35+
{{- end }}
36+
app.kubernetes.io/managed-by: {{ .Release.Service }}
37+
{{- end }}
38+
39+
{{/*
40+
Selector labels
41+
*/}}
42+
{{- define "codepair.selectorLabels" -}}
43+
app.kubernetes.io/name: {{ include "codepair.name" . }}
44+
app.kubernetes.io/instance: {{ .Release.Name }}
45+
{{- end }}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Values.codepair.name }}
5+
namespace: {{ .Values.codepair.namespace }}
6+
labels:
7+
app: {{ .Values.codepair.name }}
8+
app.kubernetes.io/name: {{ .Values.codepair.name }}
9+
app.kubernetes.io/instance: {{ .Values.codepair.name }}
10+
app.kubernetes.io/version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
11+
app.kubernetes.io/component: server
12+
app.kubernetes.io/part-of: {{ .Values.codepair.name }}
13+
app.kubernetes.io/managed-by: {{ .Release.Service }}
14+
version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
15+
spec:
16+
{{ if not .Values.codepair.autoscaling.enabled }}
17+
replicas: {{ .Values.codepair.autoscaling.replicaCount }}
18+
{{ end }}
19+
revisionHistoryLimit: 3
20+
selector:
21+
matchLabels:
22+
app.kubernetes.io/instance: {{ .Values.codepair.name }}
23+
template:
24+
metadata:
25+
labels:
26+
app: {{ .Values.codepair.name }}
27+
app.kubernetes.io/instance: {{ .Values.codepair.name }}
28+
app.kubernetes.io/version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
29+
version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
30+
spec:
31+
containers:
32+
- name: {{ .Values.codepair.name }}
33+
image: "{{ .Values.codepair.image.repository }}:{{ .Values.codepair.image.tag | default .Chart.AppVersion }}"
34+
imagePullPolicy: {{ .Values.codepair.image.pullPolicy }}
35+
env:
36+
- name: DATABASE_URL
37+
value: "{{ .Values.codepair.env.databaseUrl }}"
38+
- name: GITHUB_CLIENT_ID
39+
value: "{{ .Values.codepair.env.githubClientId }}"
40+
- name: GITHUB_CLIENT_SECRET
41+
value: "{{ .Values.codepair.env.githubClientSecret }}"
42+
- name: GITHUB_CALLBACK_URL
43+
value: "{{ .Values.codepair.env.githubCallbackUrl }}"
44+
- name: GITHUB_AUTHORIZATION_URL
45+
value: "{{ .Values.codepair.env.githubAuthorizationUrl }}"
46+
- name: GITHUB_TOKEN_URL
47+
value: "{{ .Values.codepair.env.githubTokenUrl }}"
48+
- name: GITHUB_USER_PROFILE_URL
49+
value: "{{ .Values.codepair.env.githubUserProfileUrl }}"
50+
- name: JWT_ACCESS_TOKEN_SECRET
51+
value: "{{ .Values.codepair.env.jwtAccessTokenSecret }}"
52+
- name: JWT_ACCESS_TOKEN_EXPIRATION_TIME
53+
value: "{{ .Values.codepair.env.jwtAccessTokenExpirationTime }}"
54+
- name: JWT_REFRESH_TOKEN_SECRET
55+
value: "{{ .Values.codepair.env.jwtRefreshTokenSecret }}"
56+
- name: JWT_REFRESH_TOKEN_EXPIRATION_TIME
57+
value: "{{ .Values.codepair.env.jwtRefreshTokenExpirationTime }}"
58+
- name: FRONTEND_BASE_URL
59+
value: "{{ .Values.codepair.env.frontendBaseUrl }}"
60+
- name: YORKIE_API_ADDR
61+
value: "{{ .Values.codepair.env.yorkieApiAddr }}"
62+
- name: YORKIE_PROJECT_NAME
63+
value: "{{ .Values.codepair.env.yorkieProjectName }}"
64+
- name: YORKIE_PROJECT_SECRET_KEY
65+
value: "{{ .Values.codepair.env.yorkieProjectSecretKey }}"
66+
- name: YORKIE_INTELLIGENCE
67+
value: "{{ .Values.codepair.env.yorkieIntelligence }}"
68+
- name: OPENAI_API_KEY
69+
value: "{{ .Values.codepair.env.openaiApiKey }}"
70+
- name: LANGCHAIN_TRACING_V2
71+
value: "{{ .Values.codepair.env.langchainTracingV2 }}"
72+
- name: LANGCHAIN_API_KEY
73+
value: "{{ .Values.codepair.env.langchainApiKey }}"
74+
- name: LANGCHAIN_PROJECT
75+
value: "{{ .Values.codepair.env.langchainProject }}"
76+
- name: FILE_UPLOAD
77+
value: "{{ .Values.codepair.env.fileUpload }}"
78+
- name: AWS_ACCESS_KEY_ID
79+
value: "{{ .Values.codepair.env.awsAccessKeyId }}"
80+
- name: AWS_SECRET_ACCESS_KEY
81+
value: "{{ .Values.codepair.env.awsSecretAccessKey }}"
82+
- name: AWS_REGION
83+
value: "{{ .Values.codepair.env.awsRegion }}"
84+
- name: BUCKET_NAME
85+
value: "{{ .Values.codepair.env.bucketName }}"
86+
ports:
87+
- containerPort: {{ .Values.codepair.ports.serverPort }}
88+
resources:
89+
{{ toYaml .Values.codepair.resources | nindent 12 }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.ingress.enabled -}}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: {{ .Values.codepair.name }}-ingress
6+
namespace: {{ .Values.codepair.namespace }}
7+
annotations:
8+
{{- range $key, $value := .Values.ingress.annotations }}
9+
{{ $key }}: {{ $value | quote }}
10+
{{- end }}
11+
{{- if .Values.ingress.awsAlb.enabled }}
12+
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.ingress.awsAlb.certArn }}
13+
{{- end }}
14+
{{- if .Values.ingress.ncpAlb.enabled }}
15+
ingress.kubernetes.io/ssl-cert-no: {{ .Values.ingress.ncpAlb.certNo | quote }}
16+
{{- end }}
17+
spec:
18+
ingressClassName: {{ .Values.ingress.className }}
19+
rules:
20+
{{- if .Values.ingress.hosts.enabled }}
21+
- host: {{ .Values.ingress.hosts.apiHost | quote }}
22+
http:
23+
paths:
24+
- path: /
25+
pathType: Prefix
26+
backend:
27+
service:
28+
name: {{ .Values.codepair.name }}
29+
port:
30+
number: {{ .Values.codepair.ports.serverPort }}
31+
{{- end }}
32+
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Values.codepair.name }}
5+
namespace: {{ .Values.codepair.namespace }}
6+
labels:
7+
app.kubernetes.io/name: {{ .Values.codepair.name }}
8+
app.kubernetes.io/instance: {{ .Values.codepair.name }}
9+
app.kubernetes.io/component: server
10+
app.kubernetes.io/part-of: {{ .Values.codepair.name }}
11+
app.kubernetes.io/managed-by: {{ .Release.Service }}
12+
spec:
13+
type: NodePort
14+
ports:
15+
- name: {{ .Values.codepair.name }}-server
16+
port: {{ .Values.codepair.ports.serverPort }}
17+
targetPort: {{ .Values.codepair.ports.serverPort }}
18+
appProtocol: http
19+
selector:
20+
app.kubernetes.io/instance: {{ .Values.codepair.name }}

0 commit comments

Comments
 (0)