Class KubernetesSecretsProviderConfigurator
java.lang.Object
org.apache.pulsar.functions.secretsproviderconfigurator.KubernetesSecretsProviderConfigurator
- All Implemented Interfaces:
SecretsProviderConfigurator
public class KubernetesSecretsProviderConfigurator
extends Object
implements SecretsProviderConfigurator
This file defines the SecretsProviderConfigurator that will be used by default for running in Kubernetes.
As such this implementation is strictly when workers are configured to use kubernetes runtime.
We use kubernetes in built secrets and bind them as environment variables within the function container
to ensure that the secrets are available to the function at runtime. Then we plug in the
EnvironmentBasedSecretsConfig as the secrets provider who knows how to read these environment variables.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureKubernetesRuntimeSecretsProvider(io.kubernetes.client.openapi.models.V1PodSpec podSpec, String functionsContainerName, Function.FunctionDetails functionDetails) Attaches any secrets specific stuff to the k8 container for kubernetes runtime.voidconfigureProcessRuntimeSecretsProvider(ProcessBuilder processBuilder, Function.FunctionDetails functionDetails) Attaches any secrets specific stuff to the ProcessBuilder for process runtime.voiddoAdmissionChecks(io.kubernetes.client.openapi.apis.AppsV1Api appsV1Api, io.kubernetes.client.openapi.apis.CoreV1Api coreV1Api, String jobNamespace, String jobName, Function.FunctionDetails functionDetails) Do config checks to see whether the secrets provided are conforming.What is the type of the object that should be in the user secret config.getSecretsProviderClassName(Function.FunctionDetails functionDetails) Return the Secrets Provider Classname.getSecretsProviderConfig(Function.FunctionDetails functionDetails) Return the secrets provider config.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.functions.secretsproviderconfigurator.SecretsProviderConfigurator
init
-
Constructor Details
-
KubernetesSecretsProviderConfigurator
public KubernetesSecretsProviderConfigurator()
-
-
Method Details
-
getSecretsProviderClassName
Description copied from interface:SecretsProviderConfiguratorReturn the Secrets Provider Classname. This will be passed to the cmdline of the instance and should contain the logic of connecting with the secrets provider and obtaining secrets.- Specified by:
getSecretsProviderClassNamein interfaceSecretsProviderConfigurator
-
getSecretsProviderConfig
Description copied from interface:SecretsProviderConfiguratorReturn the secrets provider config.- Specified by:
getSecretsProviderConfigin interfaceSecretsProviderConfigurator
-
configureKubernetesRuntimeSecretsProvider
public void configureKubernetesRuntimeSecretsProvider(io.kubernetes.client.openapi.models.V1PodSpec podSpec, String functionsContainerName, Function.FunctionDetails functionDetails) Description copied from interface:SecretsProviderConfiguratorAttaches any secrets specific stuff to the k8 container for kubernetes runtime.- Specified by:
configureKubernetesRuntimeSecretsProviderin interfaceSecretsProviderConfigurator
-
configureProcessRuntimeSecretsProvider
public void configureProcessRuntimeSecretsProvider(ProcessBuilder processBuilder, Function.FunctionDetails functionDetails) Description copied from interface:SecretsProviderConfiguratorAttaches any secrets specific stuff to the ProcessBuilder for process runtime.- Specified by:
configureProcessRuntimeSecretsProviderin interfaceSecretsProviderConfigurator
-
getSecretObjectType
Description copied from interface:SecretsProviderConfiguratorWhat is the type of the object that should be in the user secret config.- Specified by:
getSecretObjectTypein interfaceSecretsProviderConfigurator- Returns:
-
doAdmissionChecks
public void doAdmissionChecks(io.kubernetes.client.openapi.apis.AppsV1Api appsV1Api, io.kubernetes.client.openapi.apis.CoreV1Api coreV1Api, String jobNamespace, String jobName, Function.FunctionDetails functionDetails) Description copied from interface:SecretsProviderConfiguratorDo config checks to see whether the secrets provided are conforming.- Specified by:
doAdmissionChecksin interfaceSecretsProviderConfigurator
-