From 60487b205fb638c101b596ded3de3a601b90662a Mon Sep 17 00:00:00 2001 From: thepetk Date: Mon, 11 Nov 2024 15:11:39 -0500 Subject: [PATCH] Replace name and namespace with release values --- .../chatbot/0.1.0/README.md | 44 +++++++++---------- .../chatbot/0.1.0/templates/app-config.yaml | 14 +++--- .../0.1.0/templates/app-deployment.yaml | 16 +++---- .../chatbot/0.1.0/templates/app-route.yaml | 12 ++--- .../chatbot/0.1.0/templates/app-service.yaml | 10 ++--- .../templates/application-gitops-job.yaml | 12 ++--- .../chatbot/0.1.0/templates/model-config.yaml | 6 +-- .../templates/model-server-deployment.yaml | 14 +++--- .../0.1.0/templates/model-server-service.yaml | 10 ++--- .../chatbot/0.1.0/templates/pvc.yaml | 8 ++-- .../0.1.0/templates/tekton-repository.yaml | 12 ++--- .../chatbot/0.1.0/values.schema.json | 10 ----- .../chatbot/0.1.0/values.yaml | 2 - 13 files changed, 79 insertions(+), 91 deletions(-) diff --git a/charts/ai-software-templates/chatbot/0.1.0/README.md b/charts/ai-software-templates/chatbot/0.1.0/README.md index 4a1cba2..f41ba50 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/README.md +++ b/charts/ai-software-templates/chatbot/0.1.0/README.md @@ -38,34 +38,34 @@ helm upgrade --install --namespace . ## Values -Below is a table of each value used to configure this chart. +Below is a table of each value used to configure this chart. Note: + +- Your helm release's name will be used to as the name of the application github repository. ### Application -| Value | Description | Default | Additional Information | -| -------------- | ------------------------------------------------------------- | -------------------------------------- | ---------------------- | -| `name` | The name of the application. | `chatbot-helm-chart` | | -| `namespace` | The namespace that the application will be deployed. | `ai-software-templates-dev` | | -| `appPort` | The exposed port of the application | 8501 | | -| `appContainer` | The initial image used for the chatbot application interface. | `quay.io/redhat-ai-dev/chatbot:latest` | | +| Value | Description | Default | Additional Information | +| -------------------------- | ------------------------------------------------------------- | -------------------------------------- | ---------------------- | +| `application.appPort` | The exposed port of the application | 8501 | | +| `application.appContainer` | The initial image used for the chatbot application interface. | `quay.io/redhat-ai-dev/chatbot:latest` | | ### Model -| Value | Description | Default | Additional Information | -| ----------------------- | --------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------- | -| `modelServicePort` | The exposed port of the model service. | 8001 | | -| `modelServiceContainer` | The image used for the model service. | `quay.io/ai-lab/llamacpp_python:latest` | | -| `initContainer` | The image used for the initContainer of the model service deployment. | `quay.io/redhat-ai-dev/granite-7b-lab:latest` | | -| `modelInitCommand` | The model service initContainer command. | `['/usr/bin/install', '/model/model.file', '/shared/']` | | -| `modelPath` | The path of the model file inside the model service container. | `/model/model.file` | | +| Value | Description | Default | Additional Information | +| ----------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------- | +| `model.modelServicePort` | The exposed port of the model service. | 8001 | | +| `model.modelServiceContainer` | The image used for the model service. | `quay.io/ai-lab/llamacpp_python:latest` | | +| `initContainer` | The image used for the initContainer of the model service deployment. | `quay.io/redhat-ai-dev/granite-7b-lab:latest` | | +| `model.modelInitCommand` | The model service initContainer command. | `['/usr/bin/install', '/model/model.file', '/shared/']` | | +| `model.modelPath` | The path of the model file inside the model service container. | `/model/model.file` | | ### Gitops -| Value | Description | Default | Additional Information | -| ------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------- | ---------------------- | -| `gitSecretName` | The name of the Secret containing the required Github token. | `git-secrets` | | -| `gitSecretKeyToken` | The name of the Secret's key with the Github token value. | `GITHUB_TOKEN` | | -| `githubOrgName` | `[REQUIRED]` The Github Organization name that the chatbot application repository will be created into | | | -| `gitSourceRepo` | The Github Repository with the contents of the chatbot application. | `redhat-ai-dev/ai-lab-helm-charts` | | -| `gitDefaultBranch` | The default branch for the chatbot application Github repository. | `main` | | -| `quayAccountName` | `[REQUIRED]` The quay.io account that the application image will be pushed. | | | +| Value | Description | Default | Additional Information | +| -------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------- | ---------------------- | +| `gitops.gitSecretName` | The name of the Secret containing the required Github token. | `git-secrets` | | +| `gitops.gitSecretKeyToken` | The name of the Secret's key with the Github token value. | `GITHUB_TOKEN` | | +| `gitops.githubOrgName` | `[REQUIRED]` The Github Organization name that the chatbot application repository will be created into | | | +| `gitops.gitSourceRepo` | The Github Repository with the contents of the chatbot application. | `"thepetk/chatbot-test-chart-repo` | | +| `gitops.gitDefaultBranch` | The default branch for the chatbot application Github repository. | `main` | | +| `gitops.quayAccountName` | `[REQUIRED]` The quay.io account that the application image will be pushed. | | | diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/app-config.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/app-config.yaml index 6fb5be4..1c4e764 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/app-config.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/app-config.yaml @@ -2,14 +2,14 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }}-app-config - app.kubernetes.io/name: {{ .Values.application.name }}-app-config - app.kubernetes.io/part-of: {{ .Values.application.name }} - name: {{ .Values.application.name }}-app-config - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }}-app-config + app.kubernetes.io/name: {{ .Release.Name }}-app-config + app.kubernetes.io/part-of: {{ .Release.Name }} + name: {{ .Release.Name }}-app-config + namespace: {{ .Release.Namespace }} data: - APP_NAME: "{{ .Values.application.name }}" - APP_NAMESPACE: "{{ .Values.application.namespace }}" + APP_NAME: "{{ .Release.Name }}" + APP_NAMESPACE: "{{ .Release.Namespace }}" GITHUB_ORG_NAME: "{{ .Values.gitops.githubOrgName }}" GITHUB_SOURCE_REPO: "{{ .Values.gitops.gitSourceRepo }}" GITHUB_TETKON_SOURCE_REPO: "redhat-ai-dev/ai-lab-helm-charts" diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/app-deployment.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/app-deployment.yaml index f8ac0b3..91698a6 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/app-deployment.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/app-deployment.yaml @@ -7,27 +7,27 @@ metadata: tad.gitops.set/replicas: ".spec.replicas" tad.gitops.get/replicas: ".spec.replicas" labels: - app.kubernetes.io/instance: {{ .Values.application.name }} - app.kubernetes.io/name: {{ .Values.application.name }} - app.kubernetes.io/part-of: {{ .Values.application.name }} - name: {{ .Values.application.name }} - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/instance: {{ .Values.application.name }} + app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }} + app.kubernetes.io/instance: {{ .Release.Name }} spec: containers: - image: {{ .Values.application.appContainer }} name: app-inference envFrom: - configMapRef: - name: {{ .Values.application.name }}-model-config + name: {{ .Release.Name }}-model-config ports: - containerPort: {{ .Values.application.appPort }} securityContext: diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/app-route.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/app-route.yaml index 036a27f..c0fc7b4 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/app-route.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/app-route.yaml @@ -2,10 +2,10 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }} - app.kubernetes.io/name: {{ .Values.application.name }} - name: {{ .Values.application.name }} - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Release.Name }} + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} spec: port: targetPort: {{ .Values.application.appPort }} @@ -14,6 +14,6 @@ spec: termination: edge to: kind: Service - name: {{ .Values.application.name }} - weight: 100 + name: {{ .Release.Name }} + weight: 100 wildcardPolicy: None diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/app-service.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/app-service.yaml index e1feaa3..269630f 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/app-service.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/app-service.yaml @@ -2,14 +2,14 @@ apiVersion: v1 kind: Service metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }} - app.kubernetes.io/name: {{ .Values.application.name }} - name: {{ .Values.application.name }} - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Release.Name }} + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} spec: ports: - port: {{ .Values.application.appPort }} protocol: TCP targetPort: {{ .Values.application.appPort }} selector: - app.kubernetes.io/instance: {{ .Values.application.name }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/application-gitops-job.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/application-gitops-job.yaml index dab1fb4..af7b24f 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/application-gitops-job.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/application-gitops-job.yaml @@ -2,11 +2,11 @@ apiVersion: batch/v1 kind: Job metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }}-github-repo-creator - app.kubernetes.io/name: {{ .Values.application.name }}-github-repo-creator - app.kubernetes.io/part-of: {{ .Values.application.name }} - namespace: {{ .Values.application.namespace }} - name: {{ .Values.application.name }}-github-repo-creator + app.kubernetes.io/instance: {{ .Release.Name }}-github-repo-creator + app.kubernetes.io/name: {{ .Release.Name }}-github-repo-creator + app.kubernetes.io/part-of: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} + name: {{ .Release.Name }}-github-repo-creator spec: template: spec: @@ -21,5 +21,5 @@ spec: key: {{ .Values.gitops.gitSecretKeyToken }} envFrom: - configMapRef: - name: {{ .Values.application.name }}-app-config + name: {{ .Release.Name }}-app-config restartPolicy: Never \ No newline at end of file diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/model-config.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/model-config.yaml index 659a0db..2b01367 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/model-config.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/model-config.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.application.name }}-model-config - namespace: {{ .Values.application.namespace }} + name: {{ .Release.Name }}-model-config + namespace: {{ .Release.Namespace }} data: - MODEL_ENDPOINT: "http://{{ .Values.application.name }}-model-server:{{ .Values.model.modelServicePort }}" \ No newline at end of file + MODEL_ENDPOINT: "http://{{ .Release.Name }}-model-server:{{ .Values.model.modelServicePort }}" \ No newline at end of file diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-deployment.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-deployment.yaml index 6ca3115..36845a8 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-deployment.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-deployment.yaml @@ -2,20 +2,20 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }}-model-server - app.kubernetes.io/name: {{ .Values.application.name }}-model-server - app.kubernetes.io/part-of: {{ .Values.application.name }} - name: {{ .Values.application.name }}-model-server - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }}-model-server + app.kubernetes.io/name: {{ .Release.Name }}-model-server + app.kubernetes.io/part-of: {{ .Release.Name }} + name: {{ .Release.Name }}-model-server + namespace: {{ .Release.Namespace }} spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/instance: {{ .Values.application.name }}-model-server + app.kubernetes.io/instance: {{ .Release.Name }}-model-server template: metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }}-model-server + app.kubernetes.io/instance: {{ .Release.Name }}-model-server spec: initContainers: - name: model-file diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-service.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-service.yaml index 551183f..76cb96d 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-service.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/model-server-service.yaml @@ -2,14 +2,14 @@ apiVersion: v1 kind: Service metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }}-model-server - app.kubernetes.io/name: {{ .Values.application.name }}-model-server - name: {{ .Values.application.name }}-model-server - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }}-model-server + app.kubernetes.io/name: {{ .Release.Name }}-model-server + name: {{ .Release.Name }}-model-server + namespace: {{ .Release.Namespace }} spec: ports: - port: {{ .Values.model.modelServicePort }} protocol: TCP targetPort: {{ .Values.model.modelServicePort }} selector: - app.kubernetes.io/instance: {{ .Values.application.name }}-model-server + app.kubernetes.io/instance: {{ .Release.Name }}-model-server diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/pvc.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/pvc.yaml index ceffb4a..46193ce 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/pvc.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/pvc.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: - app.kubernetes.io/instance: {{ .Values.application.name }} - app.kubernetes.io/name: {{ .Values.application.name }} - name: {{ .Values.application.name }} - namespace: {{ .Values.application.namespace }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Release.Name }} + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} spec: accessModes: - ReadWriteOnce diff --git a/charts/ai-software-templates/chatbot/0.1.0/templates/tekton-repository.yaml b/charts/ai-software-templates/chatbot/0.1.0/templates/tekton-repository.yaml index bbf552e..aba81fd 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/templates/tekton-repository.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/templates/tekton-repository.yaml @@ -1,13 +1,13 @@ apiVersion: "pipelinesascode.tekton.dev/v1alpha1" kind: Repository metadata: - name: {{ .Values.application.name }}-tekton-repository - namespace: {{ .Values.application.namespace }} + name: {{ .Release.Name }}-tekton-repository + namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/instance: {{ .Values.application.name }} - app.kubernetes.io/name: {{ .Values.application.name }} - app.kubernetes.io/part-of: {{ .Values.application.name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} spec: - url: "https://github.com/{{ .Values.gitops.githubOrgName }}/{{ .Values.application.name }}" + url: "https://github.com/{{ .Values.gitops.githubOrgName }}/{{ .Release.Name }}" diff --git a/charts/ai-software-templates/chatbot/0.1.0/values.schema.json b/charts/ai-software-templates/chatbot/0.1.0/values.schema.json index f7ab2f8..4d480bb 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/values.schema.json +++ b/charts/ai-software-templates/chatbot/0.1.0/values.schema.json @@ -5,16 +5,6 @@ "application": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The name of the application, if blank it defaults to 'chatbot-helm-chart'.", - "default": "chatbot-helm-chart" - }, - "namespace": { - "type": ["string", "null"], - "description": "The namespace that the application will be deployed, if blank it defaults to 'ai-software-templates-dev'.", - "default": "ai-software-templates-dev" - }, "appPort": { "type": "integer", "description": "The exposed port of the application, if blank it defaults to 8501.", diff --git a/charts/ai-software-templates/chatbot/0.1.0/values.yaml b/charts/ai-software-templates/chatbot/0.1.0/values.yaml index 9ffaf6f..63fdd9b 100644 --- a/charts/ai-software-templates/chatbot/0.1.0/values.yaml +++ b/charts/ai-software-templates/chatbot/0.1.0/values.yaml @@ -1,7 +1,5 @@ application: - name: "helm-chart-chatbot" - namespace: "ai-software-templates-dev" appPort: 8501 appContainer: "quay.io/redhat-ai-dev/chatbot:latest"