Skip to content

Commit

Permalink
feat: wip blocked until we have envs
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
AlexsJones committed Apr 15, 2023
1 parent 51b1b35 commit fe2c08c
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions container/manifests/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8sgpt-deployment
labels:
app: k8sgpt
spec:
replicas: 1
selector:
matchLabels:
app: k8sgpt
template:
metadata:
labels:
app: k8sgpt
spec:
containers:
- name: k8sgpt-container
image: ghcr.io/k8sgpt-ai/k8sgpt:v0.2.2
ports:
- containerPort: 8080
args: ["serve"]
resources:
limits:
cpu: "1"
memory: "512Mi"
requests:
cpu: "0.5"
memory: "256Mi"
env:
- name: AI_BACKEND_SECRET
valueFrom:
secretKeyRef:
name: ai-backend-secret
key: secret-key
78 changes: 78 additions & 0 deletions container/manifests/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: k8sgpt-cluster-role
rules:
- apiGroups:
- ""
resources:
- pods
- nodes
- persistentvolumeclaims
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- extensions
- apps
resources:
- deployments
- replicasets
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- networkpolicies
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- services
- endpoints
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- batch
- extensions
- batch.openshift.io
resources:
- cronjobs
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- get
- list
- watch
7 changes: 7 additions & 0 deletions container/manifests/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: ai-backend-secret
type: Opaque
data:
secret-key: <base64-encoded value of the secret>
24 changes: 24 additions & 0 deletions container/manifests/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: k8sgpt-service
spec:
selector:
app: k8sgpt
ports:
- name: http
port: 8080
targetPort: 8080
type: ClusterIP
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: k8sgpt-rolebinding
subjects:
- kind: ServiceAccount
name: k8sgpt
roleRef:
kind: ClusterRole
name: k8sgpt-cluster-role
apiGroup: rbac.authorization.k8s.io
11 changes: 11 additions & 0 deletions demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
. demo-magic.sh
clear

pe "k8sgpt filter list"
pe "k8sgpt analyze --filter=Pod --explain -o json | jq ."
pe "k8sgpt integration list"
pe "k8sgpt integration activate trivy"
pe "k8sgpt filter list"
pe "k8sgpt analyze --filter=VulnerabilityReport"
pe "./k8sgpt analyze --filter=Node --explain"

Binary file added images/demo5.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nodes.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fe2c08c

Please sign in to comment.