Skip to content

Commit

Permalink
backendtlspolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ygnas committed Oct 12, 2023
1 parent e949a4e commit 9dfc198
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 96 deletions.
11 changes: 1 addition & 10 deletions config/default/custom-resource-state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -607,13 +607,4 @@ spec:
target_group: ["group"]
target_kind: ["kind"]
target_name: ["name"]
target_namespace: ["namespace"]
- name: "status"
help: "status condition"
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
type: ["type"]
valueFrom: ["status"]
target_namespace: ["namespace"]
68 changes: 7 additions & 61 deletions config/examples/dashboards/policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"description": "Total number of TLSPolicy across all clusters",
"gridPos": {
"h": 3,
"w": 4,
"w": 2,
"x": 0,
"y": 1
},
Expand Down Expand Up @@ -61,8 +61,8 @@
"gridPos": {
"h": 3,
"w": 2,
"x": 0,
"y": 2
"x": 2,
"y": 1
},
"id": 3,
"pluginVersion": "v10.0.0",
Expand Down Expand Up @@ -150,7 +150,7 @@
"description": "Total number of RateLimitPolicy across all clusters",
"gridPos": {
"h": 3,
"w": 4,
"w": 2,
"x": 0,
"y": 3
},
Expand Down Expand Up @@ -178,8 +178,8 @@
"gridPos": {
"h": 3,
"w": 2,
"x": 0,
"y": 4
"x": 2,
"y": 3
},
"id": 7,
"pluginVersion": "v10.0.0",
Expand Down Expand Up @@ -259,60 +259,6 @@
"title": "BackendTLSPolicy",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"description": "Total number of BackendTLSPolicy across all clusters",
"gridPos": {
"h": 3,
"w": 4,
"x": 0,
"y": 9
},
"id": 10,
"pluginVersion": "v10.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"expr": "count(gatewayapi_Available_status)",
"instant": true
}
],
"title": "Total",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"description": "Total BackendTLSPolicy with an Available state",
"gridPos": {
"h": 3,
"w": 2,
"x": 0,
"y": 9
},
"id": 11,
"pluginVersion": "v10.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "$datasource"
},
"expr": "count(gatewayapi_backendtlspolicy_status{type=\"Available\"})",
"instant": true
}
],
"title": "Available",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
Expand All @@ -324,7 +270,7 @@
"x": 4,
"y": 9
},
"id": 12,
"id": 10,
"pluginVersion": "v10.0.0",
"targets": [
{
Expand Down
2 changes: 1 addition & 1 deletion config/examples/dashboards/policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spec:
matchLabels:
dashboards: "grafana"
json: >
{"editable":false,"links":[{"asDropdown":false,"includeVars":true,"keepTime":true,"tags":["gateway-api-state"],"targetBlank":false,"title":"Gateway Dashboards","type":"dashboards"}],"panels":[{"gridPos":{"h":1,"w":24,"x":0,"y":0},"id":1,"title":"TLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of TLSPolicy across all clusters","gridPos":{"h":3,"w":4,"x":0,"y":1},"id":2,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_tlspolicy_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total TLSPolicy with an Ready state","gridPos":{"h":3,"w":2,"x":0,"y":2},"id":3,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_tlspolicy_status{type=\"Ready\"})","instant":true}],"title":"Ready","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":1},"id":4,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tlspolicy_target_info","format":"table","instant":true,"range":false}],"title":"TLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":2},"id":5,"title":"RateLimitPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of RateLimitPolicy across all clusters","gridPos":{"h":3,"w":4,"x":0,"y":3},"id":6,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total RateLimitPolicy with an Available state","gridPos":{"h":3,"w":2,"x":0,"y":4},"id":7,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status{type=\"Available\"})","instant":true}],"title":"Available","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":7},"id":8,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_ratelimitpolicy_target_info","format":"table","instant":true,"range":false}],"title":"RateLimitPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":8},"id":9,"title":"BackendTLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of BackendTLSPolicy across all clusters","gridPos":{"h":3,"w":4,"x":0,"y":9},"id":10,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_Available_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total BackendTLSPolicy with an Available state","gridPos":{"h":3,"w":2,"x":0,"y":9},"id":11,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_backendtlspolicy_status{type=\"Available\"})","instant":true}],"title":"Available","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":9},"id":12,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_backendtlspolicy_target_info","format":"table","instant":true,"range":false}],"title":"BackendTLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"}],"schemaVersion":36,"style":"dark","tags":["gateway-api","gateway-api-state"],"templating":{"list":[{"label":"Data Source","name":"datasource","query":"prometheus","type":"datasource"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"TLSPolicy","multi":true,"name":"tlspolicy","query":{"query":"label_values(gatewayapi_tlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"RateLimitPolicy","multi":true,"name":"ratelimitpolicy","query":{"query":"label_values(gatewayapi_ratelimitpolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"BackendTLSPolicy","multi":true,"name":"backendtlspolicy","query":{"query":"label_values(gatewayapi_backendtlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"}]},"time":{"from":"now-1h","to":"now"},"timezone":"utc","title":"Gateway API State / Policies","uid":"gatewayapipolicies"}
{"editable":false,"links":[{"asDropdown":false,"includeVars":true,"keepTime":true,"tags":["gateway-api-state"],"targetBlank":false,"title":"Gateway Dashboards","type":"dashboards"}],"panels":[{"gridPos":{"h":1,"w":24,"x":0,"y":0},"id":1,"title":"TLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of TLSPolicy across all clusters","gridPos":{"h":3,"w":2,"x":0,"y":1},"id":2,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_tlspolicy_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total TLSPolicy with an Ready state","gridPos":{"h":3,"w":2,"x":2,"y":1},"id":3,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_tlspolicy_status{type=\"Ready\"})","instant":true}],"title":"Ready","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":1},"id":4,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_tlspolicy_target_info","format":"table","instant":true,"range":false}],"title":"TLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":2},"id":5,"title":"RateLimitPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total number of RateLimitPolicy across all clusters","gridPos":{"h":3,"w":2,"x":0,"y":3},"id":6,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status)","instant":true}],"title":"Total","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"description":"Total RateLimitPolicy with an Available state","gridPos":{"h":3,"w":2,"x":2,"y":3},"id":7,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"count(gatewayapi_ratelimitpolicy_status{type=\"Available\"})","instant":true}],"title":"Available","type":"stat"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":7},"id":8,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_ratelimitpolicy_target_info","format":"table","instant":true,"range":false}],"title":"RateLimitPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"},{"gridPos":{"h":1,"w":24,"x":0,"y":8},"id":9,"title":"BackendTLSPolicy","type":"row"},{"datasource":{"type":"prometheus","uid":"$datasource"},"gridPos":{"h":6,"w":10,"x":4,"y":9},"id":10,"pluginVersion":"v10.0.0","targets":[{"datasource":{"type":"prometheus","uid":"$datasource"},"expr":"gatewayapi_backendtlspolicy_target_info","format":"table","instant":true,"range":false}],"title":"BackendTLSPolicy","transformations":[{"id":"filterFieldsByName","options":{"include":{"names":["name","target_kind","target_name"]}}},{"id":"organize","options":{"renameByName":{"name":"Name","target_kind":"Target Kind","target_name":"Target Name"}}}],"type":"table"}],"schemaVersion":36,"style":"dark","tags":["gateway-api","gateway-api-state"],"templating":{"list":[{"label":"Data Source","name":"datasource","query":"prometheus","type":"datasource"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"TLSPolicy","multi":true,"name":"tlspolicy","query":{"query":"label_values(gatewayapi_tlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"RateLimitPolicy","multi":true,"name":"ratelimitpolicy","query":{"query":"label_values(gatewayapi_ratelimitpolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"},{"datasource":{"type":"prometheus","uid":"${datasource}"},"includeAll":true,"label":"BackendTLSPolicy","multi":true,"name":"backendtlspolicy","query":{"query":"label_values(gatewayapi_backendtlspolicy_created, name)","refId":"StandardVariableQuery"},"regex":"/(.*)/","type":"query"}]},"time":{"from":"now-1h","to":"now"},"timezone":"utc","title":"Gateway API State / Policies","uid":"gatewayapipolicies"}
8 changes: 4 additions & 4 deletions config/examples/enterprise/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ spec:
kind: Service
name: grafana-service
tls:
hostname: grafana.example.com
caCertRefs:
- group: ""
name: "grafana"
kind: "Service"
kind: "ConfigMap"
hostname: grafana.example.com
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: BackendTLSPolicy
Expand All @@ -741,11 +741,11 @@ spec:
kind: Service
name: kubernetes
tls:
hostname: kubernetes.example.com
caCertRefs:
- group: ""
name: "kubernetes"
kind: "Service"
kind: "ConfigMap"
hostname: kubernetes.example.com
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
Expand Down
9 changes: 0 additions & 9 deletions config/examples/kube-prometheus/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1601,15 +1601,6 @@ data:
target_kind: ["kind"]
target_name: ["name"]
target_namespace: ["namespace"]
- name: "status"
help: "status condition"
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
type: ["type"]
valueFrom: ["status"]
kind: ConfigMap
metadata:
name: custom-resource-state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ spec:
- hostname
type: object
x-kubernetes-validations:
- message: must not contain both CertRefs and StandardCerts
rule: (has(self.caCertRefs) && size(self.caCertRefs) > 0 && has(self.wellKnownCACerts)
&& self.wellKnownCACerts != "")
- message: must specify either CertRefs or StandardCerts
rule: '!(has(self.caCertRefs) && size(self.caCertRefs) > 0 || has(self.wellKnownCACerts)
- message: must not contain both CaCertRefs and WellKnownCACerts
rule: '(has(self.caCertRefs) && size(self.caCertRefs) > 0 || has(self.wellKnownCACerts)
&& self.wellKnownCACerts != "")'
- message: must specify either CaCertRefs or WellKnownCACerts
rule: '!(has(self.caCertRefs) && size(self.caCertRefs) > 0 && has(self.wellKnownCACerts)
&& self.wellKnownCACerts != "")'
required:
- targetRef
Expand Down
1 change: 1 addition & 0 deletions config/gateway-api/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ resources:
- crd/standard/gateway.networking.k8s.io_tcproutes.yaml
- crd/standard/gateway.networking.k8s.io_tlsroutes.yaml
- crd/standard/gateway.networking.k8s.io_udproutes.yaml
- crd/standart/gateway.networking.k8s.io_backendtlspolicies.yaml
# From https://github.com/kubernetes-sigs/gateway-api/blob/v0.6.2/config/crd/kustomization.yaml
10 changes: 4 additions & 6 deletions src/dashboards/policies.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ gwapi.dashboard('Policies', 'gatewayapipolicies', [
])
+ g.dashboard.withPanels([
gwapi.row('TLSPolicy', 1, 24, 0, 0),
gwapi.stat('Total', 3, 4, 0, 1, 'Total number of TLSPolicy across all clusters', 'count(gatewayapi_tlspolicy_status)'),
gwapi.stat('Ready', 3, 2, 0, 2, 'Total TLSPolicy with an Ready state', 'count(gatewayapi_tlspolicy_status{type="Ready"})'),
gwapi.stat('Total', 3, 2, 0, 1, 'Total number of TLSPolicy across all clusters', 'count(gatewayapi_tlspolicy_status)'),
gwapi.stat('Ready', 3, 2, 2, 1, 'Total TLSPolicy with an Ready state', 'count(gatewayapi_tlspolicy_status{type="Ready"})'),
gwapi.policyPanel('TLSPolicy',6,10,4,1,'gatewayapi_tlspolicy_target_info'),
gwapi.row('RateLimitPolicy', 1, 24, 0, 2),
gwapi.stat('Total', 3, 4, 0, 3, 'Total number of RateLimitPolicy across all clusters', 'count(gatewayapi_ratelimitpolicy_status)'),
gwapi.stat('Available', 3, 2, 0, 4, 'Total RateLimitPolicy with an Available state', 'count(gatewayapi_ratelimitpolicy_status{type="Available"})'),
gwapi.stat('Total', 3, 2, 0, 3, 'Total number of RateLimitPolicy across all clusters', 'count(gatewayapi_ratelimitpolicy_status)'),
gwapi.stat('Available', 3, 2, 2, 3, 'Total RateLimitPolicy with an Available state', 'count(gatewayapi_ratelimitpolicy_status{type="Available"})'),
gwapi.policyPanel('RateLimitPolicy',6,10,4,7,'gatewayapi_ratelimitpolicy_target_info'),
gwapi.row('BackendTLSPolicy', 1, 24, 0, 8),
gwapi.stat('Total', 3, 4, 0, 9, 'Total number of BackendTLSPolicy across all clusters', 'count(gatewayapi_Available_status)'),
gwapi.stat('Available', 3, 2, 0, 9, 'Total BackendTLSPolicy with an Available state', 'count(gatewayapi_backendtlspolicy_status{type="Available"})'),
gwapi.policyPanel('BackendTLSPolicy',6,10,4,9,'gatewayapi_backendtlspolicy_target_info'),
])

0 comments on commit 9dfc198

Please sign in to comment.