Skip to content

Commit

Permalink
Merge pull request #478 from frezes/release-0.10
Browse files Browse the repository at this point in the history
[cherry-pick] release 0.10
  • Loading branch information
benjaminhuo authored Feb 28, 2024
2 parents 31ca962 + 802b070 commit 30204bf
Show file tree
Hide file tree
Showing 30 changed files with 166 additions and 17,756 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
go-version: 1.17.x

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-monitoring-agent-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
go-version: 1.17.x

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-monitoring-block-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
go-version: 1.17.x

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-monitoring-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
go-version: 1.17.x

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: ct lint --config .github/linters/ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.8.0
uses: helm/kind-action@v1.9.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,18 @@ all: build

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=charts/whizard/crds

# stripped-down-crds is a version of the whizard CRDs with all
# description fields being removed. It is meant as a workaround for the issue
# that `kubectl apply -f ...` might fail with the full version of the CRDs
# because of too long annotations field.
# See https://github.com/prometheus-operator/prometheus-operator/issues/4355
stripped-down-crds: manifests
cd config/crd/bases && \
for f in *.yaml; do \
gojsontoyaml -yamltojson < $$f | jq 'walk(if type == "object" then with_entries(if .value|type=="object" then . else select(.key | test("description") | not) end) else . end)' | gojsontoyaml > ../../../charts/whizard/crds/$$f; \
done;


generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down
2 changes: 1 addition & 1 deletion build/controller-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.6 as builder
FROM golang:1.22.0 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion build/monitoring-agent-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.6 as builder
FROM golang:1.22.0 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion build/monitoring-block-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.6 as builder
FROM golang:1.22.0 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion build/monitoring-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.6 as builder
FROM golang:1.22.0 as builder
ARG GOPROXY

WORKDIR /workspace
Expand Down
2 changes: 1 addition & 1 deletion charts/whizard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ maintainers:
email: [email protected]
- name: junot
email: [email protected]
version: 0.10.6
version: 0.10.8
appVersion: "v0.10.0-rc.0"
1,073 changes: 2 additions & 1,071 deletions charts/whizard/crds/monitoring.whizard.io_compactors.yaml

Large diffs are not rendered by default.

830 changes: 2 additions & 828 deletions charts/whizard/crds/monitoring.whizard.io_gateways.yaml

Large diffs are not rendered by default.

1,093 changes: 2 additions & 1,091 deletions charts/whizard/crds/monitoring.whizard.io_ingesters.yaml

Large diffs are not rendered by default.

860 changes: 1 addition & 859 deletions charts/whizard/crds/monitoring.whizard.io_queries.yaml

Large diffs are not rendered by default.

832 changes: 1 addition & 831 deletions charts/whizard/crds/monitoring.whizard.io_queryfrontends.yaml

Large diffs are not rendered by default.

826 changes: 2 additions & 824 deletions charts/whizard/crds/monitoring.whizard.io_routers.yaml

Large diffs are not rendered by default.

1,207 changes: 1 addition & 1,206 deletions charts/whizard/crds/monitoring.whizard.io_rulers.yaml

Large diffs are not rendered by default.

8,706 changes: 1 addition & 8,705 deletions charts/whizard/crds/monitoring.whizard.io_services.yaml

Large diffs are not rendered by default.

931 changes: 0 additions & 931 deletions charts/whizard/crds/monitoring.whizard.io_storages.yaml

Large diffs are not rendered by default.

1,379 changes: 1 addition & 1,378 deletions charts/whizard/crds/monitoring.whizard.io_stores.yaml

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions charts/whizard/crds/monitoring.whizard.io_tenants.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand All @@ -17,17 +16,10 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Tenant is the Schema for the monitoring Tenant 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'
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'
type: string
metadata:
type: object
Expand Down
2 changes: 1 addition & 1 deletion charts/whizard/templates/service/service.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.service.enabled -}}
{{- $baseImage := printf "%s/%s:%s" (default .Values.global.imageRegistry .Values.global.whizard.image.registry) .Values.global.whizard.image.repository .Values.global.whizard.image.tag }}
{{- $baseImage := printf "%s/%s:%s" (default .Values.global.whizard.image.registry .Values.global.imageRegistry) .Values.global.whizard.image.repository .Values.global.whizard.image.tag }}
apiVersion: monitoring.whizard.io/v1alpha1
kind: Service
metadata:
Expand Down
5 changes: 2 additions & 3 deletions charts/whizard/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.monitoring.enabled -}}
{{- $components := tuple "compactor" "query" "ingester" "store" "ruler" }}
{{- range $index, $component := .Values.monitoring.components }}
{{- $components := tuple "compactor" "query" "ingester" "store" "ruler" "router" }}
{{- range $index, $component := $components }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand All @@ -16,7 +16,6 @@ spec:
port: http
scheme: http
scrapeTimeout: 30s
jobLabel: app.kubernetes.io/name
selector:
matchLabels:
app.kubernetes.io/name: {{ $component }}
Expand Down
112 changes: 112 additions & 0 deletions charts/whizard/templates/upgrade-crds-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{{- if .Values.hook.enabled }}
{{- $crdFiles := .Files.Glob "crds/**" }}
{{- $i := 0 }}
{{- range $path, $_ := $crdFiles }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "whizard.name" $ }}-crds-{{ $i }}
namespace: {{ include "whizard.namespace" $ }}
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
data:
{{ $path | base }}: |
{{- $.Files.Get $path | nindent 4 }}
---
{{- $i = add1 $i }}
{{- end }}

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "whizard.name" . }}-update-crds
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-weight": "2"
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "whizard.name" . }}-update-crds
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-weight": "3"
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "whizard.name" . }}-update-crds
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-weight": "4"
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "whizard.name" . }}-update-crds
subjects:
- kind: ServiceAccount
name: {{ include "whizard.name" . }}-update-crds
namespace: {{ include "whizard.namespace" . }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "whizard.name" . }}-update-crds
namespace: {{ include "whizard.namespace" . }}
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-weight": "5"
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
spec:
template:
spec:
restartPolicy: Never
serviceAccountName: {{ include "whizard.name" . }}-update-crds
volumes:
{{- $i = 0 }}
{{- range $path, $_ := $crdFiles }}
- name: crds-{{ $i }}
configMap:
name: {{ include "whizard.name" $ }}-crds-{{ $i }}
items:
- key: {{ $path | base }}
path: {{ $path | base }}
{{- $i = add1 $i }}
{{- end }}
containers:
- name: update-crds
image: {{ .Values.global.imageRegistry | default .Values.hook.image.registry }}/{{ .Values.hook.image.repository }}:{{ .Values.hook.image.tag }}
command:
- /bin/bash
- -c
- |
kubectl apply -f /data/crds 2>&1
{{- $i = 0 }}
volumeMounts:
{{- range $path, $_ := $crdFiles }}
- name: crds-{{ $i }}
mountPath: /data/crds/{{ $path | base }}
subPath: {{ $path | base }}
{{- $i = add1 $i }}
{{- end }}
{{- with .Values.hook.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/whizard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ hook:
repository: kubesphere/kubectl
tag: v1.21.0
pullPolicy: IfNotPresent
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi
backoffLimit: 3

monitoring:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/fsnotify/fsnotify v1.7.0
github.com/ghodss/yaml v1.0.0
github.com/go-kit/log v0.2.1
github.com/go-logr/logr v1.3.0
github.com/go-logr/logr v1.4.1
github.com/google/go-cmp v0.6.0
github.com/gorilla/mux v1.8.1
github.com/imdario/mergo v0.3.16
Expand Down Expand Up @@ -43,7 +43,7 @@ require (
k8s.io/client-go v0.29.1
k8s.io/code-generator v0.29.1
k8s.io/component-base v0.29.1
k8s.io/klog/v2 v2.110.1
k8s.io/klog/v2 v2.120.1
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/yaml v1.4.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
Expand Down Expand Up @@ -1454,8 +1454,8 @@ k8s.io/component-base v0.29.1/go.mod h1:fP9GFjxYrLERq1GcWWZAE3bqbNcDKDytn2srWuHT
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks=
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0=
k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a h1:ZeIPbyHHqahGIbeyLJJjAUhnxCKqXaDY+n89Ms8szyA=
k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI=
Expand Down

0 comments on commit 30204bf

Please sign in to comment.