Skip to content

Commit 1d6ba58

Browse files
bigfluffycookiemaor-rozenfeldCopilot
authored
Add subagent related files (#25)
Co-authored-by: Maor Rozenfeld <49363375+maor-rozenfeld@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0cdd1d9 commit 1d6ba58

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- $openopsEnv := .Values.openopsEnv | default dict }}
2+
{{- if and (eq (toString (get $openopsEnv "OPS_SUBAGENTS_ENABLED")) "true") (eq (default "k8s" (get $openopsEnv "OPS_SUBAGENT_EXECUTOR_TYPE")) "k8s") }}
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: Role
5+
metadata:
6+
name: {{ include "openops.fullname" . }}-subagent-manager
7+
namespace: {{ .Values.subagents.namespace | default .Release.Namespace }}
8+
labels:
9+
{{- include "openops.componentLabels" (dict "root" . "component" "app") | nindent 4 }}
10+
{{- with .Values.global.commonLabels }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- with .Values.global.commonAnnotations }}
14+
annotations:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
rules:
18+
- apiGroups: ["batch"]
19+
resources: ["jobs"]
20+
verbs: ["create", "get", "list", "delete"]
21+
- apiGroups: [""]
22+
resources: ["pods"]
23+
verbs: ["get", "list"]
24+
- apiGroups: [""]
25+
resources: ["pods/log"]
26+
verbs: ["get"]
27+
{{- end }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- $openopsEnv := .Values.openopsEnv | default dict }}
2+
{{- if and (eq (toString (get $openopsEnv "OPS_SUBAGENTS_ENABLED")) "true") (eq (default "k8s" (get $openopsEnv "OPS_SUBAGENT_EXECUTOR_TYPE")) "k8s") }}
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: RoleBinding
5+
metadata:
6+
name: {{ include "openops.fullname" . }}-subagent-manager
7+
namespace: {{ .Values.subagents.namespace | default .Release.Namespace }}
8+
labels:
9+
{{- include "openops.componentLabels" (dict "root" . "component" "app") | nindent 4 }}
10+
{{- with .Values.global.commonLabels }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- with .Values.global.commonAnnotations }}
14+
annotations:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
roleRef:
18+
apiGroup: rbac.authorization.k8s.io
19+
kind: Role
20+
name: {{ include "openops.fullname" . }}-subagent-manager
21+
subjects:
22+
- kind: ServiceAccount
23+
name: {{ include "openops.serviceAccountName" (dict "root" . "component" "app") }}
24+
namespace: {{ .Release.Namespace }}
25+
{{- end }}

chart/values.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ openopsEnv:
143143
OPS_CODE_BLOCK_MEMORY_LIMIT_IN_MB: "256"
144144
OPS_SLACK_ENABLE_INTERACTIONS: "true"
145145

146+
# Subagent configuration
147+
OPS_SUBAGENTS_ENABLED: "false"
148+
OPS_SUBAGENT_EXECUTOR_TYPE: "k8s"
149+
OPS_SUBAGENT_K8S_NAMESPACE: '{{ .Values.subagents.namespace | default .Release.Namespace }}'
150+
OPS_SUBAGENT_S3_BUCKET: ""
151+
OPS_SUBAGENT_S3_REGION: ""
152+
OPS_SUBAGENT_S3_ENDPOINT: ""
153+
OPS_SUBAGENT_RUNNER_IMAGE: "535002847982.dkr.ecr.us-east-2.amazonaws.com/openops/subagent-runner:0fdbc6b1"
154+
146155
# Secret environment variables
147156
# Any var in this section is treated as a secret (stored in K8s Secret, referenced via secretKeyRef).
148157
# Generate secure values with: openssl rand -hex 16
@@ -629,3 +638,8 @@ externalSecrets:
629638
create: false
630639
name: external-secrets-sa
631640
annotations: {}
641+
642+
# Subagent configuration
643+
subagents:
644+
# Namespace where subagent pods run (defaults to same namespace as app)
645+
namespace: ""

0 commit comments

Comments
 (0)