jsonnet: code cleanup
This commit is contained in:
@@ -137,9 +137,9 @@ function(params) {
|
||||
{ name: 'web', targetPort: 'web', port: 9093 },
|
||||
{ name: 'reloader-web', port: am._config.reloaderPort, targetPort: 'reloader-web' },
|
||||
],
|
||||
selector: {
|
||||
selector: am._config.selectorLabels {
|
||||
alertmanager: am._config.name,
|
||||
} + am._config.selectorLabels,
|
||||
},
|
||||
sessionAffinity: 'ClientIP',
|
||||
},
|
||||
},
|
||||
@@ -150,9 +150,9 @@ function(params) {
|
||||
metadata: am._metadata,
|
||||
spec: {
|
||||
selector: {
|
||||
matchLabels: {
|
||||
matchLabels: am._config.selectorLabels {
|
||||
alertmanager: am._config.name,
|
||||
} + am._config.selectorLabels,
|
||||
},
|
||||
},
|
||||
endpoints: [
|
||||
{ port: 'web', interval: '30s' },
|
||||
@@ -168,9 +168,9 @@ function(params) {
|
||||
spec: {
|
||||
maxUnavailable: 1,
|
||||
selector: {
|
||||
matchLabels: {
|
||||
matchLabels: am._config.selectorLabels {
|
||||
alertmanager: am._config.name,
|
||||
} + am._config.selectorLabels,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -189,11 +189,11 @@ function(params) {
|
||||
version: am._config.version,
|
||||
image: am._config.image,
|
||||
podMetadata: {
|
||||
labels: am._metadata.labels,
|
||||
labels: am.alertmanager.metadata.labels,
|
||||
},
|
||||
resources: am._config.resources,
|
||||
nodeSelector: { 'kubernetes.io/os': 'linux' },
|
||||
serviceAccountName: am._metadata.name,
|
||||
serviceAccountName: am.serviceAccount.metadata.name,
|
||||
securityContext: {
|
||||
runAsUser: 1000,
|
||||
runAsNonRoot: true,
|
||||
|
||||
@@ -213,7 +213,9 @@ function(params) {
|
||||
metadata: bb._metadata,
|
||||
spec: {
|
||||
replicas: bb._config.replicas,
|
||||
selector: { matchLabels: bb._config.selectorLabels },
|
||||
selector: {
|
||||
matchLabels: bb._config.selectorLabels
|
||||
},
|
||||
template: {
|
||||
metadata: {
|
||||
labels: bb._config.commonLabels,
|
||||
|
||||
@@ -143,7 +143,9 @@ function(params) (import 'github.com/kubernetes/kube-state-metrics/jsonnet/kube-
|
||||
metadata: ksm._metadata,
|
||||
spec: {
|
||||
jobLabel: 'app.kubernetes.io/name',
|
||||
selector: { matchLabels: ksm._config.selectorLabels },
|
||||
selector: {
|
||||
matchLabels: ksm._config.selectorLabels
|
||||
},
|
||||
endpoints: [
|
||||
{
|
||||
port: 'https-main',
|
||||
|
||||
@@ -209,7 +209,9 @@ function(params) {
|
||||
kind: 'DaemonSet',
|
||||
metadata: ne._metadata,
|
||||
spec: {
|
||||
selector: { matchLabels: ne._config.selectorLabels },
|
||||
selector: {
|
||||
matchLabels: ne._config.selectorLabels
|
||||
},
|
||||
updateStrategy: {
|
||||
type: 'RollingUpdate',
|
||||
rollingUpdate: { maxUnavailable: '10%' },
|
||||
|
||||
@@ -232,7 +232,9 @@ function(params) {
|
||||
metadata: pa._metadata,
|
||||
spec: {
|
||||
replicas: pa._config.replicas,
|
||||
selector: { matchLabels: pa._config.selectorLabels },
|
||||
selector: {
|
||||
matchLabels: pa._config.selectorLabels
|
||||
},
|
||||
strategy: {
|
||||
rollingUpdate: {
|
||||
maxSurge: 1,
|
||||
|
||||
@@ -120,11 +120,11 @@ function(params) {
|
||||
roleRef: {
|
||||
apiGroup: 'rbac.authorization.k8s.io',
|
||||
kind: 'Role',
|
||||
name: 'prometheus-' + p._config.name,
|
||||
name: p._metadata.name,
|
||||
},
|
||||
subjects: [{
|
||||
kind: 'ServiceAccount',
|
||||
name: 'prometheus-' + p._config.name,
|
||||
name: p.serviceAccount.metadata.name,
|
||||
namespace: p._config.namespace,
|
||||
}],
|
||||
};
|
||||
@@ -236,9 +236,9 @@ function(params) {
|
||||
spec: {
|
||||
minAvailable: 1,
|
||||
selector: {
|
||||
matchLabels: {
|
||||
matchLabels: p._config.selectorLabels {
|
||||
prometheus: p._config.name,
|
||||
} + p._config.selectorLabels,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -255,11 +255,11 @@ function(params) {
|
||||
version: p._config.version,
|
||||
image: p._config.image,
|
||||
podMetadata: {
|
||||
labels: p._metadata.labels,
|
||||
labels: p.prometheus.metadata.labels,
|
||||
},
|
||||
externalLabels: p._config.externalLabels,
|
||||
enableFeatures: p._config.enableFeatures,
|
||||
serviceAccountName: p._metadata.name,
|
||||
serviceAccountName: p.serviceAccount.metadata.name,
|
||||
podMonitorSelector: {},
|
||||
podMonitorNamespaceSelector: {},
|
||||
probeSelector: {},
|
||||
|
||||
Reference in New Issue
Block a user