-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can the CSI side car image be hosted in a private repository and referenced, for security purpose. #63
Comments
Any updates on this ? |
For now we do not support private sidecar container images. The CSI driver will check if the sidecar container image uses the registry |
@songjiaxun we actually run in the same issue and even considered patching the driver itself. None of our images are pulled from remote and all images GKE manages don't create an issue in our side as no other image than this is running in customer namespace |
Hi @Siegfriedk and @ashish01987 , can I learn more about your use cases? It seems like you are OK with the GKE managed images in the |
@songjiaxun yes. Customer namespaces have gatekeeper policies in place to make sure no external images are getting pulled. And we also make sure that system critical things are coming from our local registry (gcr) after scanning. |
Any plan to add support for this ? |
Hi @ashish01987 , @Siegfriedk the support to allow the webhook to inject a sidecar consuming a customized container image has a lower priority, unfortunately. I'd like to learn more about the workflow here, so I am proposing a workflow here as a workaround. And if this works for your use case, I can make the change real quick.
Please let me know your thoughts, thank you! |
@songjiaxun that would be great, we already thought about patching it ourselves |
"In your workload, you manually inject the sidecar container using the private container image. GKE will provide guidance for you to do this." |
I am trying to propose to add a new pod annotation to allow you specify a private sidecar container image. But I have to go through some internal security review. Will keep you posted. Thanks! |
Hi @Siegfriedk , @ashish01987 I got a response from our GKE security team -- users will need to manually inject the sidecar spec using the private images. Please refer to this comment as an example. When we support this pattern, we will update the official documentation to support manual sidecar injection. Thank you! |
We finalized the workflow as the following. @Siegfriedk , @ashish01987 please let me know if this looks good to you
apiVersion: v1
kind: Pod
metadata:
name: my_pod
namespace: my_namespace
annotations:
gke-gcsfuse/volumes: "true" # required
spec:
containers:
- name: gke-gcsfuse-sidecar # <- manually injected
image: private-registry/gcs-fuse-csi-driver-sidecar-mounter:my-tag
- image: nginx
name: nginx
volumeMounts:
- name: gcp-cloud-storage-csi-ephemeral
mountPath: /data
serviceAccountName: my_k8s_sa
volumes:
- name: gcp-cloud-storage-csi-ephemeral
csi:
driver: gcsfuse.csi.storage.gke.io
volumeAttributes:
bucketName: my-bucket-name
|
Thanks @songjiaxun. Looks good to me. |
To be clear, our proposal will "partially" inject the sidecar container. The webhook only reads the sidecar container from your sidecar container spec and ignores other customization, and prepare for the rest of the sidecar container. The sidecar container has to be at the "0" index in container list. Even though you specified the sidecar container at non-0 index, as long as you have the pod annotation In order to completely manually inject the sidecar container, you can remove the Pod annotation Also, FYI, we are working on adopting the native k8s sidecar container feature, targeting GKE 1.29. By then, the sidecar container will be injected as an init container. |
Thanks This answers my question. As long as the injection pattern remains same as earlier, i dont see this as any breaking change. |
In our deployment we might have several pod deployments who want to push their file system data to GCS through the csi driver, for DR purpose.
And the your webhooks should bring the sidecar container to 0th position at runtime. I guess this approach should work. |
Any tentative timeline when official documentation is available for this approach ? |
@ashish01987 , the release is still in progress. When the release is done, I will update the official documentation. ETA is 2024-01-25. |
The roll out was completed. Updated the doc: https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver#private-image And please refer to the requirements to upgrade your cluster to the required versions: |
Some organizations may not allow to pull images from public reporsitory directly into the cluster. May be they prefer to host it privately and do regular security scans.
is it possible to host gke.gcr.io/gcs-fuse-csi-driver-sidecar-mounter:v0.1.4-gke.1@sha256:442969f1e565ba63ff22837ce7a530b6cbdb26330140b7f9e1dc23f53f1df335 privately and side car reference to private repository ?
The text was updated successfully, but these errors were encountered: