Skip to content

Commit

Permalink
Adding scoop helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashasvi Pareta authored and Yashasvi Pareta committed Aug 14, 2024
1 parent 2578f65 commit e721690
Show file tree
Hide file tree
Showing 9 changed files with 273 additions and 0 deletions.
9 changes: 9 additions & 0 deletions charts/scoop/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
appVersion: 1.16.0
description: Chart to deploy scoop
maintainers:
- email: [email protected]
name: Devops-Team DEVTRON
name: devtron-scoop
type: application
version: 1.0.1
31 changes: 31 additions & 0 deletions charts/scoop/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: read-only-cluster-role-scoop
rules:
- apiGroups:
- '*'
resources:
- '*'

Check warning

Code scanning / SonarCloud

Wildcards should not be used to define RBAC permissions Medium

Do not use wildcards when defining RBAC permissions. See more on SonarCloud
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- '*'

Check warning

Code scanning / SonarCloud

Wildcards should not be used to define RBAC permissions Medium

Do not use wildcards when defining RBAC permissions. See more on SonarCloud
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- '*'

Check warning

Code scanning / SonarCloud

Wildcards should not be used to define RBAC permissions Medium

Do not use wildcards when defining RBAC permissions. See more on SonarCloud
verbs:
- get
- list
- watch
12 changes: 12 additions & 0 deletions charts/scoop/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: read-only-user-crb-scoop
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: read-only-cluster-role-scoop
subjects:
- kind: ServiceAccount
name: scoop-sa
namespace: {{ $.Values.scoopNamespace | default .Release.Namespace }}
14 changes: 14 additions & 0 deletions charts/scoop/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if $.Values.ConfigMap.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $.Values.ConfigMap.name }}
namespace: {{ $.Values.scoopNamespace | default .Release.Namespace }}
{{- if $.Values.ConfigMap.data }}
data:
{{ toYaml $.Values.ConfigMap.data | indent 2 }}
{{- end }}
{{- end}}



78 changes: 78 additions & 0 deletions charts/scoop/templates/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

apiVersion: apps/v1
kind: Deployment
metadata:
name: scoop-deployment
labels:
{{- if $.Values.labels }}
{{ toYaml $.Values.labels | nindent 4 }}
{{- end }}
namespace: {{ $.Values.scoopNamespace | default .Release.Namespace }}
spec:
selector:
matchLabels:
app: scoop
{{- if $.Values.scoop.replicaCount }}
replicas: {{ $.Values.scoop.replicaCount}}
{{- end }}
minReadySeconds: 60
template:
metadata:
labels:
app: scoop
spec:

Check warning

Code scanning / SonarCloud

Service account tokens should not be mounted in pods Medium

Set automountServiceAccountToken to false for this specification of kind Deployment. See more on SonarCloud
serviceAccountName: scoop-sa
terminationGracePeriodSeconds: 30

{{- if $.Values.scoop.existingImagePullSecret }}
imagePullSecrets:
- name: {{ $.Values.scoop.existingImagePullSecret }}
{{- else }}
{{- if $.Values.secrets.enabled }}
imagePullSecrets:
- name: {{ $.Values.secrets.name }}
{{- end }}
{{- end }}
restartPolicy: Always
{{- if $.Values.volumes }}
volumes:
{{ toYaml $.Values.volumes | indent 8 }}
{{- end }}

containers:
- name: scoop

Check warning

Code scanning / SonarCloud

Memory limits should be enforced Medium

Specify a memory limit for this container. See more on SonarCloud

Check warning

Code scanning / SonarCloud

Storage limits should be enforced Medium

Specify a storage limit for this container. See more on SonarCloud
image: {{ $.Values.scoop.image }}
imagePullPolicy: IfNotPresent
ports:
- name: app
containerPort: 8080
protocol: TCP
{{- if $.Values.env }}
env:
{{ toYaml $.Values.env | indent 12 }}
{{- end }}

{{- if or $.Values.ConfigMap.enabled $.Values.secrets.enabled }}
envFrom:
{{- if $.Values.ConfigMap.enabled }}
- configMapRef:
name: {{ $.Values.ConfigMap.name }}
{{- end }}

{{- if $.Values.secrets.enabled }}
- secretRef:
name: {{ $.Values.secrets.name }}
{{- end }}
{{- end }}

{{- if $.Values.resources }}
resources:
{{ toYaml $.Values.resources | indent 12 }}
{{- end }}

{{- if $.Values.volumeMounts }}
volumeMounts:
{{ toYaml $.Values.volumeMounts | indent 12 }}
{{- end }}
revisionHistoryLimit: 3

14 changes: 14 additions & 0 deletions charts/scoop/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if $.Values.secrets.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $.Values.secrets.name }}
namespace: {{ $.Values.scoopNamespace | default .Release.Namespace }}
type: {{ $.Values.secrets.type }}
{{- if $.Values.secrets.data }}
data:
{{- range $.Values.secrets.data }}
{{ .key | quote }}: {{ .value | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
23 changes: 23 additions & 0 deletions charts/scoop/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
name: scoop-service
labels:
app: scoop
{{- if $.Values.labels }}
{{ toYaml .Values.labels | indent 2 }}
{{- end }}
namespace: {{ $.Values.scoopNamespace | default .Release.Namespace }}
spec:
{{- if $.Values.service.type }}
type: {{ $.Values.service.type }}
{{- end }}
ports:
{{- if $.Values.service.port }}
- port: {{ $.Values.service.port }}
{{- end }}
targetPort: 8080
protocol: TCP
name: app
selector:
app: scoop
10 changes: 10 additions & 0 deletions charts/scoop/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: scoop-sa
namespace: {{ $.Values.scoopNamespace | default .Release.Namespace }}





82 changes: 82 additions & 0 deletions charts/scoop/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

scoopNamespace: ""
# namespace where all the resource will be created

service:
type: ClusterIP
port: 80

# If both existingImagePullSecret and imagePullSecrets are present, existingImagePullSecret will be given preference.
scoop:
replicaCount: 1
existingImagePullSecret: ""
# Set enabled to true if you want to pass the values of secret.yaml from SecretRef
secrets:
name: scoop-secret
type: Opaque
## for docker hub secret
#type: kubernetes.io/dockerconfigjson
enabled: true
data:
## When you are creating secret for docker hub please use below syntax keep values in single quote only
# - key: .dockerconfigjson
# value: '{"auths":{"https://index.docker.io/v1/":{"username":"example_user","password":"XXXXXXXXX"}}}'
- key: db-username
value: "root"
- key: db-pass
value: "1234567"

env:
- name: X-PASS-KEY
value: "random-string"
- name: PASS_KEY
value: "random-string"
# X_PASS_KEY and PASS_KEY (should be the same) are used for authentication
- name: RETENTION
value: "10080"
# Period for which cache will be stored

# ID of the cluster where scoop needs to be implemented
- name: CLUSTER_ID
value: ""

# URL to which scoop sends the metrics
- name: ORCHESTRATOR_URL
value: ""

#token of the orchestrator url
- name: TOKEN
value: ""
#storing the cache of specified namespaces. If you do not specify it, by default, it will store the cache of all the namespaces.


ConfigMap:
# Set enabled to true if you want to pass any configMapSecret from configmap
name: scoop-config
enabled: true
data: []


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


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

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. 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


0 comments on commit e721690

Please sign in to comment.