My use case is that I want to mount /etc/ssl/certs for each pod inside a namespace in order to use a custom CA easily. It would be great to take the requested annotation from the namespace (as a default annotation). For example:
apiVersion: v1
kind: Namespace
metadata:
name: test
annotations:
k8s-sidecar-injector/default-request: etc-ssl-certs <--- Applies to every pod in the namespace
...
---
apiVersion: v1
kind: Pod
metadata:
name: demo-pod
namespace: test
annotations: {} <--- No request but default-request is applied
spec:
...
I think the affected lines would be these:
|
requestedInjection, ok := annotations[requestAnnotationKey] |
|
if !ok { |
|
glog.Infof("Pod %s/%s annotation %s is missing, skipping injection", metadata.Namespace, metadata.Name, requestAnnotationKey) |
|
return "", ErrMissingRequestAnnotation |
|
} |
My use case is that I want to mount /etc/ssl/certs for each pod inside a namespace in order to use a custom CA easily. It would be great to take the requested annotation from the namespace (as a default annotation). For example:
I think the affected lines would be these:
k8s-sidecar-injector/pkg/server/webhook.go
Lines 163 to 167 in 85bf83c