Skip to content

Commit

Permalink
Correct the labels for all resources (#1497)
Browse files Browse the repository at this point in the history
* Remove the label `operator.knative.dev/release`

* Change the label app.kubernetes.io/part-of into app.kubernetes.io/name

* Remove the unused key in config-observability

* Change the script
  • Loading branch information
houshengbo authored Jul 20, 2023
1 parent f6409fc commit ce347c9
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 93 deletions.
3 changes: 1 addition & 2 deletions config/crd/bases/operator.knative.dev_knativeeventings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ kind: CustomResourceDefinition
metadata:
name: knativeeventings.operator.knative.dev
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
spec:
group: operator.knative.dev
versions:
Expand Down
3 changes: 1 addition & 2 deletions config/crd/bases/operator.knative.dev_knativeservings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ kind: CustomResourceDefinition
metadata:
name: knativeservings.operator.knative.dev
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
spec:
group: operator.knative.dev
versions:
Expand Down
3 changes: 1 addition & 2 deletions config/manager/config-logging-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ metadata:
name: config-logging
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
data:
_example: |
################################
Expand Down
32 changes: 1 addition & 31 deletions config/manager/config-observability-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ metadata:
name: config-observability
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
data:
_example: |
################################
Expand Down Expand Up @@ -50,35 +49,6 @@ data:
logging.revision-url-template: |
http://localhost:8001/api/v1/namespaces/knative-monitoring/services/kibana-logging/proxy/app/kibana#/discover?_a=(query:(match:(kubernetes.labels.serving-knative-dev%2FrevisionUID:(query:'${REVISION_UID}',type:phrase))))
# If non-empty, this enables queue proxy writing request logs to stdout.
# The value determines the shape of the request logs and it must be a valid go text/template.
# It is important to keep this as a single line. Multiple lines are parsed as separate entities
# by most collection agents and will split the request logs into multiple records.
#
# The following fields and functions are available to the template:
#
# Request: An http.Request (see https://golang.org/pkg/net/http/#Request)
# representing an HTTP request received by the server.
#
# Response:
# struct {
# Code int // HTTP status code (see https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
# Size int // An int representing the size of the response.
# Latency float64 // A float64 representing the latency of the response in seconds.
# }
#
# Revision:
# struct {
# Name string // Knative revision name
# Namespace string // Knative revision namespace
# Service string // Knative service name
# Configuration string // Knative configuration name
# PodName string // Name of the pod hosting the revision
# PodIP string // IP of the pod hosting the revision
# }
#
logging.request-log-template: '{"httpRequest": {"requestMethod": "{{.Request.Method}}", "requestUrl": "{{js .Request.RequestURI}}", "requestSize": "{{.Request.ContentLength}}", "status": {{.Response.Code}}, "responseSize": "{{.Response.Size}}", "userAgent": "{{js .Request.UserAgent}}", "remoteIp": "{{js .Request.RemoteAddr}}", "serverIp": "{{.Revision.PodIP}}", "referer": "{{js .Request.Referer}}", "latency": "{{.Response.Latency}}s", "protocol": "{{.Request.Proto}}"}, "traceId": "{{index .Request.Header "X-B3-Traceid"}}"}'
# metrics.backend-destination field specifies the system metrics destination.
# It supports either prometheus (the default) or stackdriver.
# Note: Using stackdriver will incur additional charges
Expand Down
3 changes: 0 additions & 3 deletions config/manager/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ metadata:
name: knative-operator
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/name: knative-operator
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
spec:
replicas: 1
selector:
Expand All @@ -35,7 +33,6 @@ spec:
name: knative-operator
app.kubernetes.io/name: knative-operator
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
spec:
serviceAccountName: knative-operator
containers:
Expand Down
12 changes: 4 additions & 8 deletions config/rbac/clusterrole_aggregated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ kind: ClusterRole
metadata:
name: knative-serving-operator-aggregated
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
aggregationRule:
clusterRoleSelectors:
# This (along with escalate below) allows the Operator to pick up any
Expand All @@ -34,9 +33,8 @@ kind: ClusterRole
metadata:
name: knative-serving-operator-aggregated-stable
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
aggregationRule:
clusterRoleSelectors:
# This (along with escalate below) allows the Operator to pick up any
Expand All @@ -51,9 +49,8 @@ kind: ClusterRole
metadata:
name: knative-eventing-operator-aggregated
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
aggregationRule:
clusterRoleSelectors:
# This (along with escalate below) allows the Operator to pick up any
Expand All @@ -68,9 +65,8 @@ kind: ClusterRole
metadata:
name: knative-eventing-operator-aggregated-stable
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
aggregationRule:
clusterRoleSelectors:
# This (along with escalate below) allows the Operator to pick up any
Expand Down
12 changes: 4 additions & 8 deletions config/rbac/clusterrole_aggregated_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-serving-operator-aggregated
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -34,9 +33,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-serving-operator-aggregated-stable
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -51,9 +49,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-eventing-operator-aggregated
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -68,9 +65,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-eventing-operator-aggregated-stable
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
12 changes: 4 additions & 8 deletions config/rbac/fake_clusterrole_aggregated_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-serving-operator-aggregated
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -34,9 +33,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-serving-operator-aggregated-stable
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -51,9 +49,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-eventing-operator-aggregated
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -68,9 +65,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-eventing-operator-aggregated-stable
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
3 changes: 1 addition & 2 deletions config/rbac/fake_service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ metadata:
name: knative-operator-fake
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
6 changes: 2 additions & 4 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: knative-serving-operator
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
rules:
- apiGroups:
- operator.knative.dev
Expand Down Expand Up @@ -260,9 +259,8 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: knative-eventing-operator
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
rules:
- apiGroups:
- operator.knative.dev
Expand Down
6 changes: 2 additions & 4 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-serving-operator
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -36,9 +35,8 @@ kind: ClusterRoleBinding
metadata:
name: knative-eventing-operator
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
3 changes: 1 addition & 2 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ metadata:
name: knative-operator
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
6 changes: 2 additions & 4 deletions config/rbac/webhook_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ metadata:
namespace: default
name: knative-operator-webhook
labels:
eventing.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
rules:
# For manipulating certs into secrets.
- apiGroups:
Expand All @@ -40,9 +39,8 @@ kind: ClusterRole
metadata:
name: knative-operator-webhook
labels:
eventing.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
rules:
# For watching logging configuration and getting certs.
- apiGroups:
Expand Down
6 changes: 2 additions & 4 deletions config/rbac/webhook_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ metadata:
namespace: default
name: operator-webhook
labels:
eventing.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
subjects:
- kind: ServiceAccount
name: operator-webhook
Expand All @@ -35,9 +34,8 @@ kind: ClusterRoleBinding
metadata:
name: operator-webhook
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
3 changes: 1 addition & 2 deletions config/rbac/webhook_service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ metadata:
name: operator-webhook
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
5 changes: 2 additions & 3 deletions config/webhook/webhook-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ metadata:
name: operator-webhook-certs
namespace: default
labels:
app.kubernetes.io/component: webhook
operator.knative.dev/release: devel
app.kubernetes.io/component: operator-webhook
app.kubernetes.io/version: devel
app.kubernetes.io/part-of: knative-operator
app.kubernetes.io/name: knative-operator
# The data is populated at install time.
1 change: 0 additions & 1 deletion config/webhook/webhook-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ kind: Service
metadata:
labels:
role: operator-webhook
operator.knative.dev/release: devel
app.kubernetes.io/component: operator-webhook
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-operator
Expand Down
2 changes: 0 additions & 2 deletions config/webhook/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ metadata:
name: operator-webhook
namespace: default
labels:
operator.knative.dev/release: devel
app.kubernetes.io/component: operator-webhook
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-operator
Expand All @@ -34,7 +33,6 @@ spec:
labels:
app: operator-webhook
role: operator-webhook
operator.knative.dev/release: devel
app.kubernetes.io/component: operator-webhook
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-operator
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-yamls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ rm -fr ${YAML_OUTPUT_DIR}/*.yaml
readonly OPERATOR_YAML=${YAML_OUTPUT_DIR}/operator.yaml

if [[ -n "${TAG:-}" ]]; then
LABEL_YAML_CMD=(sed -e "s|operator.knative.dev/release: devel|operator.knative.dev/release: \"${TAG}\"|" -e "s|app.kubernetes.io/version: devel|app.kubernetes.io/version: \"${TAG:1}\"|")
LABEL_YAML_CMD=(sed -e "s|app.kubernetes.io/version: devel|app.kubernetes.io/version: \"${TAG:1}\"|")
else
LABEL_YAML_CMD=(cat)
fi
Expand Down

0 comments on commit ce347c9

Please sign in to comment.