-
Notifications
You must be signed in to change notification settings - Fork 21
[6.x] Move grafana dashboards into container #174
Conversation
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 \ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~
is the way to replace /
in annotation key name:
https://stackoverflow.com/a/55575415
https://tools.ietf.org/html/rfc6901#section-3
There was a problem hiding this comment.
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
.
Backport of #172 for Gravity 6.1.x.