Class KubernetesConfigMapRemoteConfigurationSource<T>
java.lang.Object
io.confluent.security.audit.telemetry.exporter.config.remote.polling.PollingRemoteConfigurationSource<T>
io.confluent.security.audit.telemetry.exporter.config.remote.polling.kubernetes.KubernetesConfigMapRemoteConfigurationSource<T>
- All Implemented Interfaces:
ICallbackResponse,RemoteConfigurationSource<T>,org.apache.kafka.common.security.oauthbearer.internals.secured.Retryable<T>
public class KubernetesConfigMapRemoteConfigurationSource<T>
extends PollingRemoteConfigurationSource<T>
implements org.apache.kafka.common.security.oauthbearer.internals.secured.Retryable<T>, ICallbackResponse
This RemoteConfigurationSource will continuously poll the Kubernetes API for a ConfigMap containing the
RemoteConfiguration object. It will do this by first querying for a ConfigMap with the same name as the cluster.
If that ConfigMap does not exist, then it will use the one configured by CONFIG_MAP_NAME_CONFIG.
We do this in break glass scenarios (incident remediation) where we need to remotely configure a single cluster
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKubernetesConfigMapRemoteConfigurationSource(KubernetesConfigMapRemoteConfigurationConfig config, Optional<String> physicalClusterId, Consumer<T> callback, Class<T> typeParameterClass) -
Method Summary
Modifier and TypeMethodDescriptioncall()static Stringstatic StringcreateEndpointFromEnv(KubernetesConfigMapRemoteConfigurationConfig config, String configMapName) org.apache.kafka.common.metrics.SensorgetOrCreateWatcherSensor(String sensorName, Map<String, String> tags) voidvoidvoidrecordWatcherMetric(String metricType, String path, int responseCode) voidsetMetrics(org.apache.kafka.common.metrics.Metrics metrics) Methods inherited from class io.confluent.security.audit.telemetry.exporter.config.remote.polling.PollingRemoteConfigurationSource
getConfig, setConfigurationChangeCallback, start, stop
-
Field Details
-
DEFAULT_RESOURCE_WATCHER_RETRY_COUNT
public static final int DEFAULT_RESOURCE_WATCHER_RETRY_COUNT- See Also:
-
HTTP_CONNECTION_TIMEOUT_MS
public static final int HTTP_CONNECTION_TIMEOUT_MS- See Also:
-
HTTP_READ_TIMEOUT_MS
public static final int HTTP_READ_TIMEOUT_MS- See Also:
-
METRIC_NAME
- See Also:
-
GROUP_NAME
- See Also:
-
-
Constructor Details
-
KubernetesConfigMapRemoteConfigurationSource
public KubernetesConfigMapRemoteConfigurationSource(KubernetesConfigMapRemoteConfigurationConfig config, Optional<String> physicalClusterId, Consumer<T> callback, Class<T> typeParameterClass) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, KeyManagementException
-
-
Method Details
-
call
public T call() throws ExecutionException, org.apache.kafka.common.security.oauthbearer.internals.secured.UnretryableException- Specified by:
callin interfaceorg.apache.kafka.common.security.oauthbearer.internals.secured.Retryable<T>- Throws:
ExecutionExceptionorg.apache.kafka.common.security.oauthbearer.internals.secured.UnretryableException
-
setMetrics
public void setMetrics(org.apache.kafka.common.metrics.Metrics metrics) -
recordWatcherMetric
-
getOrCreateWatcherSensor
-
createEndpointFromEnv
public static String createEndpointFromEnv(KubernetesConfigMapRemoteConfigurationConfig config, String configMapName) -
createDefaultEndpointFromEnv
public static String createDefaultEndpointFromEnv(KubernetesConfigMapRemoteConfigurationConfig config) -
getResourceMetadata
-
onCallbackSuccess
public void onCallbackSuccess()- Specified by:
onCallbackSuccessin interfaceICallbackResponse
-
onCallbackFailure
- Specified by:
onCallbackFailurein interfaceICallbackResponse
-