diff --git a/Chart.yaml b/Chart.yaml index 2a163901..344a7d94 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -25,6 +25,8 @@ maintainers: email: kooper@illinois.edu - name: Aju Tamang email: aju.775401@ac.tu.edu.np + - name: Sagar Utekar + email: sagarutekar2366@gmail.com # location of source code sources: diff --git a/README.md b/README.md index 32488c9e..84de6966 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Bety is a Web-interface to the Biofuel Ecophysiological Traits and Yields Databa ``` helm repo add ncsa https://opensource.ncsa.illinois.edu/charts/ +helm dependency build ``` To install the chart with the release name my-release: diff --git a/templates/deployment.yaml b/templates/deployment.yaml index b9027786..31744e90 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -36,6 +36,8 @@ spec: name: {{ include "betydb.fullname" . }}-logos {{- end }} {{- end }} + serviceAccountName: {{ include "betydb.fullname" . }} + automountServiceAccountToken: false initContainers: - name: check-postgresql image: "{{ $.Values.image.checks }}" diff --git a/templates/hooks/add-user.yaml b/templates/hooks/add-user.yaml index df160cbe..9c36ac5d 100644 --- a/templates/hooks/add-user.yaml +++ b/templates/hooks/add-user.yaml @@ -32,6 +32,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + serviceAccountName: {{ include "betydb.fullname" . }}-hooks + automountServiceAccountToken: false initContainers: #{{- if or .Values.dburl .Values.dbtag }} # - name: check-job diff --git a/templates/hooks/load-db.yaml b/templates/hooks/load-db.yaml index e6e244db..860e46ea 100644 --- a/templates/hooks/load-db.yaml +++ b/templates/hooks/load-db.yaml @@ -33,6 +33,8 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{- include "betydb.postgresqlEnv" . | nindent 12 }} + serviceAccountName: {{ include "betydb.fullname" . }}-hooks + automountServiceAccountToken: false containers: - name: bety-init {{- if .Values.dburl }} diff --git a/templates/hooks/role.yaml b/templates/hooks/role.yaml new file mode 100644 index 00000000..6985843c --- /dev/null +++ b/templates/hooks/role.yaml @@ -0,0 +1,16 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "betydb.fullname" . }}-hooks + labels: + {{- include "betydb.labels" . | nindent 4 }} +rules: +- apiGroups: [""] + resources: ["pods"] + verbs: + - list + - watch + - get +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["get", "list", "watch"] \ No newline at end of file diff --git a/templates/hooks/rolebinding.yaml b/templates/hooks/rolebinding.yaml new file mode 100644 index 00000000..d69bf001 --- /dev/null +++ b/templates/hooks/rolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "betydb.fullname" . }}-hooks + labels: + {{- include "betydb.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "betydb.fullname" . }}-hooks +subjects: +- kind: ServiceAccount + name: {{ include "betydb.fullname" . }}-hooks \ No newline at end of file diff --git a/templates/hooks/serviceAccount.yaml b/templates/hooks/serviceAccount.yaml new file mode 100644 index 00000000..424d8691 --- /dev/null +++ b/templates/hooks/serviceAccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "betydb.fullname" . }}-hooks diff --git a/templates/role.yaml b/templates/role.yaml new file mode 100644 index 00000000..36b417e4 --- /dev/null +++ b/templates/role.yaml @@ -0,0 +1,21 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "betydb.fullname" . }} + labels: + {{- include "betydb.labels" . | nindent 4 }} +rules: +- apiGroups: [""] + resources: ["pods", "endpoints", "Services", "configmaps"] + verbs: + - list + - watch + - get +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - list + - watch + - get \ No newline at end of file diff --git a/templates/rolebinding.yaml b/templates/rolebinding.yaml new file mode 100644 index 00000000..31773851 --- /dev/null +++ b/templates/rolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "betydb.fullname" . }} + labels: + {{- include "betydb.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "betydb.fullname" . }} +subjects: +- kind: ServiceAccount + name: {{ include "betydb.fullname" . }} \ No newline at end of file diff --git a/templates/serviceAccount.yaml b/templates/serviceAccount.yaml new file mode 100644 index 00000000..3a3daf9b --- /dev/null +++ b/templates/serviceAccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "betydb.fullname" . }}