首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在kubernetes的警报管理器吊舱安装卷曲

如何在kubernetes的警报管理器吊舱安装卷曲
EN

Stack Overflow用户
提问于 2020-09-13 04:15:53
回答 1查看 1.2K关注 0票数 5

我想在警报器舱里用卷发,就像这样:

代码语言:javascript
复制
curl www.google.com

它显示了ash: curl: not found,所以我想安装curl:

代码语言:javascript
复制
/alertmanager # apk add curl
ash: apk: not found
/alertmanager # yum install curl
ash: yum: not found
/alertmanager # apt install curl
ash: apt: not found
/alertmanager # apt-get install curl
ash: apt-get: not found

那么我该怎么做才能在这个吊舱里安装卷曲呢?这是我的yaml:

代码语言:javascript
复制
kind: Deployment
apiVersion: apps/v1
metadata:
  name: alertmanager
  namespace: kube-system
  labels:
    addonmanager.kubernetes.io/mode: Reconcile
    k8s-app: alertmanager
    kubernetes.io/cluster-service: 'true'
    version: v0.14.0
  annotations:
    deployment.kubernetes.io/revision: '1'
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: alertmanager
      version: v0.14.0
  template:
    metadata:
      creationTimestamp: null
      labels:
        k8s-app: alertmanager
        version: v0.14.0
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ''
    spec:
      volumes:
        - name: config-volume
          configMap:
            name: alertmanager-config
            defaultMode: 420
        - name: storage-volume
          persistentVolumeClaim:
            claimName: alertmanager
      containers:
        - name: prometheus-alertmanager
          image: 'prom/alertmanager:v0.14.0'
          args:
            - '--config.file=/etc/config/alertmanager.yml'
            - '--storage.path=/data'
            - '--web.external-url=/'
          ports:
            - containerPort: 9093
              protocol: TCP
          resources:
            limits:
              cpu: 10m
              memory: 50Mi
            requests:
              cpu: 10m
              memory: 50Mi
          volumeMounts:
            - name: config-volume
              mountPath: /etc/config
            - name: storage-volume
              mountPath: /data
          readinessProbe:
            httpGet:
              path: '/#/status'
              port: 9093
              scheme: HTTP
            initialDelaySeconds: 30
            timeoutSeconds: 30
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
        - name: prometheus-alertmanager-configmap-reload
          image: 'jimmidyson/configmap-reload:v0.1'
          args:
            - '--volume-dir=/etc/config'
            - '--webhook-url=http://localhost:9093/-/reload'
          resources:
            limits:
              cpu: 10m
              memory: 10Mi
            requests:
              cpu: 10m
              memory: 10Mi
          volumeMounts:
            - name: config-volume
              readOnly: true
              mountPath: /etc/config
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
      priorityClassName: system-cluster-critical
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-09-13 05:29:45

查看警报管理器的Dockerfile,它使用的是没有安装任何包管理器的busybox。你有两个选择

  1. 如果可能的话,使用wget而不是curl
  2. 修改警报管理器的Dockerfile以使用alpine而不是busybox,并从修改后的Dockerfile构建您自己的停靠程序映像。阿尔卑斯附带了apk包管理器,可以通过apk add curl命令安装curl
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63867090

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档