Skip to content

Commit

Permalink
Merge pull request #11 from zmberg/grafana-dashboard
Browse files Browse the repository at this point in the history
add sample grafana dashboard
  • Loading branch information
zmberg authored Feb 21, 2023
2 parents bd11d81 + 4a2ea44 commit b081f2a
Show file tree
Hide file tree
Showing 10 changed files with 1,487 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
with:
version: ${{ env.GOLANGCI_VERSION }}
args: --verbose
skip-pkg-cache: true
mod: readonly

ci-build:
name: ci-build
Expand Down
31 changes: 31 additions & 0 deletions Dockerfile_multiarch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build the manager and daemon binaries
ARG BASE_IMAGE=alpine
ARG BASE_IMAGE_VERION=3.17
FROM --platform=$BUILDPLATFORM golang:1.18-alpine3.17 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# Copy the go source
COPY main.go main.go
COPY internal/ internal/
COPY pkg/ pkg/
COPY vendor/ vendor/

# Build
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o kruise-state-metrics main.go

ARG BASE_IMAGE
ARG BASE_IMAGE_VERION
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERION}

RUN apk add --no-cache ca-certificates=~20220614-r4 bash=~5.2.15-r0 expat=~2.5.0-r0 \
&& rm -rf /var/cache/apk/*

WORKDIR /
COPY --from=builder /workspace/kruise-state-metrics .
ENTRYPOINT ["/kruise-state-metrics"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Image URL to use all building/pushing image targets
IMG ?= openkruise/kruise-state-metrics:test
# Platforms to build the image for
PLATFORMS ?= linux/amd64,linux/arm64,linux/arm
PLATFORMS ?= linux/amd64,linux/arm64

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -41,7 +41,7 @@ docker-push:

# Build and push the multiarchitecture docker images and manifest.
docker-multiarch:
docker buildx build --pull --no-cache --platform=$(PLATFORMS) --push . -t $(IMG)
docker buildx build -f ./Dockerfile_multiarch --pull --no-cache --platform=$(PLATFORMS) --push . -t $(IMG)

deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd deploy && $(KUSTOMIZE) edit set image kruise-state-metrics=${IMG}
Expand Down
1 change: 1 addition & 0 deletions docs/cloneset-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| kruise_cloneset_metadata_generation | Sequence number representing a specific generation of the desired state | STABLE |
| kruise_cloneset_status_replicas | The number of replicas per cloneset | STABLE |
| kruise_cloneset_status_replicas_available | The number of available replicas per cloneset | STABLE |
| kruise_cloneset_status_replicas_unavailable | The number of unavailable replicas per cloneset | STABLE |
| kruise_cloneset_status_replicas_updated | The number of updated replicas per cloneset | STABLE |
| kruise_cloneset_status_observed_generation | The generation observed by the cloneset controller | STABLE |
| kruise_cloneset_status_condition | The current status conditions of a cloneset | STABLE |
Expand Down
Loading

0 comments on commit b081f2a

Please sign in to comment.