Class KubernetesCredentialFactory

java.lang.Object
org.frankframework.credentialprovider.KubernetesCredentialFactory
All Implemented Interfaces:
ICredentialFactory

public class KubernetesCredentialFactory extends Object implements ICredentialFactory

CredentialFactory for Kubernetes Credentials. Fetches credentials from Kubernetes secrets.

The credentials are stored in Kubernetes secrets, which are base64 encoded. The keys used for the secrets are "username" and "password".

The `KubernetesCredentialFactory` class uses several properties to configure its behavior. These properties are set in the credentialproperties.properties file and are used to customize the connection to the Kubernetes cluster and the namespace from which secrets are fetched. Here's a description of the properties:

  • credentialFactory.kubernetes.username - the username for authenticating with the Kubernetes cluster
  • credentialFactory.kubernetes.password - the password for authenticating with the Kubernetes cluster
  • credentialFactory.kubernetes.masterUrl - the master URL of the Kubernetes cluster
  • credentialFactory.kubernetes.namespace - the namespace from which secrets should be fetched (default value: 'default')

Example configuration:


 credentialFactory.kubernetes.username=admin
 credentialFactory.kubernetes.password=example-password
 credentialFactory.kubernetes.masterUrl=http://localhost:8080
 credentialFactory.kubernetes.namespace=my-namespace
 

By setting these properties, you can control how the `KubernetesCredentialFactory` interacts with the Kubernetes cluster and retrieves credentials.

Adding a Kubernetes secret can be done by executing:


 kubectl create secret generic db-alias-name \
 --from-literal=username=admin --from-literal=password='example-password'