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 00000000..fbfc3b59 Binary files /dev/null and b/charts/scoop/dt-scoop-0.1.2.tgz differ 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..640c20ed --- /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 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: "40" + + # 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. +# - name: CACHED_NAMESPACES +# value: monitoring + + +# Set enable to false if you don't want to pass any configMapSecret from configmap +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 + +