Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

[6.x] Move grafana dashboards into container #174

Merged
merged 2 commits into from
Jun 15, 2020

Conversation

UnderGreen
Copy link
Contributor

Backport of #172 for Gravity 6.1.x.

@UnderGreen UnderGreen requested a review from r0mant June 11, 2020 03:28
@UnderGreen UnderGreen changed the title Move grafana dashboards into container [6.x] Move grafana dashboards into container Jun 12, 2020
kubectl --namespace=monitoring patch daemonsets.apps $daemonset --type=json -p='[{"op": "replace", "path": "/metadata/managedFields", "value": [{}]}]' || true
kubectl --namespace=monitoring patch daemonsets.apps $daemonset --type=json -p='[{"op": "remove", "path": "/metadata/annotations/kubectl.kubernetes.io~1last-applied-configuration"}]' || true
done
for configmap in adapter-config grafana-cfg prometheus-k8s-rulefiles-0 grafana-dashboard-k8s-cluster-rsrc-use grafana-dashboard-k8s-resources-cluster \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it would make editing easier if we moved the resource names into respective variables

do
# || true is needed in case resources does not have last applied configuration
kubectl --namespace=monitoring patch deployments.apps $deployment --type=json -p='[{"op": "replace", "path": "/metadata/managedFields", "value": [{}]}]' || true
kubectl --namespace=monitoring patch deployments.apps $deployment --type=json -p='[{"op": "remove", "path": "/metadata/annotations/kubectl.kubernetes.io~1last-applied-configuration"}]' || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the syntax of ~1 (if that's not a typo):

/metadata/annotations/kubectl.kubernetes.io~1last-applied-configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, that's some great design on the json pointer - make it even more unreadable. Ok, I see - so basically the annotation key is encoded with a different encoder that implements RFC6901 and turns / into ~1.

@UnderGreen UnderGreen merged commit 2e2c7b7 into version/6.0.x Jun 15, 2020
@UnderGreen UnderGreen deleted the sergei/dashboards_60x branch June 15, 2020 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants