weaveworks / eks-quickstart-app-dev

Example flux manifests for eksctl gitops
Other
56 stars 43 forks source link

Fix: Error: Couldn't find key logs.region in ConfigMap amazon-cloudwatch/cluster-info #10

Closed marccarre closed 5 years ago

marccarre commented 5 years ago

Follows up on #3.

Why?

Fixes:

Error: Couldn't find key logs.region in ConfigMap amazon-cloudwatch/cluster-info

Besides, this is what is generated by the command mentioned in the Amazon documentation: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs.html#ContainerInsights-install-FluentD

$ kubectl create configmap cluster-info \
>     --from-literal=cluster.name=${CLUSTER} \
>     --from-literal=logs.region=${REGION} -n amazon-cloudwatch
configmap/cluster-info created

$ kubectl get cm cluster-info -n amazon-cloudwatch -o yaml
apiVersion: v1
data:
  cluster.name: ${CLUSTER}
  logs.region: ${REGION}
kind: ConfigMap
metadata:
  name: cluster-info
  namespace: amazon-cloudwatch

See also: https://github.com/weaveworks/eks-gitops-example/pull/3/files#r317047875

Before

$ kubectl get po --all-namespaces
NAMESPACE              NAME                                                      READY   STATUS                       RESTARTS   AGE
[...]
amazon-cloudwatch      fluentd-cloudwatch-7fncs                                  0/1     CreateContainerConfigError   0          4m26s
[...]
$ kubectl -n amazon-cloudwatch describe po fluentd-cloudwatch-7fncs
[...]
  Warning  Failed     2m40s (x8 over 3m53s)  kubelet, ip-192-168-95-53.ap-northeast-1.compute.internal  Error: Couldn't find key logs.region in ConfigMap amazon-cloudwatch/cluster-info
[...]

After

$ kubectl get po -n amazon-cloudwatch
NAME                       READY   STATUS             RESTARTS   AGE
[...]
fluentd-cloudwatch-7fncs   1/1     Running            0          31m