<p>I am trying to install loki with helm</p>
<pre><code>$ helm upgrade --install loki grafana/loki-stack
</code></pre>
<p>I got the following error msg:</p>
<pre><code>Release &quot;loki&quot; does not exist. Installing it now.

Error: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource: podsecuritypolicies.policy &quot;loki&quot; is forbidden: User &quot;secret user :)&quot; cannot get resource &quot;podsecuritypolicies&quot; in API group &quot;policy&quot; at the cluster scope

$ helm list -all

NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART   APP VERSION
</code></pre>
<p>I'm a simple user, but I can make deployment/pods via yaml files manual.
I need to use helm charts.</p>

<p>It seems that your User has insufficient privileges to create policies. You need to ask your cluster administrator for more privileges, unless you can assign them yourself to this user. I'm providing example yaml below to achieve that. First, create ClusterRole with proper privileges:</p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: &lt;role name&gt;
rules:
- apiGroups: ['policy']
  resources: ['podsecuritypolicies']
  verbs:     ['get']
</code></pre>
<p>Then, you need to bind this ClusterRole to user(s):</p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: &lt;binding name&gt;
roleRef:
  kind: ClusterRole
  name: &lt;role name&gt;
  apiGroup: rbac.authorization.k8s.io
subjects:
# Authorize all service accounts in a namespace (recommended):
- kind: Group
  apiGroup: rbac.authorization.k8s.io
  name: system:serviceaccounts:&lt;authorized namespace&gt;
# Authorize specific service accounts (not recommended):
- kind: ServiceAccount
  name: &lt;authorized service account name&gt;
  namespace: &lt;authorized pod namespace&gt;
# Authorize specific users (not recommended):
- kind: User
  apiGroup: rbac.authorization.k8s.io
  name: &lt;authorized user name&gt;
</code></pre>
<p>Go <a href="https://kubernetes.io/docs/concepts/policy/pod-security-policy/#enabling-pod-security-policies" rel="nofollow noreferrer">here</a> for more detailed explanation.</p>
