<p>I want to use curl in alertmanger pod like this:</p>
<pre><code>curl www.google.com
</code></pre>
<p>It shows <code>ash: curl: not found</code>, so I want to install curl:</p>
<pre><code>/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
</code></pre>
<p>So what should I do to install curl in this pod? this is my yaml:</p>
<pre><code>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
</code></pre>

<p>Looking at the <a href="https://github.com/prometheus/alertmanager/blob/master/Dockerfile" rel="nofollow noreferrer">Dockerfile</a> of alert manager it uses <code>busybox</code> which does not come with any package manager installed. You have two options</p>
<ol>
<li>If possible use <code>wget</code> instead of <code>curl</code></li>
<li>Modify the Dockerfile of alert manager to use <code>alpine</code> instead of <code>busybox</code> and build your own docker image from that modified Dockerfile. alpine comes with <code>apk</code> package manager which can be used to install <code>curl</code> via <code>apk add curl</code> command.</li>
</ol>
