我在亚马逊网络服务中运行openshift Origin3.6( kube v1.6.1+5115d708d7)。Ansible inventory包含云提供商配置,我可以在主节点上看到配置文件。
# From inventory
# AWS
openshift_cloudprovider_kind=aws
openshift_cloudprovider_aws_access_key="{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
openshift_cloudprovider_aws_secret_key="{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"我还提供了一个storageclass
# oc get storageclass
NAME TYPE
fast (default) kubernetes.io/aws-ebs但是,当我尝试创建pvc时:
kind: "PersistentVolumeClaim"
apiVersion: "v1"
metadata:
name: "testclaim"
namespace: testns
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "3Gi"
storageClassName: fast它只是在无限循环中尝试创建pvc。事件显示此错误:
(combined from similar events): Failed to provision volume with StorageClass "fast": UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message: $(encoded-message) status code: 403, request id: d0742e84-a2e1-4bfd-b642-c6f1a61ddc1b不幸的是,我无法使用aws cli解码编码的消息,因为它给出了错误。
aws sts decode-authorization-message -–encoded-message $(encoded-message)
Error: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal我还没有尝试创建pv+pvc,因为我正在寻找动态预配置。任何关于我可能做错了什么的指导。
到目前为止,我已经能够部署pods、服务等,它们似乎工作得很好。
发布于 2017-11-23 02:11:08
该错误似乎是AWS IAM错误:
UnauthorizedOperation
您没有权限执行此操作。检查您的IAM策略,并确保使用正确的访问密钥。有关详细信息,请参阅控制访问。如果返回的消息是编码的,您可以使用DecodeAuthorizationMessage操作对其进行解码。有关更多信息,请参阅AWS Security Token Service API参考中的DecodeAuthorizationMessage。
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html#CommonErrors
您需要创建适当的IAM策略:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ExamplePolicies_EC2.html#iam-example-manage-volumes
https://stackoverflow.com/questions/47290240
复制相似问题