I have tried to deploy alertmanager service on a taint node by defining tolerations explicityl.
apiVersion: apps/v1
kind: Deployment
metadata:
name: alertmanager
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app: alertmanager
template:
metadata:
name: alertmanager
labels:
app: alertmanager
spec:
tolerations:
- key: "prometheusnew"
operator: "Equal"
value: "false"
effect: "NoExecute"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: placement_affinity
operator: In
values:
- prometheusnew
containers:
- name: alertmanager
image: prom/alertmanager:v0.15.3
args:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
ports:
- name: alertmanager
containerPort: 9093
volumeMounts:
- name: config-volume
mountPath: /etc/alertmanager
- name: alertmanager
mountPath: /alertmanager
volumes:
- name: config-volume
configMap:
name: alertmanager
- name: alertmanager
emptyDir: {}
The cluster ip 172.30.148.104 is accessible from the same node but the pods and service ip is not accessible from any other nodes or pods in different node.
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
alertmanager ClusterIP 172.30.148.104 <none> 9093/TCP 20m
Pods are running fine and if deploy without taint tolerations it works fine. Appreciate any help, thanks.