Skip to content

Commit

Permalink
Replace name and namespace with release values
Browse files Browse the repository at this point in the history
  • Loading branch information
thepetk committed Nov 11, 2024
1 parent e9f419a commit 60487b2
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 91 deletions.
44 changes: 22 additions & 22 deletions charts/ai-software-templates/chatbot/0.1.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,34 @@ helm upgrade --install <release-name> --namespace <release-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. | | |
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -14,6 +14,6 @@ spec:
termination: edge
to:
kind: Service
name: {{ .Values.application.name }}
weight: 100
name: {{ .Release.Name }}
weight: 100
wildcardPolicy: None
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -21,5 +21,5 @@ spec:
key: {{ .Values.gitops.gitSecretKeyToken }}
envFrom:
- configMapRef:
name: {{ .Values.application.name }}-app-config
name: {{ .Release.Name }}-app-config
restartPolicy: Never
Original file line number Diff line number Diff line change
@@ -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 }}"
MODEL_ENDPOINT: "http://{{ .Release.Name }}-model-server:{{ .Values.model.modelServicePort }}"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions charts/ai-software-templates/chatbot/0.1.0/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}"


10 changes: 0 additions & 10 deletions charts/ai-software-templates/chatbot/0.1.0/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 0 additions & 2 deletions charts/ai-software-templates/chatbot/0.1.0/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

application:
name: "helm-chart-chatbot"
namespace: "ai-software-templates-dev"
appPort: 8501
appContainer: "quay.io/redhat-ai-dev/chatbot:latest"

Expand Down

0 comments on commit 60487b2

Please sign in to comment.