2017-05-16 58 views
0

我试图在我的kubernetes集群上部署logstash。我使用k8s v1.6.1和calico作为网络。找不到目标区域:找不到MYWEBSITEURLHERE.com的区域:AccessDenied:

我有被吊舱旋转起来,但似乎无法注册DNS的问题,我已经剥夺我的域名为安全起见:

route53-kubernetes-551223410-wf89w route53-kubernetes W0516 19:47:32.715753  1 service_listener.go:151] Couldn't find destination zone: No zone found for MYWEBSITEURLHERE.com: AccessDenied: User: arn:aws:sts::056146032236:assumed-role/nodes.k8s-uw2.MYWEBSITEURLHERE.com/i-01cac4656e7ee0c4e is not authorized to perform: route53:ListHostedZonesByName 
route53-kubernetes-551223410-wf89w route53-kubernetes status code: 403, request id: 809c62fa-3a70-11e7-bccf-9daca39d7850 

现在奇怪的是,我已经证实,IAM creds已经正确安装了该角色:

{ 
    "RoleName": "nodes.k8s-uw2.MYWEBSITEURLHERE.com", 
    "PolicyDocument": { 
     "Statement": [ 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "*" 
       ], 
       "Action": [ 
        "ec2:Describe*" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "*" 
       ], 
       "Action": [ 
        "elasticloadbalancing:DescribeLoadBalancers" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "*" 
       ], 
       "Action": [ 
        "ecr:GetAuthorizationToken", 
        "ecr:BatchCheckLayerAvailability", 
        "ecr:GetDownloadUrlForLayer", 
        "ecr:GetRepositoryPolicy", 
        "ecr:DescribeRepositories", 
        "ecr:ListImages", 
        "ecr:BatchGetImage" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "arn:aws:route53:::hostedzone/Z1ILWH3JAW6GTW" 
       ], 
       "Action": [ 
        "route53:ChangeResourceRecordSets", 
        "route53:ListResourceRecordSets", 
        "route53:GetHostedZone", 
        "route53:ListHostedZonesByName" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "arn:aws:route53:::change/*" 
       ], 
       "Action": [ 
        "route53:GetChange" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "*" 
       ], 
       "Action": [ 
        "route53:ListHostedZones" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "arn:aws:s3:::k8s-uw2-sightmachine-com-state-store/k8s-uw2.MYWEBSITEURLHERE.com", 
        "arn:aws:s3:::k8s-uw2-sightmachine-com-state-store/k8s-uw2.MYWEBSITEURLHERE.com/*" 
       ], 
       "Action": [ 
        "s3:*" 
       ] 
      }, 
      { 
       "Effect": "Allow", 
       "Resource": [ 
        "arn:aws:s3:::k8s-uw2-sightmachine-com-state-store" 
       ], 
       "Action": [ 
        "s3:GetBucketLocation", 
        "s3:ListBucket" 
       ] 
      } 
     ], 
     "Version": "2012-10-17" 
    }, 
    "PolicyName": "nodes.k8s-uw2.MYWEBSITEURLHERE.com" 
} 

还有什么是奇数是我能够创建我elasticsearch服务以及kibana和那些都工作得不错。这只是我的logstash服务不够好。

这里是我的logstash服务定义:

apiVersion: v1 
kind: Service 
metadata: 
    name: logstash 
    namespace: inf 
    labels: 
    app: logstash 
    component: server 
    role: monitoring 
    dns: route53 
    annotations: 
    domainName: logstash.k8s-uw2.MYWEBSITEURLHERE.com 
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 
spec: 
    type: LoadBalancer 
    selector: 
    app: logstash 
    component: server 
    role: monitoring 
    ports: 
    - name: lumberjack 
    port: 5043 
    protocol: TCP 
    - name: beats 
    port: 5044 
    protocol: TCP 
    - name: http 
    port: 31311 
    protocol: TCP 

这里是我的elasticsearch服务定义:

apiVersion: v1 
kind: Service 
metadata: 
    name: elasticsearch 
    namespace: inf 
    labels: 
    app: elasticsearch 
    component: client 
    role: monitoring 
    dns: route53 
    annotations: 
     domainName: elasticsearch.k8s-uw2.sightmachine.com 
     service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 
spec: 
    type: LoadBalancer 
    selector: 
    app: elasticsearch 
    component: client 
    role: monitoring 
    ports: 
    - name: http 
    port: 9200 
    protocol: TCP 

我还证实,ZONE ID确实是正确的。

任何帮助将非常感谢,因为这是从传统设置中抽象出来,更难以调试。

回答

0

这个问题的解决只是为了增加访问控制的允许量,这样反而使得这一角色颗粒,如:

"arn:aws:route53:::hostedzone/Z1ILWH3JAW6GTW" 
"arn:aws:route53:::change/*" 

变成了:

*