Skip to content

Commit 3c2caf3

Browse files
authored
Added community chart guidelines (#602)
* Added community chart guidelines * Updated Readme and json file * Updated contrib-chart readme * Added dynamic variables in chart-contrib readme * Elaborated the chart-contrib readme * Elaborated example description * Updated Image Name and Tag description
1 parent 3dad5db commit 3c2caf3

26 files changed

+2220
-0
lines changed

contrib-chart/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Bring Your Own Chart
2+
3+
We at Devtron strongly believe that a product is always incomplete without the contribution of it's community and the users. What else can be better than devtron users becoming a part of devtron team, the product they love and through this upcoming feature you can help other community members by sharing your own helm charts with devtron.
4+
5+
## Introduction
6+
7+
Very soon we are coming up with a new feature in the charts section of devtron which will be called `Community Charts` where we'll upload the charts submitted by you for all the users who love to deploy and build pipelines on devtron. **All of your charts will have your name associated with it for all users to know who made their life easier by uploading that chart**. So what are you waiting for? Now is the time to do that
8+
9+
## Use dynamic devtron variables in your template
10+
11+
Devtron injects [some variables](https://github.com/devtron-labs/devtron/blob/main/contrib-chart/reference-chart_3-11-0/.image_descriptor_template.json) in values.yaml in order to fully integrate with automatic CD capability. In Template you can use these variables wherever required.
12+
13+
| Syntax | Output |
14+
| ----------- | ----------- |
15+
| server.deployment.image | Image repo populated by Devtron CI |
16+
| server.deployment.image_tag | Image tag populated by Devtron CI |
17+
| pipelineName | Devtron pipeline name |
18+
| releaseVersion | Release version of the chart |
19+
| deploymentType | Deployment strategy used for deployments |
20+
| app | Devtron App ID |
21+
| env | Devtron Environment ID |
22+
| appMetrics | Configuration for the metrics exposed by the app |
23+
24+
## How to use dynamic devtron variables
25+
26+
This is an example of deployment.yaml which will create a deployment named `httpd-web` and it will identify the app to deploy using the appId and environment in which to deploy using envId both of which values will be taken from devtron dynamic variables and same is the case for image repo and tag to be used for deployment. This deployment will create a pod named `myweb-pod` where our application will be up and running.
27+
28+
apiVersion: apps/v1
29+
kind: Deployment
30+
metadata:
31+
name: httpd-web
32+
labels:
33+
app: myweb
34+
spec:
35+
replicas: 1
36+
selector:
37+
matchLabels:
38+
app: myweb
39+
template:
40+
metadata:
41+
labels:
42+
app: myweb
43+
appId: {{ $.Values.app | quote }}
44+
envId: {{ $.Values.env | quote }}
45+
spec:
46+
containers:
47+
- name: myweb-pod
48+
image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}"
49+
ports:
50+
- containerPort: 80
51+
52+
53+
## How to Share Chart
54+
55+
1. Fork the [devtron-labs/devtron](https://github.com/devtron-labs/devtron) repository
56+
2. Upload your chart directory inside `chart-contrib` directory
57+
4. Add a README file inside your chart describing it's use case and how to use
58+
5. Verify everything works fine by using the command `helm template --debug <template-dir-name>`
59+
6. Generate a Pull Request on the branch `contribute-chart` of [devtron-labs/devtron](https://github.com/devtron-labs/devtron)
60+
7. Hold on till we verify everything and upload on the community charts section
61+
62+
## Communications
63+
64+
The project uses discord for communication:
65+
66+
To join the conversation, simply join the **[discord](https://discord.gg/jsRG5qx2gp)** and use the __#contrib__ channel.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"server": {
3+
"deployment": {
4+
"image_tag": "{{.Tag}}",
5+
"image": "{{.Name}}"
6+
}
7+
},
8+
"pipelineName": "{{.PipelineName}}",
9+
"releaseVersion": "{{.ReleaseVersion}}",
10+
"deploymentType": "{{.DeploymentType}}",
11+
"app": "{{.App}}",
12+
"env": "{{.Env}}",
13+
"appMetrics": "{{.AppMetrics}}"
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
appVersion: "1.0"
3+
description: A Helm chart for Kubernetes
4+
name: reference-chart_3-11-0
5+
version: 3.11.0
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# Mandatory configs
2+
replicaCount: 1
3+
MinReadySeconds: 60
4+
GracePeriod: 30
5+
image:
6+
pullPolicy: IfNotPresent
7+
service:
8+
type: ClusterIP
9+
#name: "service-1234567890"
10+
annotations: {}
11+
# test1: test2
12+
# test3: test4
13+
ContainerPort:
14+
- name: app
15+
port: 8080
16+
servicePort: 80
17+
envoyPort: 8799
18+
useHTTP2: true
19+
supportStreaming: true
20+
idleTimeout: 1800s
21+
# servicemonitor:
22+
# enabled: true
23+
# path: /abc
24+
# scheme: 'http'
25+
# interval: 30s
26+
# scrapeTimeout: 20s
27+
# metricRelabelings:
28+
# - sourceLabels: [namespace]
29+
# regex: '(.*)'
30+
# replacement: myapp
31+
# targetLabel: target_namespace
32+
resources:
33+
# We usually recommend not to specify default resources and to leave this as a conscious
34+
# choice for the user. This also increases chances charts run on environments with little
35+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
36+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
37+
limits:
38+
cpu: 1
39+
memory: 200Mi
40+
requests:
41+
cpu: 0.10
42+
memory: 100Mi
43+
44+
45+
# Optional configs
46+
LivenessProbe:
47+
Path: ""
48+
port: 8080
49+
scheme: ""
50+
httpHeader:
51+
name: ""
52+
value: ""
53+
tcp: false
54+
command: []
55+
initialDelaySeconds: 20
56+
periodSeconds: 10
57+
successThreshold: 1
58+
timeoutSeconds: 5
59+
failureThreshold: 3
60+
61+
ReadinessProbe:
62+
Path: ""
63+
port: 8080
64+
scheme: ""
65+
httpHeader:
66+
name: ""
67+
value: ""
68+
tcp: false
69+
command: []
70+
initialDelaySeconds: 20
71+
periodSeconds: 10
72+
successThreshold: 1
73+
timeoutSeconds: 5
74+
failureThreshold: 3
75+
76+
ingress:
77+
enabled: false
78+
annotations:
79+
nginx.ingress.kubernetes.io/force-ssl-redirect: 'false'
80+
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
81+
kubernetes.io/ingress.class: nginx
82+
# nginx.ingress.kubernetes.io/rewrite-target: /$2
83+
# nginx.ingress.kubernetes.io/canary: "true"
84+
# nginx.ingress.kubernetes.io/canary-weight: "10"
85+
86+
hosts:
87+
- host: chart-example1.local
88+
paths:
89+
- /example1
90+
- host: chart-example2.local
91+
paths:
92+
- /example2
93+
- /example2/healthz
94+
tls: []
95+
# - secretName: chart-example-tls
96+
# hosts:
97+
# - chart-example.local
98+
99+
ingressInternal:
100+
enabled: false
101+
annotations: {}
102+
# kubernetes.io/ingress.class: nginx
103+
# kubernetes.io/tls-acme: "true"
104+
# nginx.ingress.kubernetes.io/canary: "true"
105+
# nginx.ingress.kubernetes.io/canary-weight: "10"
106+
107+
hosts:
108+
- host: chart-example1.internal
109+
paths:
110+
- /example1
111+
- host: chart-example2.internal
112+
paths:
113+
- /example2
114+
- /example2/healthz
115+
tls: []
116+
# - secretName: chart-example-tls
117+
# hosts:
118+
# - chart-example.local
119+
120+
command:
121+
enabled: false
122+
value: []
123+
124+
args:
125+
enabled: false
126+
value:
127+
- /bin/sh
128+
- -c
129+
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
130+
131+
#For adding custom labels to pods
132+
133+
podLabels: {}
134+
# customKey: customValue
135+
podAnnotations: {}
136+
# customKey: customValue
137+
138+
rawYaml: []
139+
140+
initContainers: []
141+
## Additional init containers to run before the Scheduler pods.
142+
## for example, be used to run a sidecar that chown Logs storage .
143+
#- name: volume-mount-hack
144+
# image: busybox
145+
# command: ["sh", "-c", "chown -R 1000:1000 logs"]
146+
# volumeMounts:
147+
# - mountPath: /usr/local/airflow/logs
148+
# name: logs-data
149+
150+
containers: []
151+
## Additional containers to run along with application pods.
152+
## for example, be used to run a sidecar that chown Logs storage .
153+
#- name: volume-mount-hack
154+
# image: busybox
155+
# command: ["sh", "-c", "chown -R 1000:1000 logs"]
156+
# volumeMounts:
157+
# - mountPath: /usr/local/airflow/logs
158+
# name: logs-data
159+
160+
volumeMounts: []
161+
# - name: log-volume
162+
# mountPath: /var/log
163+
164+
volumes: []
165+
# - name: log-volume
166+
# emptyDir: {}
167+
168+
dbMigrationConfig:
169+
enabled: false
170+
171+
tolerations: []
172+
173+
Spec:
174+
Affinity:
175+
Key:
176+
# Key: kops.k8s.io/instancegroup
177+
Values:
178+
179+
autoscaling:
180+
enabled: false
181+
MinReplicas: 1
182+
MaxReplicas: 2
183+
TargetCPUUtilizationPercentage: 70
184+
TargetMemoryUtilizationPercentage: 80
185+
extraMetrics: []
186+
# - external:
187+
# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages
188+
# metricSelector:
189+
# matchLabels:
190+
# resource.labels.subscription_id: echo-read
191+
# targetAverageValue: "2"
192+
# type: External
193+
#
194+
195+
prometheus:
196+
release: monitoring
197+
198+
server:
199+
deployment:
200+
image_tag: 1-95af053
201+
image: ""
202+
203+
servicemonitor:
204+
additionalLabels: {}
205+
206+
envoyproxy:
207+
image: envoyproxy/envoy:v1.14.1
208+
configMapName: ""
209+
resources:
210+
limits:
211+
cpu: 50m
212+
memory: 50Mi
213+
requests:
214+
cpu: 50m
215+
memory: 50Mi
216+
217+
218+
imagePullSecrets: []
219+
# - test1
220+
# - test2
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
replicaCount: 1
2+
MaxSurge: 1
3+
MaxUnavailable: 0
4+
GracePeriod: 30
5+
pauseForSecondsBeforeSwitchActive: 30
6+
waitForSecondsBeforeScalingDown: 30
7+
8+
Spec:
9+
Affinity:
10+
key: ""
11+
Values: nodes
12+
13+
autoscaling:
14+
enabled: false
15+
MinReplicas: 1
16+
MaxReplicas: 2
17+
TargetCPUUtilizationPercentage: 90
18+
TargetMemoryUtilizationPercentage: 80
19+
20+
secret:
21+
enabled: false
22+
data: {}
23+
# my_own_secret: S3ViZXJuZXRlcyBXb3Jrcw==
24+
25+
EnvVariables: []
26+
# - name: FLASK_ENV
27+
# value: qa
28+
29+
resources:
30+
# We usually recommend not to specify default resources and to leave this as a conscious
31+
# choice for the user. This also increases chances charts run on environments with little
32+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
33+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
34+
limits:
35+
cpu: "0.05"
36+
memory: 50Mi
37+
requests:
38+
cpu: "0.01"
39+
memory: 10Mi
40+
41+

0 commit comments

Comments
 (0)