Skip to content

Commit

Permalink
Merge pull request #1310 from lilic/merge-2.0-release
Browse files Browse the repository at this point in the history
Merge release-2.0 branch into master after release
  • Loading branch information
k8s-ci-robot committed Nov 20, 2020
2 parents 662d59e + bd9fa88 commit eba9142
Show file tree
Hide file tree
Showing 76 changed files with 529 additions and 708 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ linters:
linters-settings:
goimports:
local-prefixes: k8s.io/kube-state-metrics
gocyclo:
# temporary until we refactor the pod function
min-complexity: 128

issues:
exclude-use-default: false
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v2.0.0-alpha.3 / 2020-11-19

* [BUGFIX] Fix container resource limits metrics, which got dropped #1293
* [BUGFIX] Adjust and refactor allowing labels to work for Kubernetes labels metrics #1301
Note this is a breaking change, if you were using --labels-allow-list, look at the PR details for more information.

## v2.0.0-alpha.2 / 2020-10-27

* [CHANGE] Migrate ingress and certificates to new stable APIs #1260
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kub
|--------------------|---------------------|---------------------|----------------------|----------------------|----------------------|
| **v1.8.0** || - | - | - | - |
| **v1.9.7** | - || - | - | - |
| **v2.0.0-alpha.2** | - | - | -/✓ | -/✓ ||
| **v2.0.0-alpha.3** | - | - | -/✓ | -/✓ ||
| **master** | - | - | -/✓ | -/✓ ||
- `` Fully supported version range.
- `-` The Kubernetes cluster has features the client-go library can't use (additional API objects, deprecated APIs, etc).
Expand All @@ -86,8 +86,8 @@ release.
#### Container Image

The latest container image can be found at:
* `quay.io/coreos/kube-state-metrics:v2.0.0-alpha.2` (arch: `amd64`)
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0-alpha.2` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
* `quay.io/coreos/kube-state-metrics:v2.0.0-alpha.3` (arch: `amd64`)
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0-alpha.3` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)

### Metrics Documentation

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-alpha.2
2.0.0-alpha.3
60 changes: 30 additions & 30 deletions docs/cli-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,34 @@ spec:
```txt
$ kube-state-metrics -h
Usage of ./kube-state-metrics:
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
--apiserver string The URL of the apiserver to use as a master
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
-h, --help Print Help text
--host string Host to expose metrics on. (default "0.0.0.0")
--kubeconfig string Absolute path to the kubeconfig file
--labels-allow-list string list of metric names and labels you would like to allow, metric_name=[label1,labeln...],metric_name[]...
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files (default true)
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
--namespaces string Comma-separated list of namespaces to be enabled. Defaults to ""
--pod string Name of the pod that contains the kube-state-metrics container. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--pod-namespace string Name of the namespace of the pod specified by --pod. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--port int Port to expose metrics on. (default 8080)
--resources string Comma-separated list of Resources to be enabled. Defaults to "certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments"
--shard int32 The instances shard nominal (zero indexed) within the total number of shards. (default 0)
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--telemetry-host string Host to expose kube-state-metrics self metrics on. (default "0.0.0.0")
--telemetry-port int Port to expose kube-state-metrics self metrics on. (default 8081)
--total-shards int The total number of shards. Sharding is disabled when total shards is set to 1. (default 1)
-v, --v Level number for the log level verbosity
--version kube-state-metrics build version information
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
--apiserver string The URL of the apiserver to use as a master
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
-h, --help Print Help text
--host string Host to expose metrics on. (default "0.0.0.0")
--kubeconfig string Absolute path to the kubeconfig file
--labels-metric-allow-list string Allows to pass a list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=["k8s-label-1","k8s-label-n",...],pods=["app"],...)'
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files (default true)
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
--namespaces string Comma-separated list of namespaces to be enabled. Defaults to ""
--pod string Name of the pod that contains the kube-state-metrics container. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--pod-namespace string Name of the namespace of the pod specified by --pod. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--port int Port to expose metrics on. (default 8080)
--resources string Comma-separated list of Resources to be enabled. Defaults to "certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments"
--shard int32 The instances shard nominal (zero indexed) within the total number of shards. (default 0)
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--telemetry-host string Host to expose kube-state-metrics self metrics on. (default "0.0.0.0")
--telemetry-port int Port to expose kube-state-metrics self metrics on. (default 8081)
--total-shards int The total number of shards. Sharding is disabled when total shards is set to 1. (default 1)
-v, --v Level number for the log level verbosity
--version kube-state-metrics build version information
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
2 changes: 1 addition & 1 deletion examples/autosharding/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
rules:
- apiGroups:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Role
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
rules:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
2 changes: 1 addition & 1 deletion examples/autosharding/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
spec:
Expand Down
6 changes: 3 additions & 3 deletions examples/autosharding/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -16,7 +16,7 @@ spec:
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
spec:
containers:
- args:
Expand All @@ -31,7 +31,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: quay.io/coreos/kube-state-metrics:v2.0.0-alpha.2
image: quay.io/coreos/kube-state-metrics:v2.0.0-alpha.3
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
rules:
- apiGroups:
Expand Down
6 changes: 3 additions & 3 deletions examples/standard/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -15,10 +15,10 @@ spec:
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
spec:
containers:
- image: quay.io/coreos/kube-state-metrics:v2.0.0-alpha.2
- image: quay.io/coreos/kube-state-metrics:v2.0.0-alpha.3
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
2 changes: 1 addition & 1 deletion examples/standard/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.2
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
spec:
Expand Down
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/google/go-jsonnet v0.14.0
github.com/jsonnet-bundler/jsonnet-bundler v0.4.1-0.20200708074244-ada055a225fa
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/oklog/run v1.1.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1
Expand All @@ -20,11 +21,11 @@ require (
github.com/spf13/pflag v1.0.5
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 // indirect
golang.org/x/tools v0.0.0-20200305205014-bc073721adb6
k8s.io/api v0.19.2
k8s.io/apimachinery v0.19.2
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054
k8s.io/api v0.19.3
k8s.io/apimachinery v0.19.3
k8s.io/autoscaler/vertical-pod-autoscaler v0.0.0-20200727194258-b7922d74509c
k8s.io/client-go v0.19.2
k8s.io/client-go v0.19.3
k8s.io/klog/v2 v2.2.0
)

Expand Down
Loading

0 comments on commit eba9142

Please sign in to comment.