kyma-project / kyma-companion

A tool that brings AI to Kyma
Apache License 2.0
2 stars 11 forks source link

Design the Companion Manager CR #59

Closed Teneroy closed 2 months ago

Teneroy commented 3 months ago

Description: To define and implement Custom Resource Definitions (CRDs) and a Companion Custom Resource (CR) to efficiently manage configurations and secrets for HANA Vector SB, Redis, and AI-Core. Additionally, ensure that all updates are comprehensively documented.

The manager was implemented in this issue #58 Cluster creation information is described in this issue

Tasks:

  1. Discuss within the team how CRDs should look like
  2. Facilitate Companion Custom Resource: Implement the Companion CR to handle configurations and secrets for HANA Vector SB, Redis, and AI-Core. - Provide the necessary configuration from existing HandDB, Redis, AI-Core to the backend- Provide Flexibility in CRDs for potential automation
  3. Documentation: Update the documentation to include CR information into the companion manager Acceptance Criteria:
Teneroy commented 2 months ago

For later: reconciliation and validation

the1bit commented 2 months ago

Related files and documents: https://github.com/the1bit/kyma-companion-manager/tree/59-Design-the-Companion-Manager-CR

mfaizanse commented 2 months ago

A suggestion for CR:

apiVersion: operator.kyma-project.io/v1alpha1
kind: Companion
metadata:
  labels:
    app.kubernetes.io/name: default
    app.kubernetes.io/component: kyma-companion-manager
    app.kubernetes.io/part-of: kyma-companion-manager
  name: default
  namespace: kyma-system
spec:
  hanadbSecret: name/namespace
  redisSecret: name/namespace
  aiCoreSecret: name/namespace
  aiCoreConfigMap: name/namespace
  companionConfig:
    replicas: 
      min: 2
      max: 3
    resources:
      limits:
        cpu: 4
        memory: 4Gi
      requests:
        cpu: 500m
        memory: 256Mi
marcobebway commented 2 months ago

CR suggestion:

apiVersion: operator.kyma-project.io/v1alpha1
kind: Companion
metadata:
  name: default
  namespace: kyma-system
  labels:
    app.kubernetes.io/created-by: kyma-companion-manager
    app.kubernetes.io/instance: default
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/name: companion
    app.kubernetes.io/part-of: kyma-companion-manager
spec:
  aiCore:
    secret:
      name: any
      namespace: any
    configMap:
      name: any
      namespace: any
  hanaDB:
    secret:
      name: any
      namespace: any
  redis:
    secret:
      name: any
      namespace: any
  companion:
    replicas:
      min: 2
      max: 3
    resources:
      limits:
        cpu: 4
        memory: 4Gi
      requests:
        cpu: 500m
        memory: 256Mi
the1bit commented 2 months ago

I have additional 2 suggestions according to your feedback.

Required secrets:

1. Only secrets for all related namespaces

apiVersion: operator.kyma-project.io/v1alpha1
kind: Companion
metadata:
  labels:
    app.kubernetes.io/name: default
    app.kubernetes.io/component: kyma-companion-manager
    app.kubernetes.io/part-of: kyma-companion-manager
  name: default
  namespace: kyma-system
spec:
  aicoreSecret: name/namespace
  companionSecret: name/namespace
  hanaCloudSecret: name/namespace
  redisSecret: name/namespace
  companion:
    replicas:
      min: 1
      max: 3
    resources:
      limits:
        cpu: "4"
        memory: 4Gi
      requests:
        cpu: 500m
        memory: 256Mi

2. Dedicated section for all

In this scenario we can expand any component related configuration section easily.

apiVersion: operator.kyma-project.io/v1alpha1
kind: Companion
metadata:
  labels:
    app.kubernetes.io/name: default
    app.kubernetes.io/component: kyma-companion-manager
    app.kubernetes.io/part-of: kyma-companion-manager
  name: default
  namespace: kyma-system
spec:
  aicore:
    secret:
      name: any
      namespace: any
  hanaCloud:
    secret:
      name: any
      namespace: any
  redis:
    secret:
      name: any
      namespace: any
  companion:
    secret:
      name: any
      namespace: any
    replicas:
      min: 1
      max: 3
    resources:
      limits:
        cpu: "4"
        memory: 4Gi
      requests:
        cpu: 500m
        memory: 256Mi

TEAM DECISION: 2. Dedicated section for all

the1bit commented 2 months ago

Final PRs:

Final solution: