appmesh-prometheus

by Helm

Helm chartv1.0.3App 2.13.1

App Mesh Prometheus Helm chart for Kubernetes

About this chart

App Mesh Prometheus

App Mesh Prometheus Helm chart for Kubernetes

Prerequisites

  • Kubernetes >= 1.13

Installing the Chart

Add the EKS repository to Helm:

helm repo add eks https://aws.github.io/eks-charts

Install App Mesh Prometheus:

helm upgrade -i appmesh-prometheus eks/appmesh-prometheus \
--namespace appmesh-system

Optional: Persist your data
If you do not persist your Prometheus data, then it will only exist as long as the Prometheus pod is running. For Prometheus persistent storage, you need to use PersistentVolumeClaim.
As for the volume plugin, we use EBS CSI Driver as an example, but you can use other popular volume plugins like NFS, Ceph etc.
In configuration, replace your-appmesh-cluster as your EKS appmesh cluster name and your-aws-account as your AWS account ID.

Enable EBS CSI Driver:

  • Initialize iam-oidc-provider
eksctl utils associate-iam-oidc-provider --region=us-west-2 --cluster=your-appmesh-cluster --approve
  • Create IAM role
eksctl create iamserviceaccount \
  --name ebs-csi-controller-sa \
  --namespace kube-system \
  --cluster your-appmesh-cluster \
  --attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \
  --approve \
  --role-only \
  --role-name AmazonEKS_EBS_CSI_DriverRole
  • Addon the EBS driver to running cluster.
eksctl create addon --name aws-ebs-csi-driver --cluster your-appmesh-cluster --service-account-role-arn arn:aws:iam::your-aws-account:role/AmazonEKS_EBS_CSI_DriverRole --force

More details: https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: prometheus
  namespace: appmesh-system
  labels:
    app.kubernetes.io/name: appmesh-prometheus
spec:
  storageClassName: gp2
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Gi
EOF
helm upgrade -i appmesh-prometheus eks/appmesh-prometheus \
--namespace appmesh-system \
--set retention=12h \
--set persistentVolumeClaim.claimName=prometheus

The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the appmesh-prometheus deployment:

helm delete appmesh-prometheus --namespace appmesh-system

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following tables lists the configurable parameters of the chart and their default values.

ParameterDescriptionDefault
image.repositoryimage repositoryprom/prometheus
image.tagimage tag<VERSION>
image.pullPolicyimage pull policyIfNotPresent
resources.requests/cpupod CPU request100m
resources.requests/memorypod memory request256Mi
resources.limits/cpupod CPU limit2000m
resources.limits/memorypod memory limit2Gi
affinitynode/pod affinitiesNone
nodeSelectornode labels for pod assignment{}
tolerationslist of node taints to tolerate[]
rbac.createif true, create and use RBAC resourcestrue
rbac.pspEnabledif true, create and use a restricted pod security policyfalse
serviceAccount.createif true, create a new service accounttrue
serviceAccount.nameservice account to be usedNone
retentionwhen to remove old data6h
scrapeIntervalinterval between consecutive scrapes5s
persistentVolumeClaim.claimNamespecify an existing volume claim to be used for Prometheus dataNone
remoteWrite.enabledif true, write prometheus metrics to an external locationfalse
remoteWrite.urlthe url of the endpoint to send samples toNone
remoteWrite.bearer_tokenbearer tokenNone

Troubleshooting

If the Prometheus port does not open properly, first determine if the Pod is functioning properly. The following is an not ready example:

kubectl -n appmesh-system get deploy,po,svc
NAME                                 READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/appmesh-controller   1/1     1            1           42m
deployment.apps/appmesh-prometheus   0/1     1            0           33m

NAME                                      READY   STATUS    RESTARTS   AGE
pod/appmesh-controller-6dcf8c7787-zgh7w   1/1     Running   0          42m
pod/appmesh-prometheus-6d6ffbb888-5644r   0/1     Pending   0          30m

NAME                                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/appmesh-controller-webhook-service   ClusterIP   10.100.96.3     <none>        443/TCP    42m
service/appmesh-prometheus                   ClusterIP   10.100.53.248   <none>        9090/TCP   33m

If the Pod status is unhealthy and you use PVC for persistent storage, first check the status of the PVC, and check the log in event:

kubectl describe pvc -n appmesh-system

If the problem is not solved, check the node's resource deployment, memory and CPU limits:

kubectl describe nodes

If the node doesn't have enough resources, you can try scaling the cluster.

Deploy appmesh-prometheus with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has appmesh-prometheus on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartappmesh-prometheus is pinned at v1.0.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply