Okay, I'll help you find a suitable container image for performing kinit tests with a Kerberos client in a Kubernetes environment.
Based on the search results, here's a breakdown of images and approaches you can consider:
1. Dedicated Kerberos Client Images:
datagovsg/kerberos-client: This is a Docker image specifically designed as a Kerberos client. It's based on https://github.com/ist-dsi/docker-kerberos[1]. You can pull it from Docker Hub using docker pull datagovsg/kerberos-client.
ist-dsi/docker-kerberos: This GitHub repository provides Docker images for both a Kerberos KDC (Key Distribution Center) and a Kerberos client. It aims to provide a simple KDC setup and a client image for testing.
maiorsi/kerberos-sidecar: This GitHub repository offers a Kerberos Sidecar Container Image for Windows Auth to Kerberized Services. It utilizes a shell script (re-kinit.sh) to initialize Kerberos using a keytab file. The image is designed to periodically re-initialize the Kerberos ticket cache.
2. Kerberos Included in Other Images:
kerberos/kerberos: This Docker image provides a complete Kerberos.io installation, which is an open-source video surveillance solution[3]. While it's a full surveillance system, it includes Kerberos components.
- Images with
krb5-user and libpam-krb5: You can create your own Dockerfile based on a standard image (like node:latest) and install the necessary Kerberos client packages (krb5-user and libpam-krb5). A snippet from Stack Overflow provides an example of this.
3. Sidecar Container Pattern:
- Helm chart for Kerberos client: The
theSaarco/krb5-helm GitHub repository provides a Helm chart that deploys a pod with two containers: a basic container and a sidecar. The sidecar is responsible for running kinit periodically and storing the Kerberos TGT in a shared memory volume[4]. This allows the main container to transparently authenticate with Kerberos[4].
- Multi-container pod with shared TGT cache: A Stack Overflow post describes a setup with a multi-container pod[5]. One container acts as a sidecar, preparing the TGT cache, and another container (the application) accesses Hadoop services using the shared cache.
Recommendations:
- For a simple Kerberos client: Start with
datagovsg/kerberos-client or build your own image using krb5-user and libpam-krb5 as described in the Stack Overflow answer.
- For testing with a KDC: Consider
ist-dsi/docker-kerberos, as it provides both client and server images.
- For Kubernetes integration and automatic ticket renewal: The
theSaarco/krb5-helm chart with the sidecar pattern is a good option. Also, review the maiorsi/kerberos-sidecar image.
Important Considerations:
- Keytab or Password: Decide whether you'll be using a keytab file or a password for authentication. The
kinit command will vary depending on your choice.
krb5.conf: Ensure the container has a properly configured /etc/krb5.conf file that points to your KDC[6].
- Shared Volumes: If using a sidecar pattern, correctly configure shared volumes for the Kerberos ticket cache[4].
- Network Connectivity: The container needs network access to reach your KDC.
- Security: Rotate Kerberos keys and passwords regularly[7].
To use any of these images, you'll typically need to:
- Pull the image:
docker pull <image_name>
- Run the image:
docker run -it <image_name> /bin/bash (or your preferred shell)
- Configure Kerberos: Modify
/etc/krb5.conf and place your keytab file (if applicable) in the container.
- Run
kinit: kinit <principal>
Remember to consult the documentation or examples associated with each image for specific instructions.