Skip to content

Commit 7ec5a08

Browse files
committed
Initial commit
0 parents  commit 7ec5a08

8 files changed

+190
-0
lines changed

.helmignore

+23
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/

Chart.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: velocity-agent
3+
description: A Helm chart to run the Velocity Agent
4+
type: application
5+
version: 1.0.5
6+
appVersion: "2.12.0"

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Velocity Agent Helm Chart
2+
3+
This repository contains a Helm Chart for the Velocity Agent.

templates/_helpers.tpl

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "velocity-agent.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | 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+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "velocity-agent.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "velocity-agent.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "velocity-agent.labels" -}}
37+
helm.sh/chart: {{ include "velocity-agent.chart" . }}
38+
{{ include "velocity-agent.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "velocity-agent.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "velocity-agent.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "velocity-agent.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "velocity-agent.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

templates/deployment.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "velocity-agent.fullname" . }}
5+
labels:
6+
{{- include "velocity-agent.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "velocity-agent.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "velocity-agent.selectorLabels" . | nindent 8 }}
16+
spec:
17+
volumes:
18+
- name: data
19+
persistentVolumeClaim:
20+
claimName: {{ include "velocity-agent.fullname" . }}
21+
containers:
22+
- name: {{ .Chart.Name }}
23+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
24+
imagePullPolicy: {{ .Values.image.pullPolicy }}
25+
resources:
26+
limits:
27+
memory: {{ .Values.resources.limits.memory }}
28+
env:
29+
- name: "AGENT_ID"
30+
value: "{{ .Values.agent.agent_id }}"
31+
- name: "AGENT_TOKEN"
32+
value: "{{ .Values.agent.agent_token }}"
33+
- name: "VCS_ID"
34+
value: "{{ .Values.agent.vcs_id }}"
35+
- name: "VCS_CLIENT_ID"
36+
value: "{{ .Values.agent.vcs_client_id }}"
37+
- name: "VCS_CLIENT_SECRET"
38+
value: "{{ .Values.agent.vcs_client_secret }}"
39+
- name: "VCS_GITHUB_APP_ID"
40+
value: "{{ .Values.agent.vcs_github_app_id }}"
41+
- name: "VCS_PRIVATE_KEY"
42+
value: |
43+
{{ .Values.vcs_private_key | indent 16 }}
44+
ports:
45+
- name: http
46+
containerPort: 80
47+
protocol: TCP
48+
- name: console
49+
containerPort: 5050
50+
protocol: TCP
51+
volumeMounts:
52+
- mountPath: "/data"
53+
name: data

templates/pvc.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: {{ include "velocity-agent.fullname" . }}
5+
spec:
6+
accessModes:
7+
- ReadWriteOnce
8+
storageClassName: standard
9+
resources:
10+
requests:
11+
storage: {{ .Values.volume.size }}

templates/service.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "velocity-agent.fullname" . }}
5+
labels:
6+
{{- include "velocity-agent.labels" . | nindent 4 }}
7+
spec:
8+
type: "ClusterIP"
9+
ports:
10+
- port: 4040
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
- port: 5050
15+
targetPort: console
16+
protocol: TCP
17+
name: console
18+
selector:
19+
{{- include "velocity-agent.selectorLabels" . | nindent 4 }}

values.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
replicaCount: 1
2+
3+
image:
4+
repository: codeclimate/velocity-agent
5+
pullPolicy: Always
6+
tag: "latest-v2"
7+
8+
resources:
9+
limits:
10+
memory: "16Gi"
11+
12+
volume:
13+
size: "100Gi"

0 commit comments

Comments
 (0)