Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add fields in job template for KeycloakRealmImport CR #14504

Closed
aamoyel opened this issue Sep 20, 2022 · 2 comments
Closed

Ability to add fields in job template for KeycloakRealmImport CR #14504

aamoyel opened this issue Sep 20, 2022 · 2 comments
Labels
kind/enhancement Categorizes a PR related to an enhancement
Milestone

Comments

@aamoyel
Copy link

aamoyel commented Sep 20, 2022

Description

Like "Keycloak" CR, to add custom labels, annotations and other keys/values, we need an "unsupported" field in "KeycloakRealmImport" CR.

Discussion

No response

Motivation

I've deployed keycloak operator and instance in a namespace with Istio enabled and everything is working correctly. My problem is when i create a "KeycloakRealmImport", the operator create a job pod with the istio sidecar proxy because of istio auto injection.
The Istio sidecar leads to a stucking running job because of the proxy never ends.
Istio gives the ability to disable injection with this annotation: 'sidecar.istio.io/inject: “false”' but we cannot add metadata in realmImport like "Keycloak" CR.

Details

Stucking pod:

NAME                                     READY   STATUS     RESTARTS   AGE
pod/internal-ftxtl                       1/2     NotReady   0          18m
pod/keycloak-prod-0                      2/2     Running    0          78m

image

Need to have this fields in KeycloakRealmImports :

...
spec:
  unsupported:
    jobTemplate:
      metadata:
        annotations:
          sidecar.istio.io/inject: “false”
@aamoyel aamoyel added kind/enhancement Categorizes a PR related to an enhancement status/triage labels Sep 20, 2022
@aamoyel aamoyel changed the title Ability to add fields in job template for KeycloakRealmImport Ability to add fields in job template for KeycloakRealmImport CR Sep 20, 2022
@husira
Copy link

husira commented Nov 23, 2022

@aamoyel, Did you find any solution to quit the job when istio injection is enabled?

[Update]: want to share my insight with you (I still need to test it):

Feel free to test it in your setup as well: husira/keycloak@20.0.1...husira:keycloak:customized-keycloakRealmImportJob

Seems to be a best-practice workaround (https://discuss.istio.io/t/best-practices-for-jobs/4968) to quit the istio-sidecar for jobs.

For our setup we also used --override=true to import the realm, because we always want to force/replace the resource with argocd and use the configuration from git.

@aamoyel aamoyel closed this as completed Feb 1, 2023
@ghost ghost removed the status/triage label Feb 1, 2023
@stianst stianst added this to the 21.0.0 milestone Feb 21, 2023
@fuero
Copy link

fuero commented Jun 21, 2023

Could anyone please elaborate on how this has been fixed?

My use case is for applying securityContext best practices to the import jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes a PR related to an enhancement
Projects
None yet
Development

No branches or pull requests

4 participants