Skip to content

Commit

Permalink
Merge branch 'main' into feat-migrate-all-rbac-to-helm-chart-template
Browse files Browse the repository at this point in the history
  • Loading branch information
MateSousa authored May 2, 2024
2 parents f09ea84 + ec9c6e9 commit 1d5c802
Show file tree
Hide file tree
Showing 20 changed files with 174 additions and 107 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Extract branch name
id: extract_branch
Expand Down Expand Up @@ -70,11 +70,11 @@ jobs:
RELEASE_REGISTRY: "localhost:5000/k8sgpt-operator"
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3

- name: Build Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
Expand All @@ -96,7 +96,7 @@ jobs:
outputs: type=docker,dest=/tmp/${{ env.IMAGE_NAME }}-image.tar

- name: Upload image as artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
name: ${{ env.IMAGE_NAME }}-image.tar
path: /tmp/${{ env.IMAGE_NAME }}-image.tar
Expand All @@ -115,7 +115,7 @@ jobs:
contents: read # Needed for checking out the repository
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
Expand All @@ -126,7 +126,7 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3

- name: Build Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Release-please creates a PR that tracks all changes
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- uses: google-github-actions/release-please-action@a37ac6e4f6449ce8b3f7607e4d97d0146028dc0b # v4
id: release
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
if: needs.release-please.outputs.releases_created == 'true'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Publish Helm chart
uses: stefanprodan/helm-gh-pages@master
with:
Expand All @@ -71,13 +71,13 @@ jobs:
IMAGE_NAME: k8sgpt-operator
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
submodules: recursive

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3

- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
Expand All @@ -101,7 +101,7 @@ jobs:
cache-to: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_TAG }}

- name: Generate SBOM
uses: anchore/sbom-action@ab5d7b5f48981941c4c5d6bf33aeb98fe3bae38c # v0.15.10
uses: anchore/sbom-action@7ccf588e3cf3cc2611714c2eeae48550fbc17552 # v0.15.11
with:
image: ${{ env.IMAGE_TAG }}
artifact-name: sbom-${{ env.IMAGE_NAME }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
Expand All @@ -27,11 +27,11 @@ jobs:
name: Test Helm Chart
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@b7246b12e77f7134dc2d460a3d5bad15bbe29390 # v4
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4
with:
version: v3.11.2

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"0.1.2"}
{".":"0.1.3"}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [0.1.3](https://github.com/k8sgpt-ai/k8sgpt-operator/compare/v0.1.2...v0.1.3) (2024-04-04)


### Bug Fixes

* **deps:** update module github.com/onsi/ginkgo/v2 to v2.17.1 ([#384](https://github.com/k8sgpt-ai/k8sgpt-operator/issues/384)) ([9168561](https://github.com/k8sgpt-ai/k8sgpt-operator/commit/916856132989e159545df770024fceb1bc8e9881))
* **deps:** update module google.golang.org/grpc to v1.63.0 ([#401](https://github.com/k8sgpt-ai/k8sgpt-operator/issues/401)) ([d1b5cbf](https://github.com/k8sgpt-ai/k8sgpt-operator/commit/d1b5cbf517f9e8e5c2fd78088863a93813d9dab0))


### Other

* **deps:** update actions/setup-python digest to 82c7e63 ([#387](https://github.com/k8sgpt-ai/k8sgpt-operator/issues/387)) ([ae46b74](https://github.com/k8sgpt-ai/k8sgpt-operator/commit/ae46b74716805ae74fba22616c78d061cc853d5b))
* **deps:** update anchore/sbom-action action to v0.15.10 ([#388](https://github.com/k8sgpt-ai/k8sgpt-operator/issues/388)) ([a6e6070](https://github.com/k8sgpt-ai/k8sgpt-operator/commit/a6e607006bae0f356e29fc921db3898a7991f9d6))
* **deps:** update gcr.io/kubebuilder/kube-rbac-proxy docker tag to v0.16.0 ([#396](https://github.com/k8sgpt-ai/k8sgpt-operator/issues/396)) ([8bf0f7a](https://github.com/k8sgpt-ai/k8sgpt-operator/commit/8bf0f7a9664eabe95075d59974df0312f9a7238a))
* small update to fix linter ([#403](https://github.com/k8sgpt-ai/k8sgpt-operator/issues/403)) ([7078643](https://github.com/k8sgpt-ai/k8sgpt-operator/commit/7078643c0db10d6ad426955a8cfacb7c1c24762c))

## [0.1.2](https://github.com/k8sgpt-ai/k8sgpt-operator/compare/v0.1.1...v0.1.2) (2024-03-28)


Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.11.1
CONTROLLER_TOOLS_VERSION ?= v0.14.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down Expand Up @@ -190,4 +190,4 @@ $(ENVTEST): $(LOCALBIN)
.PHONY: coverage
coverage: generate fmt vet manifests ## Run code coverage
go test -v -cover ./... -coverprofile coverage.out | grep -v /chart/ | grep -v /images/ | grep -v /charts/ | grep -v /config/ | grep -v /hack/ | grep -v /test/ | grep -v /vendor/
go tool cover -html=coverage.out -o coverage.html
go tool cover -html=coverage.out -o coverage.html
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,11 @@ EOF
<summary>Amazon Bedrock</summary>
</details>
1. Install the operator from the [Installation](#installation) section.
2. Create secret:
```sh
kubectl create secret generic bedrock-sample-secret --from-literal=AWS_ACCESS_KEY_ID="$(echo $AWS_ACCESS_KEY_ID)" --from-literal=AWS_ACCESS_KEY="$(echo $AWS_ACCESS_KEY)" -n k8sgpt-operator-system
kubectl create secret generic bedrock-sample-secret --from-literal=AWS_ACCESS_KEY_ID="$(echo $AWS_ACCESS_KEY_ID)" --from-literal=AWS_SECRET_ACCESS_KEY="$(echo $AWS_SECRET_ACCESS_KEY)" -n k8sgpt-operator-system
```
3. Apply the K8sGPT configuration object:
```
Expand All @@ -309,6 +308,8 @@ spec:
EOF
```
</details>
<details>
<summary>LocalAI</summary>
Expand Down
4 changes: 3 additions & 1 deletion api/v1alpha1/k8sgpt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type BackOff struct {

type AISpec struct {
// +kubebuilder:default:=openai
// +kubebuilder:validation:Enum=openai;localai;azureopenai;amazonbedrock;cohere;amazonsagemaker
// +kubebuilder:validation:Enum=openai;localai;azureopenai;amazonbedrock;cohere;amazonsagemaker;google;googlevertexai
Backend string `json:"backend"`
BackOff *BackOff `json:"backOff,omitempty"`
BaseUrl string `json:"baseUrl,omitempty"`
Expand Down Expand Up @@ -138,6 +138,8 @@ const (
AmazonBedrock = "amazonbedrock"
AmazonSageMaker = "AmazonSageMaker"
Cohere = "cohere"
Google = "google"
GoogleVertexAI = "googlevertexai"
)

// K8sGPTStatus defines the observed state of K8sGPT
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chart/operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/categories: monitoring-logging
type: application
version: 0.1.2
version: 0.1.3
appVersion: 0.0.26
4 changes: 2 additions & 2 deletions chart/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following table lists the configurable parameters of the K8sgpt-operator cha
| `controllerManager.kubeRbacProxy.containerSecurityContext.allowPrivilegeEscalation` | | `false` |
| `controllerManager.kubeRbacProxy.containerSecurityContext.capabilities.drop` | | `["ALL"]` |
| `controllerManager.kubeRbacProxy.image.repository` | | `"gcr.io/kubebuilder/kube-rbac-proxy"` |
| `controllerManager.kubeRbacProxy.image.tag` | | `"v0.1.2"` |
| `controllerManager.kubeRbacProxy.image.tag` | | `"v0.1.3"` |
| `controllerManager.kubeRbacProxy.resources.limits.cpu` | | `"500m"` |
| `controllerManager.kubeRbacProxy.resources.limits.memory` | | `"128Mi"` |
| `controllerManager.kubeRbacProxy.resources.requests.cpu` | | `"5m"` |
Expand All @@ -31,7 +31,7 @@ The following table lists the configurable parameters of the K8sgpt-operator cha
| `controllerManager.manager.containerSecurityContext.allowPrivilegeEscalation` | | `false` |
| `controllerManager.manager.containerSecurityContext.capabilities.drop` | | `["ALL"]` |
| `controllerManager.manager.image.repository` | | `"ghcr.io/k8sgpt-ai/k8sgpt-operator"` |
| `controllerManager.manager.image.tag` | x-release-please-version | `"v0.1.2"` |
| `controllerManager.manager.image.tag` | x-release-please-version | `"v0.1.3"` |
| `controllerManager.manager.resources.limits.cpu` | | `"500m"` |
| `controllerManager.manager.resources.limits.memory` | | `"128Mi"` |
| `controllerManager.manager.resources.requests.cpu` | | `"10m"` |
Expand Down
6 changes: 4 additions & 2 deletions chart/operator/templates/k8sgpt-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: CustomResourceDefinition
metadata:
name: k8sgpts.core.k8sgpt.ai
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.14.0
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -62,6 +62,8 @@ spec:
- amazonbedrock
- cohere
- amazonsagemaker
- google
- googlevertexai
type: string
baseUrl:
type: string
Expand Down Expand Up @@ -209,4 +211,4 @@ status:
kind: ""
plural: ""
conditions: []
storedVersions: []
storedVersions: []
4 changes: 2 additions & 2 deletions chart/operator/templates/result-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: CustomResourceDefinition
metadata:
name: results.core.k8sgpt.ai
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
controller-gen.kubebuilder.io/version: v0.14.0
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -96,4 +96,4 @@ status:
kind: ""
plural: ""
conditions: []
storedVersions: []
storedVersions: []
4 changes: 2 additions & 2 deletions chart/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ controllerManager:
- ALL
image:
repository: gcr.io/kubebuilder/kube-rbac-proxy
tag: v0.15.0
tag: v0.16.0
resources:
limits:
cpu: 500m
Expand All @@ -45,7 +45,7 @@ controllerManager:
- ALL
image:
repository: ghcr.io/k8sgpt-ai/k8sgpt-operator
tag: v0.1.2 # x-release-please-version
tag: v0.1.3 # x-release-please-version
resources:
limits:
cpu: 500m
Expand Down
33 changes: 20 additions & 13 deletions config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: k8sgpts.core.k8sgpt.ai
spec:
group: core.k8sgpt.ai
Expand All @@ -21,14 +20,19 @@ spec:
description: K8sGPT is the Schema for the k8sgpts API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -61,6 +65,8 @@ spec:
- amazonbedrock
- cohere
- amazonsagemaker
- google
- googlevertexai
type: string
baseUrl:
type: string
Expand Down Expand Up @@ -118,9 +124,9 @@ spec:
type: object
type: object
kubeconfig:
description: Define the kubeconfig the Deployment must use. If empty,
the Deployment will use the ServiceAccount provided by Kubernetes
itself.
description: |-
Define the kubeconfig the Deployment must use.
If empty, the Deployment will use the ServiceAccount provided by Kubernetes itself.
properties:
key:
type: string
Expand Down Expand Up @@ -196,8 +202,9 @@ spec:
type: string
type: object
status:
description: K8sGPTStatus defines the observed state of K8sGPT show the
current backend used
description: |-
K8sGPTStatus defines the observed state of K8sGPT
show the current backend used
type: object
type: object
served: true
Expand Down
Loading

0 comments on commit 1d5c802

Please sign in to comment.