adding files 2
This commit is contained in:
24
k8s/oke-remediator-multi-check/README.md
Normal file
24
k8s/oke-remediator-multi-check/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OKE Remediator Multi-Check
|
||||
|
||||
This workload runs every 3 minutes and performs three independent kagent checks as separate MCP interactions:
|
||||
|
||||
1. Business application health for Orders
|
||||
2. HPA autoscaling analysis for `order-service`
|
||||
3. ImagePull analysis for application deployments
|
||||
|
||||
Each result is normalized to a structured JSON shape. The worker stores one state entry per `error_code` in a Kubernetes ConfigMap and only sends one email plus one remediation deployment trigger per active incident signature.
|
||||
|
||||
## Deploy
|
||||
|
||||
```bash
|
||||
kubectl apply -f k8s/oke-remediator-multi-check/serviceaccount.yaml
|
||||
kubectl apply -f k8s/oke-remediator-multi-check/role.yaml
|
||||
kubectl apply -f k8s/oke-remediator-multi-check/rolebinding.yaml
|
||||
kubectl apply -f k8s/oke-remediator-multi-check/cronjob.yaml
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- The remediation pipelines must include approval stages.
|
||||
- The notification email includes the remediation deployment approval link when the deployment is created successfully.
|
||||
- The worker is intended for OKE Workload Identity.
|
||||
50
k8s/oke-remediator-multi-check/cronjob.yaml
Normal file
50
k8s/oke-remediator-multi-check/cronjob.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: kagent-oke-remediator-multi
|
||||
namespace: kagent-demo
|
||||
spec:
|
||||
schedule: "*/3 * * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 3
|
||||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 1
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
serviceAccountName: kagent-oke-remediator-multi
|
||||
imagePullSecrets:
|
||||
- name: ocir-secret
|
||||
containers:
|
||||
- name: kagent-oke-remediator-multi
|
||||
image: ${REGISTRY}/${NAMESPACE}/kagent-demo/oke-remediator-multi-check:${IMAGE_TAG}
|
||||
imagePullPolicy: Always
|
||||
env:
|
||||
- name: OCI_REGION
|
||||
value: mx-monterrey-1
|
||||
- name: APP_NAMESPACE
|
||||
value: kagent-demo
|
||||
- name: KAGENT_MCP_URL
|
||||
value: http://kagent-controller.kagent.svc.cluster.local:8083/mcp
|
||||
- name: KAGENT_AGENT_NAME
|
||||
value: k8s-agent
|
||||
- name: KAGENT_AGENT_NAMESPACE
|
||||
value: kagent
|
||||
- name: ORDER_OBSERVABILITY_URL
|
||||
value: http://order-service-lb.kagent-demo.svc.cluster.local/api/observability
|
||||
- name: NOTIFICATION_TOPIC_OCID
|
||||
value: ${NOTIFICATION_TOPIC_OCID}
|
||||
- name: BUSINESS_REMEDIATION_PROJECT_OCID
|
||||
value: ${BUSINESS_REMEDIATION_PROJECT_OCID}
|
||||
- name: BUSINESS_REMEDIATION_PIPELINE_OCID
|
||||
value: ${BUSINESS_REMEDIATION_PIPELINE_OCID}
|
||||
- name: IMAGEPULL_REMEDIATION_PROJECT_OCID
|
||||
value: ${IMAGEPULL_REMEDIATION_PROJECT_OCID}
|
||||
- name: IMAGEPULL_REMEDIATION_PIPELINE_OCID
|
||||
value: ${IMAGEPULL_REMEDIATION_PIPELINE_OCID}
|
||||
- name: HPA_REMEDIATION_PROJECT_OCID
|
||||
value: ${HPA_REMEDIATION_PROJECT_OCID}
|
||||
- name: HPA_REMEDIATION_PIPELINE_OCID
|
||||
value: ${HPA_REMEDIATION_PIPELINE_OCID}
|
||||
30
k8s/oke-remediator-multi-check/role.yaml
Normal file
30
k8s/oke-remediator-multi-check/role.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: kagent-oke-remediator-multi
|
||||
namespace: kagent-demo
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- pods
|
||||
- events
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups: ["apps"]
|
||||
resources:
|
||||
- deployments
|
||||
- replicasets
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
13
k8s/oke-remediator-multi-check/rolebinding.yaml
Normal file
13
k8s/oke-remediator-multi-check/rolebinding.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: kagent-oke-remediator-multi
|
||||
namespace: kagent-demo
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kagent-oke-remediator-multi
|
||||
namespace: kagent-demo
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: kagent-oke-remediator-multi
|
||||
5
k8s/oke-remediator-multi-check/serviceaccount.yaml
Normal file
5
k8s/oke-remediator-multi-check/serviceaccount.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: kagent-oke-remediator-multi
|
||||
namespace: kagent-demo
|
||||
Reference in New Issue
Block a user