Skip to content

Commit e706f9f

Browse files
committed
inline kube-prometheus-stack values in deploy script for ARM
1 parent 51e72c4 commit e706f9f

File tree

1 file changed

+102
-1
lines changed

1 file changed

+102
-1
lines changed

api/kubernetes/deploy_via_helm.sh

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,108 @@ if [[ "${DEPLOY_PROMETHEUS_STACK:-false}" == "true" ]]; then
469469
PROM_CPU_MEM_REQUESTS_VAR=${PROM_CPU_MEM_REQUESTS:-"2Gi"} \
470470
PROM_REPLICAS_NUMBER_VAR=${PROM_REPLICAS_NUMBER:-"1"} \
471471
PROM_ADMIN_PASSWORD_VAR=${PROM_ADMIN_PASSWORD:-$(date +%s | sha256sum | base64 | head -c 32)} \
472-
envsubst < "${HELM_CHARTS_BASE_PATH}"/kube-prometheus-stack-template.yaml > kube-prometheus-stack.yaml
472+
# Cannot use kube-prometheus-stack.yaml here directly since ARM only download deploy_via_helm.sh
473+
# envsubst < "${HELM_CHARTS_BASE_PATH}"/kube-prometheus-stack-template.yaml > kube-prometheus-stack.yaml
474+
475+
cat <<EOF > kube-prometheus-stack.yaml
476+
namespace: $MONITORING_NAMESPACE_VAR
477+
name: cosmotech-api-latest
478+
defaultRules:
479+
create: false
480+
alertmanager:
481+
enabled: false
482+
grafana:
483+
enabled: true
484+
adminPassword: $PROM_ADMIN_PASSWORD_VAR
485+
defaultDashboardsEnabled: false
486+
tolerations:
487+
- key: "vendor"
488+
operator: "Equal"
489+
value: "cosmotech"
490+
effect: "NoSchedule"
491+
nodeSelector:
492+
"cosmotech.com/tier": "monitoring"
493+
kubeApiServer:
494+
enabled: false
495+
kubelet:
496+
enabled: false
497+
kubeControllerManager:
498+
enabled: false
499+
coreDns:
500+
enabled: false
501+
kubeEtcd:
502+
enabled: false
503+
kubeScheduler:
504+
enabled: false
505+
kubeStateMetrics:
506+
enabled: false
507+
nodeExporter:
508+
enabled: false
509+
prometheusOperator:
510+
tolerations:
511+
- key: "vendor"
512+
operator: "Equal"
513+
value: "cosmotech"
514+
effect: "NoSchedule"
515+
nodeSelector:
516+
"cosmotech.com/tier": "monitoring"
517+
prometheus:
518+
enabled: true
519+
crname: prometheus
520+
serviceAccount:
521+
create: true
522+
name: prometheus-service-account
523+
prometheusSpec:
524+
logLevel: info
525+
replicas: $PROM_REPLICAS_NUMBER_VAR
526+
tolerations:
527+
- key: "vendor"
528+
operator: "Equal"
529+
value: "cosmotech"
530+
effect: "NoSchedule"
531+
nodeSelector:
532+
"cosmotech.com/tier": "monitoring"
533+
podMetadata:
534+
annotations:
535+
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
536+
labels:
537+
app: prometheus
538+
resources:
539+
limits:
540+
cpu: 1
541+
memory: $PROM_CPU_MEM_LIMITS_VAR
542+
requests:
543+
cpu: 1
544+
memory: $PROM_CPU_MEM_REQUESTS_VAR
545+
retention: 12h
546+
serviceMonitorSelector:
547+
matchLabels:
548+
serviceMonitorSelector: prometheus
549+
storageSpec:
550+
volumeClaimTemplate:
551+
spec:
552+
storageClassName: $PROM_STORAGE_CLASS_NAME_VAR
553+
accessModes:
554+
- ReadWriteOnce
555+
resources:
556+
requests:
557+
storage: $PROM_STORAGE_RESOURCE_REQUEST_VAR
558+
additionalServiceMonitors:
559+
- name: cosmotech-latest
560+
additionalLabels:
561+
serviceMonitorSelector: prometheus
562+
endpoints:
563+
- interval: 30s
564+
targetPort: 8081
565+
path: /actuator/prometheus
566+
namespaceSelector:
567+
matchNames:
568+
- phoenix
569+
selector:
570+
matchLabels:
571+
app.kubernetes.io/instance: cosmotech-api-latest
572+
573+
EOF
473574

474575
helm upgrade --install prometheus-operator prometheus-community/kube-prometheus-stack \
475576
--namespace "${MONITORING_NAMESPACE}" \

0 commit comments

Comments
 (0)