hossted / hossted-operator

Hossted k8s operator
Apache License 2.0
0 stars 1 forks source link

Operator should support primary Creds #84

Open liorkesos opened 2 months ago

liorkesos commented 2 months ago

Helm overrides passed to operator will contain a primaryCreds object in. which we are "telling" the operator what the user and password are to implement the attached screenshot.

primaryCreds:
  user: KEYCLOAK_ADMIN
    configMap: "keycloak-env-vars"
  password: admin-password
    secret: "keycloak"

We want to use these values to ultimately reconcile , pass to the API and b stored as something like this:

{
   primary: {
     hossted-primary-url: “string containing url”,
     hossted-primary-username: “ string containing username”,
     hossted-primary-password: “string containing encoded password”
  }
}

Pseaudo logic will be

  1. After helm chart installation
  2. For each key (user / password) parse method ( configMap / secret )
  3. If its a configmap take the value from the environment variable stated in user and place in access.primaryUser field
  4. If its a secret take the ( decoded ) value and place access.primaryPassword field
  5. Take the DNS. value you received from the API and place it in the access primaryUrl field
  6. reconcile

image

gannulka commented 2 months ago

Update

primaryCreds:
  user: 
    key: "KEYCLOAK_ADMIN"
    configMap: "keycloak-env-vars"
  password: 
    key: "admin-password"
    secretName: "keycloak" ⁠
liorkesos commented 2 months ago

Logic for DNS convention shold be ${product-name}.${appUUID}.hossted.app @AdheipSingh will substitute the APPUUID to the actual value of it. keycloak.APPUUID.hossted.app

If we don't get IP - and. therefore cant set the DNS we assume. we're working. on a kind/k3s/kubeadmin local cluster and will give a response that will urge thee user to set his hosts file to 0.0.0.0. keycloak.${appuuid}.hossted.app and it should work as well

liorkesos commented 2 months ago

@AdheipSingh - Is the dns logic implemented in the latest operator ?