Skip to content

Commit 35f4c3a

Browse files
add chart for splunk-ai-operator deployment
1 parent 3dd7e1e commit 35f4c3a

File tree

10 files changed

+257
-19
lines changed

10 files changed

+257
-19
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: v2
3+
name: splunk-operator
4+
description: A Helm chart for deploying the Splunk AI Operator
5+
type: application
6+
icon: https://example.com/icon.png
7+
keywords:
8+
- splunk
9+
- ai
10+
- kuberay
11+
home: https://github.com/splunk/splunk-ai-operator
12+
sources:
13+
- https://github.com/splunk/splunk-ai-operator
14+
maintainers:
15+
- name: Splunk AI Team
16+
17+
18+
# This is the chart version. This version number should be incremented each time you make changes
19+
# to the chart and its templates, including the app version.
20+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21+
version: "0.1.0"
22+
23+
# This is the version number of the application being deployed. This version number should be
24+
# incremented each time you make changes to the application. Versions are not expected to
25+
# follow Semantic Versioning. They should reflect the version the application is using.
26+
# It is recommended to use it with quotes.
27+
appVersion: "0.1.0"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "splunk-ai-operator.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "splunk-ai-operator.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create standard operator fullname for uniform installation across Helm and manifest
28+
*/}}
29+
{{- define "splunk-ai-operator.fullname" -}}
30+
{{- default "splunk-ai-operator" .Values.splunkOperator.nameOverride }}
31+
{{- end }}
32+
33+
{{/*
34+
Create the name of the service account to use for splunk operator
35+
*/}}
36+
{{- define "splunk-ai-operator.serviceAccountName" -}}
37+
{{- printf "%s-%s" (include "splunk-ai-operator.fullname" .) "controller-manager" }}
38+
{{- end }}
39+
40+
{{/*
41+
Create chart name and version as used by the chart label.
42+
*/}}
43+
{{- define "splunk-ai-operator.chart" -}}
44+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
45+
{{- end }}
46+
47+
{{/*
48+
Common labels
49+
*/}}
50+
{{- define "splunk-ai-operator.labels" -}}
51+
helm.sh/chart: {{ include "splunk-ai-operator.chart" . }}
52+
{{ include "splunk-ai-operator.selectorLabels" . }}
53+
{{- if .Chart.AppVersion }}
54+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
55+
{{- end }}
56+
app.kubernetes.io/managed-by: {{ .Release.Service }}
57+
{{- end }}
58+
59+
{{/*
60+
Selector labels
61+
*/}}
62+
{{- define "splunk-ai-operator.selectorLabels" -}}
63+
control-plane: controller-manager
64+
app.kubernetes.io/name: {{ include "splunk-ai-operator.name" . }}
65+
app.kubernetes.io/instance: {{ .Release.Name }}
66+
{{- end }}
67+
68+
{{/*
69+
Define namespace of release and allow for namespace override
70+
*/}}
71+
{{- define "splunk-ai-operator.namespace" -}}
72+
{{- default .Release.Namespace .Values.namespaceOverride }}
73+
{{- end }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "splunk-ai-operator.fullname" . }}-controller-manager
6+
namespace: {{ include "splunk-ai-operator.namespace" . }}
7+
labels:
8+
{{- include "splunk-ai-operator.labels" . | nindent 4 }}
9+
{{- if .Values.labels }}
10+
{{ toYaml .Values.labels | nindent 4 }}
11+
{{- end }}
12+
{{- if .Values.annotations }}
13+
annotations:
14+
{{ toYaml .Values.annotations | nindent 4 }}
15+
{{- end }}
16+
spec:
17+
replicas: 1
18+
selector:
19+
matchLabels:
20+
{{- include "splunk-ai-operator.selectorLabels" . | nindent 6 }}
21+
strategy:
22+
type: Recreate
23+
template:
24+
metadata:
25+
{{- with .Values.podAnnotations }}
26+
annotations:
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
labels:
30+
{{- include "splunk-ai-operator.selectorLabels" . | nindent 8 }}
31+
{{- if .Values.podLabels }}
32+
{{ toYaml .Values.podLabels | indent 8 }}
33+
{{- end }}
34+
spec:
35+
serviceAccountName: {{ include "splunk-ai-operator.serviceAccountName" . }}
36+
securityContext:
37+
{{- toYaml .Values.securityContext | nindent 8 }}
38+
containers:
39+
- name: manager
40+
image: "{{ .Values.image.repository}}"
41+
imagePullPolicy: {{ .Values .image.pullPolicy }}
42+
args:
43+
- --leader-elect
44+
- --health-probe-bind-address=:8081
45+
command:
46+
- /manager
47+
{{- with .Values.livenessProbe }}
48+
livenessProbe:
49+
{{- toYaml . | nindent 12 }}
50+
{{- end }}
51+
{{- with .Values.readinessProbe }}
52+
readinessProbe:
53+
{{- toYaml . | nindent 12 }}
54+
{{- end }}
55+
env:
56+
- name: POD_NAME
57+
valueFrom:
58+
fieldRef:
59+
fieldPath: metadata.name=
60+
resources:
61+
{{- toYaml .Values.resources | nindent 12 }}
62+
{{- with .Values.volumeMounts }}
63+
volumeMounts:
64+
{{- toYaml .| nindent 12 }}
65+
{{- end }}
66+
{{- with .Values.volumes }}
67+
volumes:
68+
{{- toYaml .| nindent 8 }}
69+
{{- end }}
70+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Add labels to Splunk AI Operator deployment
2+
labels: {}
3+
4+
# Add annotations to Splunk AI Operator deployment
5+
annotations: {}
6+
7+
# Add pod annotations to Splunk AI Operator deployment pod
8+
podAnnotations: {}
9+
10+
# Add pod labels to Splunk AI Operator deployment pod
11+
podLabels: {}
12+
13+
# Set security context for Splunk Operator pod
14+
# reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podsecuritycontext-v1-core
15+
securityContext:
16+
runAsNonRoot: true
17+
seccompProfile:
18+
type: RuntimeDefault
19+
20+
# Splunk AI Operator image and pull policy
21+
# reference: https://github.com/splunk/splunk-ai-operator
22+
image:
23+
repository: controller:latest
24+
pullPolicy: IfNotPresent
25+
26+
# Define liveness probe to check if manager container is running
27+
# reference: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#types-of-probe
28+
livenessProbe:
29+
httpGet:
30+
path: /healthz
31+
port: 8081
32+
initialDelaySeconds: 15
33+
periodSeconds: 20
34+
35+
# Define readiness probe to check if manager container is ready for requests
36+
# reference: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#types-of-probe
37+
readinessProbe:
38+
httpGet:
39+
path: /readyz
40+
port: 8081
41+
initialDelaySeconds: 5
42+
periodSeconds: 10
43+
44+
# Set resource requests and limits for manager container
45+
resources:
46+
limits:
47+
cpu: 1000m
48+
memory: 2000Mi
49+
requests:
50+
cpu: 1000m
51+
memory: 2000Mi
52+
53+
# Specify volume mounts for the manager container, append additional volume mounts to list
54+
# reference: https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/
55+
volumeMounts: []
56+
# - mountPath:
57+
# name:
58+
59+
# Specify volumes for Splunk AI Operator pod, append additional volumes to list
60+
# reference: https://kubernetes.io/docs/concepts/storage/volumes/
61+
volumes: []
62+
# - name:
63+
# persistentVolumeClaim:
64+
# claimName:
65+
66+
# Set duration in seconds the pod needs to terminate gracefully
67+
# reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#pod-v1-core
68+
terminationGracePeriodSeconds: 10

helm-chart/splunk-ai/Chart.yaml renamed to helm-chart/splunk-ai-platform/Chart.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: v2
3-
name: splunk-ai
3+
name: splunk-ai-platform
44
description: A Helm chart for deploying Splunk AIPlatform custom resources
55
type: application
66
version: 0.1.0
@@ -16,10 +16,10 @@ sources:
1616
maintainers:
1717
- name: Splunk AI Team
1818
19-
# dependencies:
20-
# - name: splunk-operator
21-
# version: "2.8.0"
22-
# repository: "file://../splunk-operator"
19+
dependencies:
20+
- name: splunk-ai-operator
21+
version: "0.1.0"
22+
repository: "file://../splunk-ai-operator"
2323
# - name: kuberay-operator
2424
# version: "1.3.2"
2525
# repository: "https://ray-project.github.io/kuberay-helm"

helm-chart/splunk-ai/templates/NOTES.txt renamed to helm-chart/splunk-ai-platform/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1. Your AIPlatform custom resource has been created:
2-
kubectl get aiplatform {{ include "splunk-ai.fullname" . }}
2+
kubectl get aiplatform {{ include "splunk-ai-platform.fullname" . }}
33

44
2. If you enabled Ingress:
55
* Host: {{ (index .Values.ingress.hosts 0).host }}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "splunk-ai.name" -}}
4+
{{- define "splunk-ai-platform.name" -}}
55
{{- default .Chart.Name .Values.nameOverride -}}
66
{{- end -}}
77

8-
{{- define "splunk-ai.fullname" -}}
8+
{{- define "splunk-ai-platform.fullname" -}}
99
{{- if .Values.fullnameOverride -}}
1010
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
1111
{{- else -}}
12-
{{- printf "%s-%s" (include "splunk-ai.name" .) .Release.Name | trunc 63 | trimSuffix "-" -}}
12+
{{- printf "%s-%s" (include "splunk-ai-platform.name" .) .Release.Name | trunc 63 | trimSuffix "-" -}}
1313
{{- end -}}
1414
{{- end -}}
1515

16-
{{- define "splunk-ai.labels" -}}
17-
app.kubernetes.io/name: {{ include "splunk-ai.name" . }}
16+
{{- define "splunk-ai-platform.labels" -}}
17+
app.kubernetes.io/name: {{ include "splunk-ai-platform.name" . }}
1818
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version }}
1919
app.kubernetes.io/instance: {{ .Release.Name }}
2020
app.kubernetes.io/version: {{ .Chart.AppVersion }}
@@ -24,6 +24,6 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
2424
{{/*
2525
Define namespace of release and allow for namespace override
2626
*/}}
27-
{{- define "splunk-ai.namespace" -}}
27+
{{- define "splunk-ai-platform.namespace" -}}
2828
{{- default .Release.Namespace }}
2929
{{- end }}

helm-chart/splunk-ai/templates/aiplatform.yaml renamed to helm-chart/splunk-ai-platform/templates/aiplatform.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
apiVersion: v4.splunkai/v1
44
kind: AIPlatform
55
metadata:
6-
name: {{ include "splunk-ai.fullname" . }}
7-
namespace: {{ include "splunk-ai.namespace" . }}
6+
name: {{ include "splunk-ai-platform.fullname" . }}
7+
namespace: {{ include "splunk-ai-platform.namespace" . }}
88
labels:
9-
{{- include "splunk-ai.labels" . | nindent 4 }}
9+
{{- include "splunk-ai-platform.labels" . | nindent 4 }}
1010
spec:
1111
volume:
1212
path: {{ .Values.volume.path | quote }}

helm-chart/splunk-ai/templates/ingress.yaml renamed to helm-chart/splunk-ai-platform/templates/ingress.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
apiVersion: networking.k8s.io/v1
44
kind: Ingress
55
metadata:
6-
name: {{ include "splunk-ai.fullname" . }}-ingress
7-
namespace: {{ include "splunk-ai.namespace" . }}
6+
name: {{ include "splunk-ai-platform.fullname" . }}-ingress
7+
namespace: {{ include "splunk-ai-platform.namespace" . }}
88
labels:
9-
{{- include "splunk-ai.labels" . | nindent 4 }}
9+
{{- include "splunk-ai-platform.labels" . | nindent 4 }}
1010
annotations:
1111
{{- toYaml .Values.ingress.annotations | nindent 4 }}
1212
spec:
@@ -20,7 +20,7 @@ spec:
2020
pathType: {{ .pathType }}
2121
backend:
2222
service:
23-
name: {{ include "splunk-ai.fullname" $ }}
23+
name: {{ include "splunk-ai-platform.fullname" $ }}
2424
port:
2525
number: {{ $.Values.service.port }}
2626
{{- end }}
File renamed without changes.

0 commit comments

Comments
 (0)