Skip to content

Commit

Permalink
Added community chart guidelines (#602)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dheeth authored Jul 23, 2021
1 parent 3dad5db commit 3c2caf3
Show file tree
Hide file tree
Showing 26 changed files with 2,220 additions and 0 deletions.
66 changes: 66 additions & 0 deletions contrib-chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Bring Your Own Chart

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.

## Introduction

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

## Use dynamic devtron variables in your template

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.

| Syntax | Output |
| ----------- | ----------- |
| server.deployment.image | Image repo populated by Devtron CI |
| server.deployment.image_tag | Image tag populated by Devtron CI |
| pipelineName | Devtron pipeline name |
| releaseVersion | Release version of the chart |
| deploymentType | Deployment strategy used for deployments |
| app | Devtron App ID |
| env | Devtron Environment ID |
| appMetrics | Configuration for the metrics exposed by the app |

## How to use dynamic devtron variables

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.

apiVersion: apps/v1
kind: Deployment
metadata:
name: httpd-web
labels:
app: myweb
spec:
replicas: 1
selector:
matchLabels:
app: myweb
template:
metadata:
labels:
app: myweb
appId: {{ $.Values.app | quote }}
envId: {{ $.Values.env | quote }}
spec:
containers:
- name: myweb-pod
image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}"
ports:
- containerPort: 80


## How to Share Chart

1. Fork the [devtron-labs/devtron](https://github.com/devtron-labs/devtron) repository
2. Upload your chart directory inside `chart-contrib` directory
4. Add a README file inside your chart describing it's use case and how to use
5. Verify everything works fine by using the command `helm template --debug <template-dir-name>`
6. Generate a Pull Request on the branch `contribute-chart` of [devtron-labs/devtron](https://github.com/devtron-labs/devtron)
7. Hold on till we verify everything and upload on the community charts section

## Communications

The project uses discord for communication:

To join the conversation, simply join the **[discord](https://discord.gg/jsRG5qx2gp)** and use the __#contrib__ channel.
22 changes: 22 additions & 0 deletions contrib-chart/reference-chart_3-11-0/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"server": {
"deployment": {
"image_tag": "{{.Tag}}",
"image": "{{.Name}}"
}
},
"pipelineName": "{{.PipelineName}}",
"releaseVersion": "{{.ReleaseVersion}}",
"deploymentType": "{{.DeploymentType}}",
"app": "{{.App}}",
"env": "{{.Env}}",
"appMetrics": "{{.AppMetrics}}"
}
5 changes: 5 additions & 0 deletions contrib-chart/reference-chart_3-11-0/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: reference-chart_3-11-0
version: 3.11.0
220 changes: 220 additions & 0 deletions contrib-chart/reference-chart_3-11-0/app-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
# Mandatory configs
replicaCount: 1
MinReadySeconds: 60
GracePeriod: 30
image:
pullPolicy: IfNotPresent
service:
type: ClusterIP
#name: "service-1234567890"
annotations: {}
# test1: test2
# test3: test4
ContainerPort:
- name: app
port: 8080
servicePort: 80
envoyPort: 8799
useHTTP2: true
supportStreaming: true
idleTimeout: 1800s
# servicemonitor:
# enabled: true
# path: /abc
# scheme: 'http'
# interval: 30s
# scrapeTimeout: 20s
# metricRelabelings:
# - sourceLabels: [namespace]
# regex: '(.*)'
# replacement: myapp
# targetLabel: target_namespace
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
limits:
cpu: 1
memory: 200Mi
requests:
cpu: 0.10
memory: 100Mi


# Optional configs
LivenessProbe:
Path: ""
port: 8080
scheme: ""
httpHeader:
name: ""
value: ""
tcp: false
command: []
initialDelaySeconds: 20
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
failureThreshold: 3

ReadinessProbe:
Path: ""
port: 8080
scheme: ""
httpHeader:
name: ""
value: ""
tcp: false
command: []
initialDelaySeconds: 20
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
failureThreshold: 3

ingress:
enabled: false
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: 'false'
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
kubernetes.io/ingress.class: nginx
# nginx.ingress.kubernetes.io/rewrite-target: /$2
# nginx.ingress.kubernetes.io/canary: "true"
# nginx.ingress.kubernetes.io/canary-weight: "10"

hosts:
- host: chart-example1.local
paths:
- /example1
- host: chart-example2.local
paths:
- /example2
- /example2/healthz
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

ingressInternal:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# nginx.ingress.kubernetes.io/canary: "true"
# nginx.ingress.kubernetes.io/canary-weight: "10"

hosts:
- host: chart-example1.internal
paths:
- /example1
- host: chart-example2.internal
paths:
- /example2
- /example2/healthz
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

command:
enabled: false
value: []

args:
enabled: false
value:
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600

#For adding custom labels to pods

podLabels: {}
# customKey: customValue
podAnnotations: {}
# customKey: customValue

rawYaml: []

initContainers: []
## Additional init containers to run before the Scheduler pods.
## for example, be used to run a sidecar that chown Logs storage .
#- name: volume-mount-hack
# image: busybox
# command: ["sh", "-c", "chown -R 1000:1000 logs"]
# volumeMounts:
# - mountPath: /usr/local/airflow/logs
# name: logs-data

containers: []
## Additional containers to run along with application pods.
## for example, be used to run a sidecar that chown Logs storage .
#- name: volume-mount-hack
# image: busybox
# command: ["sh", "-c", "chown -R 1000:1000 logs"]
# volumeMounts:
# - mountPath: /usr/local/airflow/logs
# name: logs-data

volumeMounts: []
# - name: log-volume
# mountPath: /var/log

volumes: []
# - name: log-volume
# emptyDir: {}

dbMigrationConfig:
enabled: false

tolerations: []

Spec:
Affinity:
Key:
# Key: kops.k8s.io/instancegroup
Values:

autoscaling:
enabled: false
MinReplicas: 1
MaxReplicas: 2
TargetCPUUtilizationPercentage: 70
TargetMemoryUtilizationPercentage: 80
extraMetrics: []
# - external:
# metricName: pubsub.googleapis.com|subscription|num_undelivered_messages
# metricSelector:
# matchLabels:
# resource.labels.subscription_id: echo-read
# targetAverageValue: "2"
# type: External
#

prometheus:
release: monitoring

server:
deployment:
image_tag: 1-95af053
image: ""

servicemonitor:
additionalLabels: {}

envoyproxy:
image: envoyproxy/envoy:v1.14.1
configMapName: ""
resources:
limits:
cpu: 50m
memory: 50Mi
requests:
cpu: 50m
memory: 50Mi


imagePullSecrets: []
# - test1
# - test2
41 changes: 41 additions & 0 deletions contrib-chart/reference-chart_3-11-0/env-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
replicaCount: 1
MaxSurge: 1
MaxUnavailable: 0
GracePeriod: 30
pauseForSecondsBeforeSwitchActive: 30
waitForSecondsBeforeScalingDown: 30

Spec:
Affinity:
key: ""
Values: nodes

autoscaling:
enabled: false
MinReplicas: 1
MaxReplicas: 2
TargetCPUUtilizationPercentage: 90
TargetMemoryUtilizationPercentage: 80

secret:
enabled: false
data: {}
# my_own_secret: S3ViZXJuZXRlcyBXb3Jrcw==

EnvVariables: []
# - name: FLASK_ENV
# value: qa

resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
limits:
cpu: "0.05"
memory: 50Mi
requests:
cpu: "0.01"
memory: 10Mi


Loading

0 comments on commit 3c2caf3

Please sign in to comment.