<@U04S8PLJWMT> trying to set a new mssql source on...
# ask-ai
a
@kapa.ai trying to set a new mssql source on a kubernetes installation but getting Internal message: io.airbyte.workload.launcher.pipeline.stages.model.StageError: io.airbyte.workers.exception.KubeClientException: Failed to create pod source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj. at io.airbyte.workload.launcher.pipeline.stages.model.Stage.apply(Stage.kt:49) at io.airbyte.workload.launcher.pipeline.stages.LaunchPodStage.apply(LaunchPodStage.kt:40) at io.airbyte.workload.launcher.pipeline.stages.$LaunchPodStage$Definition$Intercepted.$$access$$apply(Unknown Source) at io.airbyte.workload.launcher.pipeline.stages.$LaunchPodStage$Definition$Exec.dispatch(Unknown Source) at io.micronaut.context.AbstractExecutableMethodsDefinition$DispatchedExecutableMethod.invoke(AbstractExecutableMethodsDefinition.java:456) at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:134) at io.airbyte.metrics.interceptors.InstrumentInterceptorBase.doIntercept(InstrumentInterceptorBase.kt:65) at io.airbyte.metrics.interceptors.InstrumentInterceptorBase.intercept(InstrumentInterceptorBase.kt:48) at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:143) at io.airbyte.workload.launcher.pipeline.stages.$LaunchPodStage$Definition$Intercepted.apply(Unknown Source) at io.airbyte.workload.launcher.pipeline.stages.LaunchPodStage.apply(LaunchPodStage.kt:28) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:132) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158) at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2570) at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2366) at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onSubscribe(FluxOnErrorResume.java:74) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:193) at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53) at reactor.core.publisher.Mono.subscribe(Mono.java:4560) at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:430) at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:446) at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:533) at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: io.airbyte.workers.exception.KubeClientException: Failed to create pod source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj. at io.airbyte.workload.launcher.pods.KubePodClient.launchConnectorWithSidecar$io_airbyte_airbyte_workload_launcher(KubePodClient.kt:258) at io.airbyte.workload.launcher.pods.KubePodClient.launchCheck(KubePodClient.kt:194) at io.airbyte.workload.launcher.pipeline.stages.LaunchPodStage.applyStage(LaunchPodStage.kt:50) at io.airbyte.workload.launcher.pipeline.stages.LaunchPodStage.applyStage(LaunchPodStage.kt:28) at io.airbyte.workload.launcher.pipeline.stages.model.Stage.apply(Stage.kt:45) ... 44 more Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PATCH at: https://172.40.0.1:443/api/v1/namespaces/airbyte/pods/source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj?fieldManager=fabric8. Message: pods "source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (containers "init", "connector-sidecar", "main" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "init", "connector-sidecar", "main" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "init", "connector-sidecar", "main" must set securityContext.runAsNonRoot=true). Received status: Status(apiVersion=v1, code=403, details=StatusDetails(causes=[], group=null, kind=pods, name=source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=pods "source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (containers "init", "connector-sidecar", "main" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "init", "connector-sidecar", "main" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "init", "connector-sidecar", "main" must set securityContext.runAsNonRoot=true), metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Forbidden, status=Failure, additionalProperties={}). at io.fabric8.kubernetes.client.KubernetesClientException.copyAsCause(KubernetesClientException.java:205) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.waitForResult(OperationSupport.java:507) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.handleResponse(OperationSupport.java:524) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.handlePatch(OperationSupport.java:419) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.handlePatch(OperationSupport.java:397) at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.handlePatch(BaseOperation.java:764) at io.fabric8.kubernetes.client.dsl.internal.HasMetadataOperation.lambda$patch$2(HasMetadataOperation.java:231) at io.fabric8.kubernetes.client.dsl.internal.HasMetadataOperation.patch(HasMetadataOperation.java:236) at io.fabric8.kubernetes.client.dsl.internal.HasMetadataOperation.patch(HasMetadataOperation.java:251) at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.serverSideApply(BaseOperation.java:1179) at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.serverSideApply(BaseOperation.java:98) at io.airbyte.workload.launcher.pods.KubePodLauncher.create$lambda$0(KubePodLauncher.kt:58) at io.airbyte.workload.launcher.pods.KubePodLauncher$runKubeCommand$1.get(KubePodLauncher.kt:324) at dev.failsafe.Functions.lambda$toCtxSupplier$11(Functions.java:243) at dev.failsafe.Functions.lambda$get$0(Functions.java:46) at dev.failsafe.internal.RetryPolicyExecutor.lambda$apply$0(RetryPolicyExecutor.java:74) at dev.failsafe.SyncExecutionImpl.executeSync(SyncExecutionImpl.java:187) at dev.failsafe.FailsafeExecutor.call(FailsafeExecutor.java:376) at dev.failsafe.FailsafeExecutor.get(FailsafeExecutor.java:112) at io.airbyte.workload.launcher.pods.KubePodLauncher.runKubeCommand(KubePodLauncher.kt:322) at io.airbyte.workload.launcher.pods.KubePodLauncher.create(KubePodLauncher.kt:52) at io.airbyte.workload.launcher.pods.KubePodClient.launchConnectorWithSidecar$io_airbyte_airbyte_workload_launcher(KubePodClient.kt:255) ... 48 more Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PATCH at: https://172.40.0.1:443/api/v1/namespaces/airbyte/pods/source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj?fieldManager=fabric8. Message: pods "source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (containers "init", "connector-sidecar", "main" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "init", "connector-sidecar", "main" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "init", "connector-sidecar", "main" must set securityContext.runAsNonRoot=true). Received status: Status(apiVersion=v1, code=403, details=StatusDetails(causes=[], group=null, kind=pods, name=source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=pods "source-mssql-check-e355f24f-2a78-4e57-9617-a22c4a57fcae-0-tfiuj" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (containers "init", "connector-sidecar", "main" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "init", "connector-sidecar", "main" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "init", "connector-sidecar", "main" must set securityContext.runAsNonRoot=true), metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Forbidden, status=Failure, additionalProperties={}). at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.requestFailure(OperationSupport.java:642) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.requestFailure(OperationSupport.java:622) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.assertResponseCode(OperationSupport.java:582) at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.lambda$handleResponse$0(OperationSupport.java:549) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) at io.fabric8.kubernetes.client.http.StandardHttpClient.lambda$completeOrCancel$10(StandardHttpClient.java:141) at ... why?
k
The error you are seeing is due to your Kubernetes cluster enforcing the "restricted" PodSecurity policy, which requires certain security settings on all containers in a pod. Specifically, the error message states: > violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (containers "init", "connector-sidecar", "main" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "init", "connector-sidecar", "main" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "init", "connector-sidecar", "main" must set securityContext.runAsNonRoot=true) This means that your Airbyte deployment (and its connector pods) must explicitly set the following in the pod/container securityContext: -
allowPrivilegeEscalation: false
-
capabilities.drop: ["ALL"]
-
runAsNonRoot: true
If these are not set, Kubernetes will reject the pod creation with a 403 Forbidden error, as you are experiencing. How to fix: You need to update your Airbyte Helm chart or Kubernetes manifests to ensure that all containers (including
init
,
connector-sidecar
, and
main
) have the required securityContext settings. This is a common requirement in clusters with strict PodSecurity policies enabled. For example, your container spec should include:
Copy code
yaml securityContext:   allowPrivilegeEscalation: false   runAsNonRoot: true   capabilities:     drop:       - ALL
Apply this to all relevant containers in your Airbyte deployment. This issue is not unique to the MSSQL connector; it can affect any connector or pod Airbyte tries to launch if the securityContext is not compliant with your cluster's PodSecurity policy. Similar issues have been reported and discussed in the Airbyte community and GitHub issues, confirming this root cause and solution [see related issue](https://github.com/airbytehq/airbyte/issues/44443). If you are using the official Airbyte Helm chart, check for recent updates or open issues regarding PodSecurity policies, as newer versions may have added support for these settings. Summary: Your Airbyte pods are being blocked by Kubernetes PodSecurity policies. Update your pod/container securityContext to comply with the "restricted" policy as described above to resolve the issue.
a
@kapa.ai how do i override this security context for the connector sidecar container?
k
A message from kapa.ai
Based on the provided knowledge sources, there is no explicit documentation or Helm chart value shown for directly overriding the security context of the connector sidecar container in Airbyte. The available Helm chart snippets and configuration examples detail how to set security contexts for main components (such as
worker
,
webapp
,
workload-launcher
, and
connector-builder-server
), but do not mention a specific override for the connector sidecar container itself. If you need to override the security context for the connector sidecar, and the Helm chart does not expose this as a configurable value, a common workaround (as mentioned for other environment variables) is to build a custom Docker image or modify the deployment manifests directly. However, the knowledge sources do not provide a step-by-step guide or a supported method for this specific case. Summary: I'm sorry, but the knowledge sources do not contain enough information to provide a definitive answer on how to override the security context for the connector sidecar container in Airbyte. You may need to consult the official Airbyte documentation or open an issue with the Airbyte team for further guidance.