Skip to content

Commit

Permalink
Merge pull request #281 from sthaha/fix-controller-labels
Browse files Browse the repository at this point in the history
fix(deployment): do not use generic k8s labels
  • Loading branch information
vimalk78 authored Oct 20, 2023
2 parents 8cca9bb + 9e89874 commit ffcdd16
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/part-of: kepler-operator
control-plane: controller-manager
name: kepler-operator-controller-manager-metrics-monitor
spec:
endpoints:
Expand All @@ -17,4 +16,3 @@ spec:
matchLabels:
app.kubernetes.io/name: service
app.kubernetes.io/part-of: kepler-operator
control-plane: controller-manager
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ metadata:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: service
app.kubernetes.io/part-of: kepler-operator
control-plane: controller-manager
name: kepler-operator-controller-manager-metrics-service
spec:
ports:
Expand All @@ -18,6 +17,7 @@ spec:
protocol: TCP
targetPort: metrics
selector:
control-plane: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/instance: controller-manager
status:
loadBalancer: {}
13 changes: 7 additions & 6 deletions bundle/manifests/kepler-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ metadata:
capabilities: Basic Install
categories: Monitoring
containerImage: quay.io/sustainable_computing_io/kepler-operator:0.9.0
createdAt: "2023-10-13T05:19:02Z"
createdAt: "2023-10-18T07:39:41Z"
description: 'Deploys and Manages Kepler on Kubernetes '
operators.operatorframework.io/builder: operator-sdk-v1.27.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down Expand Up @@ -183,25 +183,26 @@ spec:
deployments:
- label:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: kepler-operator
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: deployment
app.kubernetes.io/part-of: kepler-operator
control-plane: controller-manager
name: kepler-operator-controller-manager
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/part-of: kepler-operator
strategy: {}
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/part-of: kepler-operator
spec:
affinity:
nodeAffinity:
Expand Down
12 changes: 6 additions & 6 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
Expand All @@ -17,24 +16,25 @@ metadata:
name: controller-manager
namespace: system
labels:
control-plane: controller-manager
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: kepler-operator
app.kubernetes.io/part-of: kepler-operator
app.kubernetes.io/managed-by: kustomize
spec:
selector:
matchLabels:
control-plane: controller-manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/part-of: kepler-operator
replicas: 1
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/part-of: kepler-operator
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,26 @@ spec:
deployments:
- label:
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: kepler-operator
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: deployment
app.kubernetes.io/part-of: kepler-operator
control-plane: controller-manager
name: kepler-operator-controller-manager
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/part-of: kepler-operator
strategy: {}
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/part-of: kepler-operator
spec:
affinity:
nodeAffinity:
Expand Down
2 changes: 0 additions & 2 deletions config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/instance: controller-manager-metrics-monitor
app.kubernetes.io/component: metrics
Expand All @@ -20,4 +19,3 @@ spec:
matchLabels:
app.kubernetes.io/name: service
app.kubernetes.io/part-of: kepler-operator
control-plane: controller-manager
4 changes: 2 additions & 2 deletions config/rbac/auth_proxy_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
Expand All @@ -18,4 +17,5 @@ spec:
protocol: TCP
targetPort: metrics
selector:
control-plane: controller-manager
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
2 changes: 2 additions & 0 deletions must-gather/gather
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ main() {
esac

BASE_COLLECTION_PATH="${1:-/must-gather}"
# NOTE: convert relative to absolute path
BASE_COLLECTION_PATH="$(readlink -f "$BASE_COLLECTION_PATH")"
export LOGFILE_PATH="${BASE_COLLECTION_PATH}/${LOGFILE_NAME}"

mkdir -p "${BASE_COLLECTION_PATH}"
Expand Down
10 changes: 8 additions & 2 deletions must-gather/gather-kepler-operator-info
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ get_kepler_operator_deployment_info() {

get_kepler_operator_pod_info() {
log "getting pod info for kepler-operator"
run oc -n "$KEPLER_OPERATOR_NS" get pod -l control-plane=controller-manager -oyaml "$KEPLER_OPERATOR_INFO_DIR/kepler-operator.yaml"
run oc -n "$KEPLER_OPERATOR_NS" get pod \
-l app.kubernetes.io/component=manager \
-l app.kubernetes.io/part-of=kepler-operator \
-oyaml "$KEPLER_OPERATOR_INFO_DIR/kepler-operator.yaml"
}

get_summary() {
Expand All @@ -72,7 +75,10 @@ get_summary() {
run oc -n "$KEPLER_OPERATOR_NS" get deployment "$KEPLER_OPERATOR_DEPLOY" -owide "$KEPLER_OPERATOR_INFO_DIR/summary.txt"
echo -e "\n" >>"$KEPLER_OPERATOR_INFO_DIR/summary.txt"

run oc -n "$KEPLER_OPERATOR_NS" get pod -l control-plane=controller-manager -owide "$KEPLER_OPERATOR_INFO_DIR/summary.txt"
run oc -n "$KEPLER_OPERATOR_NS" get pod \
-l app.kubernetes.io/component=manager \
-l app.kubernetes.io/part-of=kepler-operator \
-owide "$KEPLER_OPERATOR_INFO_DIR/summary.txt"
}

main() {
Expand Down

0 comments on commit ffcdd16

Please sign in to comment.