<p>When I deploy the new release of the Kubernetes app I got that error</p>
<pre><code>Error: secret &quot;env&quot; not found
</code></pre>
<p><a href="https://i.stack.imgur.com/7TbF4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7TbF4.png" alt="enter image description here" /></a></p>
<p>even I have env in <strong>Custom Resource Definitions</strong> --&gt; <strong>sealedsecrets.bitnami.com</strong></p>
<p><a href="https://i.stack.imgur.com/BMtg4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BMtg4.png" alt="enter image description here" /></a></p>
<p><strong>env.yaml</strong></p>
<pre><code>apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
  creationTimestamp: null
  name: env
  namespace: api
spec:
  encryptedData:
    AUTH_COGNITO: AgCIxZX0Zv6gcK2p ----
template:
    metadata:
      creationTimestamp: null
      name: env
      namespace: api
    type: Opaque
</code></pre>
<p><strong>deployment.yaml</strong></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
  labels:
    app: {{ .Release.Name }}
spec:
  revisionHistoryLimit: 2
  replicas: {{ .Values.replicas }}
  selector:
    matchLabels:
      app: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Release.Name }}
          image: &quot;{{ .Values.imageRepository }}:{{ .Values.tag }}&quot;
          env:
            {{- include &quot;api.env&quot; . | nindent 12 }}
          resources:
            limits:
              memory: {{ .Values.memoryLimit }}
              cpu: {{ .Values.cpuLimit }}
            requests:
              memory: {{ .Values.memoryRequest }}
              cpu: {{ .Values.cpuRequest }}
          {{- if .Values.healthCheck }}
          livenessProbe:
            httpGet:
              path: /healthcheck
              port: 4000
            initialDelaySeconds: 3
            periodSeconds: 3
            timeoutSeconds: 3
          {{- end }}
      imagePullSecrets:
        - name: {{ .Values.imagePullSecret }}      
      {{- if .Values.tolerations }}
      tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
      {{- end }}
      {{- if .Values.nodeSelector }}
      nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
      {{- end }}
</code></pre>
<p><strong>UPDATE to my question</strong>
my secrets I don't have secret called <code>env</code></p>
<p>plus that error in <code>regcred</code> inside <code>Sealedsecrets.bitnami.com</code></p>
<pre><code>Failed to unseal: no key could decrypt secret (.dockerconfigjson)
</code></pre>
<p><a href="https://i.stack.imgur.com/zfiAo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zfiAo.png" alt="enter image description here" /></a></p>

<p>You ran <code>kubeseal</code> against the wrong Kubernetes cluster or you tried to edit the name or namespace after encrypting without enabling those in the encryption mode. More likely the first.</p>
