-
Notifications
You must be signed in to change notification settings - Fork 9
Description
@sukumarsengott aws_auth_config.py is failing with the following error:
Exception when calling CoreV1Api->create_namespaced_config_map: (401)
Reason: Unauthorized
Here are the complete lambda failure logs:
-k8s-api-1-cluster', 'aws:cloudformation:logical-id': 'ControlPlane', 'alpha.eksctl.io/cluster-name': 'kumo-k8s-api-1', 'aws:cloudformation:stack-id': 'arn:aws:cloudformation:us-east-1:707082674943:stack/eksctl-kumo-k8s-api-1-cluster/db268900-ae82-11ec-b5c9-0a3629edb87f', 'alpha.eksctl.io/eksctl-version': '0.66.0', 'eksctl.cluster.k8s.io/v1alpha1/cluster-name': 'kumo-k8s-api-1'}}}
eks cluster endpoint= https://95A5BA33EC1CA7A25E692CD78839A057.sk1.us-east-1.eks.amazonaws.com
completed creating kube config file.
accessing k8s api through client:
aws auth configMap:{'api_version': 'v1',
'binary_data': None,
'data': {'mapRoles': '- rolearn: '
'arn:aws:iam::707082674943:role/eksctl-kumo-k8s-api-1-cluster-ServiceRole-1XLD1K3X4GENE\n'
' username: system:node:{{EC2PrivateDNSName}}\n'
' groups:\n'
' - system:bootstrappers\n'
' - system:nodes\n'
'- rolearn: '
'arn:aws:iam::707082674943:role/mic-SAMLAdmin\n'
' username: mic-SAMLAdmin\n'
' groups:\n'
' - system:masters\n',
'mapUsers': '- userarn: '
'arn:aws:iam::707082674943:user/[email protected]\n'
' username: [email protected]\n'
' groups:\n'
' - system:masters\n'},
'kind': 'ConfigMap',
'metadata': {'annotations': None,
'cluster_name': None,
'creation_timestamp': None,
'deletion_grace_period_seconds': None,
'deletion_timestamp': None,
'finalizers': None,
'generate_name': None,
'generation': None,
'initializers': None,
'labels': None,
'managed_fields': None,
'name': 'aws-auth',
'namespace': 'kube-system',
'owner_references': None,
'resource_version': None,
'self_link': None,
'uid': None}}
Exception when calling CoreV1Api->create_namespaced_config_map: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Audit-Id': '7a1dceb4-116e-4ae3-8edb-d49239593704', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Mon, 28 Mar 2022 12:30:15 GMT', 'Content-Length': '129'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
[ERROR] ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Audit-Id': '7a1dceb4-116e-4ae3-8edb-d49239593704', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Mon, 28 Mar 2022 12:30:15 GMT', 'Content-Length': '129'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 26, in lambda_handler
apply_aws_auth_config_map(aws_session, REGION, account_id, CLUSTER_NAME, CFG_MAP_USER_NAME, CFG_MAP_ROLE_NAME,
File "/var/task/aws_eks_k8s_client.py", line 49, in apply_aws_auth_config_map
apply_configmap(v1, configmapObj)
File "/var/task/aws_auth_config.py", line 68, in apply_configmap
api_response = client_api_instance.create_namespaced_config_map(
File "/var/task/kubernetes/client/api/core_v1_api.py", line 5594, in create_namespaced_config_map
(data) = self.create_namespaced_config_map_with_http_info(namespace, body, **kwargs) # noqa: E501
File "/var/task/kubernetes/client/api/core_v1_api.py", line 5671, in create_namespaced_config_map_with_http_info
return self.api_client.call_api(
File "/var/task/kubernetes/client/api_client.py", line 340, in call_api
return self.__call_api(resource_path, method,
File "/var/task/kubernetes/client/api_client.py", line 172, in __call_api
response_data = self.request(
File "/var/task/kubernetes/client/api_client.py", line 382, in request
return self.rest_client.POST(url,
File "/var/task/kubernetes/client/rest.py", line 272, in POST
return self.request("POST", url,
File "/var/task/kubernetes/client/rest.py", line 231, in request
raise ApiException(http_resp=r)END RequestId: 2765ecc4-6d10-4918-b71e-0596ce25067e
REPORT RequestId: 2765ecc4-6d10-4918-b71e-0596ce25067e Duration: 1517.64 ms Billed Duration: 1518 ms Memory Size: 128 MB Max Memory Used: 127 MB Init Duration: 2560.88 ms