As described in CR SidecarGateway, the podSelector
selects the Pods to which the CustomResource SidecarGateway
should be applied.
Two different SidecarGateway
CRs might point to the same Pod. That is an invalid configuration and could be detected as follows:
- List the
SidecarGateway
CustomResources - The status
Error
indicates that something is wrong. - Use
kubectl describe sidecargateways.microgateway.airlock.com
to inspect the status. - Adjust the existing
SidecarGateway
CustomResources which point to the same Pod. - The status of the
SidecarGateway
CRs has changed toActive
.
kubectl get sidecargateways.microgateway.airlock.com NAME STATUS AGE webapp Active 140m webapp2 Error 21m
kubectl describe sidecargateways.microgateway.airlock.com webapp2 ... ... Status: Conditions: Last Transition Time: 2022-09-13T14:55:26Z Status: True Type: ConfigReferencesLoaded Last Transition Time: 2022-09-13T14:55:26Z Message: The Pod 'webapp-84b785f954-r49wt' is already owned by the SidecarGateway 'webapp' Reason: PodAlreadyOwned Status: False Type: PodsSelected Last Transition Time: 2022-09-13T14:55:26Z Status: True Type: EnvoyConfigSynced Pods: Envoy Config: webapp-84b785f954-r49wt Name: webapp-84b785f954-r49wt Status: Error Events: <none>
The Status.Conditions.Message
field contains the reason for the issue and says, that already another SidecarGateway is configuring the same Pod.