From 3cb82e836c6bee5c1dbbbc3bba955b18a8438399 Mon Sep 17 00:00:00 2001 From: yashasvi Date: Thu, 27 Jun 2024 10:23:53 +0530 Subject: [PATCH 1/2] updating scoop template --- charts/scoop/Chart.yaml | 9 ++ charts/scoop/dt-scoop-0.1.2.tgz | Bin 0 -> 2345 bytes charts/scoop/templates/clusterrole.yaml | 32 +++++++ .../scoop/templates/clusterrolebinding.yaml | 12 +++ charts/scoop/templates/config.yaml | 14 ++++ charts/scoop/templates/deployment.yml | 77 +++++++++++++++++ charts/scoop/templates/secret.yaml | 13 +++ charts/scoop/templates/service.yaml | 24 ++++++ charts/scoop/templates/serviceaccount.yaml | 10 +++ charts/scoop/values.yaml | 78 ++++++++++++++++++ 10 files changed, 269 insertions(+) create mode 100644 charts/scoop/Chart.yaml create mode 100644 charts/scoop/dt-scoop-0.1.2.tgz create mode 100644 charts/scoop/templates/clusterrole.yaml create mode 100644 charts/scoop/templates/clusterrolebinding.yaml create mode 100644 charts/scoop/templates/config.yaml create mode 100644 charts/scoop/templates/deployment.yml create mode 100644 charts/scoop/templates/secret.yaml create mode 100644 charts/scoop/templates/service.yaml create mode 100644 charts/scoop/templates/serviceaccount.yaml create mode 100644 charts/scoop/values.yaml diff --git a/charts/scoop/Chart.yaml b/charts/scoop/Chart.yaml new file mode 100644 index 00000000..1ddb6674 --- /dev/null +++ b/charts/scoop/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +name: dt-scoop +description: Chart to deploy scoop +type: application +version: 0.1.2 +appVersion: "1.16.0" +maintainers: +- email: devops@devtron.ai + name: Devops-Team DEVTRON diff --git a/charts/scoop/dt-scoop-0.1.2.tgz b/charts/scoop/dt-scoop-0.1.2.tgz new file mode 100644 index 0000000000000000000000000000000000000000..fbfc3b59fef30f2aaa8e5302e3a94a8bcb84ac7d GIT binary patch literal 2345 zcmV+^3D))>iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|N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1#PzAg-G!vARCw(vh0jdt^&XQBTe|9{VX zqY(z$_%)f{3FJ+IUBPjRGaE2+Xgsnj0eBd6o)jZgdh;^|+J=ct#8uWl9tE}`Y}aWt ze~|a8cX#lo{)cQH((Gg5OIZT-r^t~i?4Os5_xJEyP4jE13;(wC-r^)^6aEiI2QB=M zyrH|p|8vmYonxAy(%;L5te-b6aDPu)L*g8j1!qSDs3WM7Xx5ClErE@!*WGAiI5Ms7 z?m&x=rgdA#`UO}Vnl58d$TiJR_3OQ9ync7sehPKqKO60vrmMf&N(k6A|D6om_5Wz% zPImZz4r*ZA6sT3MKPmm71L0ZbtXzcvaC(D0FaO)n%+@kQJpg0A_yyt|g$G%b$i(DG z+*Z&~2?j<-g&YGdWTtOqO6;@R0ZfIGl*6b6mF9%)Q`yyiebk(3nmFA#)fEOJ4wVmMmq0mK&vmU`h9TZiyHoLu)?Z4ty8dF?_wwLw01CU>-y7A|dArmy zq)|pJw&mVyNdvsJ)8+EmLzj?lr86tGhxwIa561kZ!cIqW+9a)YNZY(=D)pt{ELiz) z#Bb?JHZ8~xX>K;3m zQ%%D+>r+VDpv@C+r4(CDq#G~SrrcfbP`%Z33izM*uTSNhDm3Ty>mi@N`vmW-o6KgL zB{TW^4O3dk)ftPJ_F+f>o{;}L>c85zj_uSKoBO{9^`AG|&3~VTo&faD?l1p-_jv2~ z5bN8i;j;e#xJc+PDL&`|i%mE7fDOh?9iWB(_r9!eK%Mxv)!X(0zy|z#?(o6bOP zxYp)rXxS)&*Y9B1iWKkU|HIU^OP#NyM$%NyQ9mf5yGrMJA>QnNJA20O?VCIL_Ow3! z)2w^nLK@gq{|&rJ`}_ZRvitwfXQ9X9fAO_!Z5r6xcQayIEAq6CWk);O(T;Ys4f<~Y P00960V2GWt05$*sBo&+I literal 0 HcmV?d00001 diff --git a/charts/scoop/templates/clusterrole.yaml b/charts/scoop/templates/clusterrole.yaml new file mode 100644 index 00000000..7ebffff9 --- /dev/null +++ b/charts/scoop/templates/clusterrole.yaml @@ -0,0 +1,32 @@ +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: + - '*' + verbs: + - get + - list + - watch +- apiGroups: + - extensions + resources: + - '*' + verbs: + - get + - list + - watch +- apiGroups: + - apps + resources: + - '*' + verbs: + - get + - list + - watch +--- \ No newline at end of file diff --git a/charts/scoop/templates/clusterrolebinding.yaml b/charts/scoop/templates/clusterrolebinding.yaml new file mode 100644 index 00000000..02e730b0 --- /dev/null +++ b/charts/scoop/templates/clusterrolebinding.yaml @@ -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 }} diff --git a/charts/scoop/templates/config.yaml b/charts/scoop/templates/config.yaml new file mode 100644 index 00000000..fb2124f2 --- /dev/null +++ b/charts/scoop/templates/config.yaml @@ -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}} + + + diff --git a/charts/scoop/templates/deployment.yml b/charts/scoop/templates/deployment.yml new file mode 100644 index 00000000..c0e6623f --- /dev/null +++ b/charts/scoop/templates/deployment.yml @@ -0,0 +1,77 @@ + +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-chart + {{- if $.Values.scoop.replicacount }} + replicas: {{ $.Values.scoop.replicacount}} + {{- end }} + minReadySeconds: 60 + template: + metadata: + labels: + app: scoop-chart + {{- if $.Values.labels }} + {{ toYaml $.Values.labels | indent 4 }} + {{- end }} + spec: + serviceAccountName: scoop-sa + terminationGracePeriodSeconds: 30 + + {{- if $.Values.scoop.imagePullSecrets }} + imagePullSecrets: + - name: {{ $.Values.scoop.imagePullSecrets }} + {{- end }} + restartPolicy: Always + + {{- if $.Values.volumes }} + volumes: +{{ toYaml $.Values.volumes | indent 8 }} + {{- end }} + + containers: + - name: scoop-chart + image: {{ $.Values.scoop.imagename }} + 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 + \ No newline at end of file diff --git a/charts/scoop/templates/secret.yaml b/charts/scoop/templates/secret.yaml new file mode 100644 index 00000000..005ff23e --- /dev/null +++ b/charts/scoop/templates/secret.yaml @@ -0,0 +1,13 @@ +{{- if $.Values.secrets.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ $.Values.secrets.name }} + namespace: {{ $.Values.scoopnamespace | default .Release.Namespace }} +type: Opaque +{{- if $.Values.secrets.data }} +data: +{{ toYaml $.Values.secrets.data | indent 2 }} +{{- end }} +{{- end }} + diff --git a/charts/scoop/templates/service.yaml b/charts/scoop/templates/service.yaml new file mode 100644 index 00000000..0aecd5f9 --- /dev/null +++ b/charts/scoop/templates/service.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + name: scoop-service + labels: + app: scoop-chart + {{- if $.Values.labels }} +{{ toYaml .Values.labels | indent 2 }} + {{- end }} + namespace: {{ $.Values.scoopnamespace | default .Release.Namespace }} +spec: + {{- with $.Values.service.type }} + type: {{ $.Values.service.type }} + {{- end }} + ports: + {{- with $.Values.service.port }} + - port: {{ $.Values.service.port }} + {{- end }} + targetPort: 8080 + protocol: TCP + name: app + selector: + app: scoop-chart + \ No newline at end of file diff --git a/charts/scoop/templates/serviceaccount.yaml b/charts/scoop/templates/serviceaccount.yaml new file mode 100644 index 00000000..80eb1a03 --- /dev/null +++ b/charts/scoop/templates/serviceaccount.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: scoop-sa + namespace: {{ $.Values.scoopnamespace | default .Release.Namespace }} + + + + + \ No newline at end of file diff --git a/charts/scoop/values.yaml b/charts/scoop/values.yaml new file mode 100644 index 00000000..60c12cfb --- /dev/null +++ b/charts/scoop/values.yaml @@ -0,0 +1,78 @@ +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +scoopnamespace: "monitoring" +# namespace where all the resource will be present +service: + type: ClusterIP + port: 80 + +scoop: + replicacount: 1 + imagePullSecrets: devtron-image-pull + imagename: "" + + +env: + - name: X-PASS-KEY + value: "random-string" + - name: PASS_KEY + value: "random-string" + # X_PASS_KEY and PASS_KEY (should be same) is used for authentication + - name: RETENTION + value: "10080" + # period till which cache will be stored + + # id of the cluster where scoop needs to get implemented + - name: CLUSTER_ID + value: "40" + + # url to which scoop sends the metrics + - name: ORCHESTRATOR_URL + value: "" + + #token of the orchestrator url + - name: TOKEN + value: "" +# sotring the cache of specified namespaces. If you do not specify it, by default, it will store the cache of all the namespaces. +# - name: CACHED_NAMESPACES +# value: monitoring + + + # Set enable to false, if you don't want to pass any configMapSecret +ConfigMap: + name: scoop-config + enabled: true + data: [] + #: "key1value-1" + #key2: "keyvalue2" + + + # Set enable to false if you don't want to pass the values of secret.yaml from SecretRef +secrets: + name: scoop-secret + 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 + + From 68e1d08fab136395406317e781066474269b9763 Mon Sep 17 00:00:00 2001 From: Yashasvi17 <155513200+YashasviDevtron@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:30:36 +0530 Subject: [PATCH 2/2] Update values.yaml --- charts/scoop/values.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/scoop/values.yaml b/charts/scoop/values.yaml index 60c12cfb..640c20ed 100644 --- a/charts/scoop/values.yaml +++ b/charts/scoop/values.yaml @@ -18,28 +18,28 @@ env: value: "random-string" - name: PASS_KEY value: "random-string" - # X_PASS_KEY and PASS_KEY (should be same) is used for authentication + # X_PASS_KEY and PASS_KEY (should be the same) are used for authentication - name: RETENTION value: "10080" - # period till which cache will be stored - - # id of the cluster where scoop needs to get implemented + # Period for which cache will be stored + + # ID of the cluster where scoop needs to be implemented - name: CLUSTER_ID value: "40" - - # url to which scoop sends the metrics + + # URL to which scoop sends the metrics - name: ORCHESTRATOR_URL value: "" #token of the orchestrator url - name: TOKEN value: "" -# sotring the cache of specified namespaces. If you do not specify it, by default, it will store the cache of all the namespaces. +# Storing the cache of specified namespaces. If you do not specify it, by default, it will store the cache of all the namespaces. # - name: CACHED_NAMESPACES # value: monitoring - # Set enable to false, if you don't want to pass any configMapSecret +# Set enable to false if you don't want to pass any configMapSecret from configmap ConfigMap: name: scoop-config enabled: true