-
I have been successfully using the vault-secrets-webhook in several of my clusters for around a year. However a few days ago the webhook stopped working in one of the clusters: the pods do not contain a In the past I had a similar issues but it was intermittent and always got solved by restarting ---
apiVersion: v1
kind: Namespace
metadata:
name: deleteme
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: deleteme
function: debug
name: deleteme
namespace: deleteme
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: deleteme
function: debug
name: deleteme
namespace: deleteme
spec:
replicas: 1
selector:
matchLabels:
app: deleteme
function: debug
template:
metadata:
annotations:
vault.security.banzaicloud.io/vault-addr: http://vault.management.svc.cluster.local:8200
vault.security.banzaicloud.io/vault-path: kubernetes
vault.security.banzaicloud.io/vault-role: deleteme
vault.security.banzaicloud.io/vault-skip-verify: "true"
labels:
app: deleteme
function: debug
spec:
containers:
- env:
- name: WHOAMI_NAME
value: vault:secret/data/deleteme#PASSWORD
- name: WHOAMI_PORT_NUMBER
value: "8080"
image: traefik/whoami
name: deleteme
ports:
- containerPort: 8080
resources:
limits:
cpu: 100m
memory: 128M
requests:
cpu: 10m
memory: 64M
hostname: deleteme
serviceAccountName: deleteme # Required to retrieve secrets from Vault
---
apiVersion: v1
kind: Service
metadata:
labels:
app: deleteme
function: debug
name: deleteme
namespace: deleteme
spec:
ports:
- name: http
port: 80
targetPort: 8080
selector:
app: deleteme
function: debug
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
app: deleteme
function: debug
name: deleteme
namespace: deleteme
spec:
ingressClassName: nginx
rules:
- host: deleteme.example.net
http:
paths:
- backend:
service:
name: deleteme
port:
name: http
path: /
pathType: Prefix The Pod is created but it has no init contianer kubectl get pod -o jsonpath="{.spec['containers','initContainers'][*].name}" deleteme-657fbcb679-n9x5p
deleteme And obviously the secrets are not injected curl http://deleteme.example.net
Name: vault:secret/data/deleteme#PASSWORD
Hostname: deleteme
IP: 127.0.0.1
IP: 10.124.240.185
IP: fe80::3cc0:9bff:fe49:7129
RemoteAddr: 10.124.240.165:56126
GET / HTTP/1.1
Host: deleteme.example.net
User-Agent: curl/8.1.2
Accept: */*
X-Forwarded-For: 10.124.240.4
X-Forwarded-Host: deleteme.example.net
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Scheme: http
X-Real-Ip: 10.124.240.4
X-Scheme: http |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @Stolz, first of all, thanks for using Bank-Vaults! A couple of questions: |
Beta Was this translation helpful? Give feedback.
Hi @akijakya,
Thanks a lot for your help. In order to answer your last questions I have redeployed the chart to set
podsFailurePolicy=Fail
and that has solved the problem. I'm not sure if redeploying the chart did the trick or it was settingpodsFailurePolicy=Fail
.Since my Helm release was using the charts from the now archived Helm repo I did not try to redeploy it, I just restart it. This command allowed me to change the values of the release without upgarding the chart version
Now everything works as expected. Just in case it hels anyone having t…