-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from k8sgpt-ai/feat/manifests
- Loading branch information
Showing
12 changed files
with
141 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: docker-build | ||
IMG ?= ghcr.io/k8sgpt-ai/k8sgpt:latest | ||
|
||
deploy: | ||
ifndef SECRET | ||
$(error SECRET environment variable is not set) | ||
endif | ||
kubectl create ns k8sgpt || true | ||
kubectl create secret generic ai-backend-secret --from-literal=secret-key=$(SECRET) --namespace=k8sgpt || true | ||
kubectl apply -f container/manifests | ||
undeploy: | ||
kubectl delete secret ai-backend-secret --namespace=k8sgpt | ||
kubectl delete -f container/manifests | ||
kubectl delete ns k8sgpt | ||
docker-build: | ||
docker buildx build --build-arg=VERSION="$$(git describe --tags --abbrev=0)" --build-arg=COMMIT="$$(git rev-parse --short HEAD)" --build-arg DATE="$$(date +%FT%TZ)" --platform="linux/amd64,linux/arm64" -t ${IMG} -f container/Dockerfile . --push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: k8sgpt-deployment | ||
namespace: k8sgpt | ||
labels: | ||
app: k8sgpt | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: k8sgpt | ||
template: | ||
metadata: | ||
labels: | ||
app: k8sgpt | ||
spec: | ||
serviceAccountName: k8sgpt | ||
containers: | ||
- name: k8sgpt-container | ||
imagePullPolicy: Always | ||
image: ghcr.io/k8sgpt-ai/k8sgpt:v0.2.2 #x-release-please-version | ||
ports: | ||
- containerPort: 8080 | ||
args: ["serve"] | ||
resources: | ||
limits: | ||
cpu: "1" | ||
memory: "512Mi" | ||
requests: | ||
cpu: "0.5" | ||
memory: "256Mi" | ||
env: | ||
- name: K8SGPT_MODEL | ||
value: "gpt-3.5-turbo" | ||
- name: K8SGPT_BACKEND | ||
value: "openai" | ||
- name: K8SGPT_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: ai-backend-secret | ||
key: secret-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: k8sgpt-cluster-role-all | ||
rules: | ||
- apiGroups: | ||
- '*' | ||
resources: | ||
- '*' | ||
verbs: | ||
- get | ||
- list | ||
- watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: k8sgpt-rolebinding | ||
namespace: k8sgpt | ||
subjects: | ||
- kind: ServiceAccount | ||
name: k8sgpt | ||
namespace: k8sgpt | ||
roleRef: | ||
kind: ClusterRole | ||
name: k8sgpt-cluster-role-all | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: k8sgpt | ||
namespace: k8sgpt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: k8sgpt-service | ||
namespace: k8sgpt | ||
spec: | ||
selector: | ||
app: k8sgpt | ||
ports: | ||
- name: http | ||
port: 8080 | ||
targetPort: 8080 | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters