[POLICY] Update chart with service account

Add service account to requirements.yaml, values.yaml and
deployment/statefulset

Issue-ID: OOM-2725
Signed-off-by: farida azmy <farida.azmy.ext@orange.com>
Co-authored-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I67c689d65ff004c3919256449d0bfaf976514a93
diff --git a/kubernetes/policy/components/policy-apex-pdp/requirements.yaml b/kubernetes/policy/components/policy-apex-pdp/requirements.yaml
index 1c57aa4..f320b21 100755
--- a/kubernetes/policy/components/policy-apex-pdp/requirements.yaml
+++ b/kubernetes/policy/components/policy-apex-pdp/requirements.yaml
@@ -27,3 +27,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-apex-pdp/templates/statefulset.yaml b/kubernetes/policy/components/policy-apex-pdp/templates/statefulset.yaml
index 586f468..4d9ff92 100755
--- a/kubernetes/policy/components/policy-apex-pdp/templates/statefulset.yaml
+++ b/kubernetes/policy/components/policy-apex-pdp/templates/statefulset.yaml
@@ -115,6 +115,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
 {{ include "common.certInitializer.volumes" . | indent 8 }}
         - name: localtime
diff --git a/kubernetes/policy/components/policy-apex-pdp/values.yaml b/kubernetes/policy/components/policy-apex-pdp/values.yaml
index aa1daf7..eb6292a 100755
--- a/kubernetes/policy/components/policy-apex-pdp/values.yaml
+++ b/kubernetes/policy/components/policy-apex-pdp/values.yaml
@@ -133,3 +133,9 @@
       cpu: 20m
       memory: 2Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-apex-pdp
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-api/requirements.yaml b/kubernetes/policy/components/policy-api/requirements.yaml
index 7bc531a..2365cd7 100755
--- a/kubernetes/policy/components/policy-api/requirements.yaml
+++ b/kubernetes/policy/components/policy-api/requirements.yaml
@@ -26,3 +26,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-api/templates/deployment.yaml b/kubernetes/policy/components/policy-api/templates/deployment.yaml
index 899e74e..de0558e 100755
--- a/kubernetes/policy/components/policy-api/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-api/templates/deployment.yaml
@@ -107,6 +107,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
 {{ include "common.certInitializer.volumes" . | indent 8 }}
         - name: localtime
diff --git a/kubernetes/policy/components/policy-api/values.yaml b/kubernetes/policy/components/policy-api/values.yaml
index da983e5..36eb5c4 100755
--- a/kubernetes/policy/components/policy-api/values.yaml
+++ b/kubernetes/policy/components/policy-api/values.yaml
@@ -143,3 +143,9 @@
       cpu: 200m
       memory: 2Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-api
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-clamp-be/requirements.yaml b/kubernetes/policy/components/policy-clamp-be/requirements.yaml
index 88fd9d9..670f8cb 100644
--- a/kubernetes/policy/components/policy-clamp-be/requirements.yaml
+++ b/kubernetes/policy/components/policy-clamp-be/requirements.yaml
@@ -20,3 +20,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-clamp-be/templates/deployment.yaml b/kubernetes/policy/components/policy-clamp-be/templates/deployment.yaml
index c243e30..e61cca0 100644
--- a/kubernetes/policy/components/policy-clamp-be/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-clamp-be/templates/deployment.yaml
@@ -114,6 +114,7 @@
         {{- if .Values.affinity }}
         affinity: {{ toYaml .Values.affinity | nindent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: {{ include "common.fullname" . }}-config
           configMap:
diff --git a/kubernetes/policy/components/policy-clamp-be/values.yaml b/kubernetes/policy/components/policy-clamp-be/values.yaml
index 71d2517..dcbe59c 100644
--- a/kubernetes/policy/components/policy-clamp-be/values.yaml
+++ b/kubernetes/policy/components/policy-clamp-be/values.yaml
@@ -156,3 +156,9 @@
       cpu: 10m
       memory: 3Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-clamp-be
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-clamp-fe/requirements.yaml b/kubernetes/policy/components/policy-clamp-fe/requirements.yaml
index 88fd9d9..670f8cb 100644
--- a/kubernetes/policy/components/policy-clamp-fe/requirements.yaml
+++ b/kubernetes/policy/components/policy-clamp-fe/requirements.yaml
@@ -20,3 +20,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-clamp-fe/templates/deployment.yaml b/kubernetes/policy/components/policy-clamp-fe/templates/deployment.yaml
index 97c7919..1349558 100644
--- a/kubernetes/policy/components/policy-clamp-fe/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-clamp-fe/templates/deployment.yaml
@@ -91,6 +91,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: {{ include "common.fullname" . }}-config
           configMap:
diff --git a/kubernetes/policy/components/policy-clamp-fe/values.yaml b/kubernetes/policy/components/policy-clamp-fe/values.yaml
index 9712a38..a7c8d6d 100644
--- a/kubernetes/policy/components/policy-clamp-fe/values.yaml
+++ b/kubernetes/policy/components/policy-clamp-fe/values.yaml
@@ -146,3 +146,9 @@
       cpu: 10m
       memory: 50Mi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-clamp-fe
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-distribution/requirements.yaml b/kubernetes/policy/components/policy-distribution/requirements.yaml
index 0006e49..db84102 100755
--- a/kubernetes/policy/components/policy-distribution/requirements.yaml
+++ b/kubernetes/policy/components/policy-distribution/requirements.yaml
@@ -27,3 +27,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-distribution/templates/deployment.yaml b/kubernetes/policy/components/policy-distribution/templates/deployment.yaml
index 04db6d7..4745aac 100755
--- a/kubernetes/policy/components/policy-distribution/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-distribution/templates/deployment.yaml
@@ -121,6 +121,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
 {{ include "common.certInitializer.volumes" . | indent 8 }}
         - name: localtime
diff --git a/kubernetes/policy/components/policy-distribution/values.yaml b/kubernetes/policy/components/policy-distribution/values.yaml
index 6788613..fb6ef6e 100755
--- a/kubernetes/policy/components/policy-distribution/values.yaml
+++ b/kubernetes/policy/components/policy-distribution/values.yaml
@@ -155,3 +155,9 @@
       cpu: 200m
       memory: 2Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-distribution
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-drools-pdp/requirements.yaml b/kubernetes/policy/components/policy-drools-pdp/requirements.yaml
index 29b1053..6c540a4 100755
--- a/kubernetes/policy/components/policy-drools-pdp/requirements.yaml
+++ b/kubernetes/policy/components/policy-drools-pdp/requirements.yaml
@@ -23,3 +23,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-drools-pdp/templates/statefulset.yaml b/kubernetes/policy/components/policy-drools-pdp/templates/statefulset.yaml
index 7e9c6cf..d389246 100755
--- a/kubernetes/policy/components/policy-drools-pdp/templates/statefulset.yaml
+++ b/kubernetes/policy/components/policy-drools-pdp/templates/statefulset.yaml
@@ -125,6 +125,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
 {{ include "common.certInitializer.volumes" . | indent 8 }}
         - name: localtime
diff --git a/kubernetes/policy/components/policy-drools-pdp/values.yaml b/kubernetes/policy/components/policy-drools-pdp/values.yaml
index 4eb37c6..38d3989 100755
--- a/kubernetes/policy/components/policy-drools-pdp/values.yaml
+++ b/kubernetes/policy/components/policy-drools-pdp/values.yaml
@@ -188,3 +188,9 @@
       cpu: 200m
       memory: 2Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-drools-pdp
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-nexus/requirements.yaml b/kubernetes/policy/components/policy-nexus/requirements.yaml
index 343812d..20cc48f 100755
--- a/kubernetes/policy/components/policy-nexus/requirements.yaml
+++ b/kubernetes/policy/components/policy-nexus/requirements.yaml
@@ -23,3 +23,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-nexus/templates/deployment.yaml b/kubernetes/policy/components/policy-nexus/templates/deployment.yaml
index 3d5d59f..4c945f4 100755
--- a/kubernetes/policy/components/policy-nexus/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-nexus/templates/deployment.yaml
@@ -83,6 +83,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "nothing" "dot" . )}}
       volumes:
         - name: localtime
           hostPath:
diff --git a/kubernetes/policy/components/policy-nexus/values.yaml b/kubernetes/policy/components/policy-nexus/values.yaml
index 7801b52..3d77e67 100755
--- a/kubernetes/policy/components/policy-nexus/values.yaml
+++ b/kubernetes/policy/components/policy-nexus/values.yaml
@@ -92,3 +92,9 @@
       cpu: 2m
       memory: 1Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-nexus
+  roles:
+    - nothing
diff --git a/kubernetes/policy/components/policy-pap/requirements.yaml b/kubernetes/policy/components/policy-pap/requirements.yaml
index 3f0071a..18de3a6 100755
--- a/kubernetes/policy/components/policy-pap/requirements.yaml
+++ b/kubernetes/policy/components/policy-pap/requirements.yaml
@@ -27,3 +27,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-pap/templates/deployment.yaml b/kubernetes/policy/components/policy-pap/templates/deployment.yaml
index a02752c..77474a8 100755
--- a/kubernetes/policy/components/policy-pap/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-pap/templates/deployment.yaml
@@ -122,6 +122,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
 {{ include "common.certInitializer.volumes" . | indent 8 }}
         - name: localtime
diff --git a/kubernetes/policy/components/policy-pap/values.yaml b/kubernetes/policy/components/policy-pap/values.yaml
index 18e0e3e..3c4c3e5 100755
--- a/kubernetes/policy/components/policy-pap/values.yaml
+++ b/kubernetes/policy/components/policy-pap/values.yaml
@@ -169,3 +169,9 @@
       cpu: 200m
       memory: 2Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-pap
+  roles:
+    - read
diff --git a/kubernetes/policy/components/policy-xacml-pdp/requirements.yaml b/kubernetes/policy/components/policy-xacml-pdp/requirements.yaml
index 7bc531a..2365cd7 100755
--- a/kubernetes/policy/components/policy-xacml-pdp/requirements.yaml
+++ b/kubernetes/policy/components/policy-xacml-pdp/requirements.yaml
@@ -26,3 +26,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/components/policy-xacml-pdp/templates/deployment.yaml b/kubernetes/policy/components/policy-xacml-pdp/templates/deployment.yaml
index 73ae6dd..2da0035 100755
--- a/kubernetes/policy/components/policy-xacml-pdp/templates/deployment.yaml
+++ b/kubernetes/policy/components/policy-xacml-pdp/templates/deployment.yaml
@@ -131,6 +131,7 @@
         affinity:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
 {{ include "common.certInitializer.volumes" . | indent 8 }}
         - name: localtime
diff --git a/kubernetes/policy/components/policy-xacml-pdp/values.yaml b/kubernetes/policy/components/policy-xacml-pdp/values.yaml
index 64c00e9..9eda53e 100755
--- a/kubernetes/policy/components/policy-xacml-pdp/values.yaml
+++ b/kubernetes/policy/components/policy-xacml-pdp/values.yaml
@@ -152,3 +152,9 @@
       cpu: 200m
       memory: 2Gi
   unlimited: {}
+
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy-xacml-pdp
+  roles:
+    - read
diff --git a/kubernetes/policy/requirements.yaml b/kubernetes/policy/requirements.yaml
index 33447a2..c98d4fc 100755
--- a/kubernetes/policy/requirements.yaml
+++ b/kubernetes/policy/requirements.yaml
@@ -59,3 +59,6 @@
   - name: repositoryGenerator
     version: ~8.x-0
     repository: '@local'
+  - name: serviceAccount
+    version: ~8.x-0
+    repository: '@local'
diff --git a/kubernetes/policy/templates/job.yaml b/kubernetes/policy/templates/job.yaml
index ad19572..72c94f3 100755
--- a/kubernetes/policy/templates/job.yaml
+++ b/kubernetes/policy/templates/job.yaml
@@ -72,6 +72,7 @@
         resources:
 {{ include "common.resources" . }}
       restartPolicy: Never
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes:
         - name: {{ include "common.fullname" . }}-config
           configMap:
diff --git a/kubernetes/policy/values.yaml b/kubernetes/policy/values.yaml
index 678772c..92344dd 100755
--- a/kubernetes/policy/values.yaml
+++ b/kubernetes/policy/values.yaml
@@ -148,3 +148,8 @@
       memory: 2Gi
   unlimited: {}
 
+#Pods Service Account
+serviceAccount:
+  nameOverride: policy
+  roles:
+    - read