Conversation
Added boto3 to setup.py requirements Added eks engine Added eks kubeconfig template
| 'ACTIVE': config.get('CLUSTER_OK_STATE'), | ||
| 'DELETING': config.get('CLUSTER_DEPROVISIONING_STATE'), | ||
| 'FAILED': config.get('CLUSTER_ERROR_STATE'), | ||
| 'UPDATED': config.get('CLUSTER_UPDATING_STATE') |
There was a problem hiding this comment.
@ekhomyakova I suppose those names comes from EKS, but I don't see updating in the list at all, so may be we can just remove updated from the list
There was a problem hiding this comment.
for what i know the engine requires an updating state, so either we leave it or we need to put it to unknown
| 'number': True | ||
| } | ||
| }, | ||
| 'roleArn': { |
There was a problem hiding this comment.
It's better to use snake_case everywhere
| 'required': True | ||
| } | ||
| }, | ||
| 'subnetid': { |
| 'required': True | ||
| } | ||
| }, | ||
| 'securitygroupid': { |
There was a problem hiding this comment.
security_group_id or securitygroup_id
| except Exception as e: | ||
| msg = 'Creating cluster {} failed with the following reason:'.format(self.cluster.id) | ||
| logger.exception(msg) | ||
| return False, msg |
There was a problem hiding this comment.
Please, return only "e" instead of msg, since message will be huge and looks like:
Error occurred with the following reason: Creating cluster failed with the following reason:'
| def engine_status(cls, **kwargs): | ||
| try: | ||
| aws_access_key = kwargs.get('aws_access_key', '') | ||
| aws_secret_key = kwargs.get('aws_secret_key', '') |
There was a problem hiding this comment.
did you mean 'aws_secret_access_key'?
| 'ACTIVE': config.get('CLUSTER_OK_STATE'), | ||
| 'DELETING': config.get('CLUSTER_DEPROVISIONING_STATE'), | ||
| 'FAILED': config.get('CLUSTER_ERROR_STATE'), | ||
| 'UPDATED': config.get('CLUSTER_UPDATING_STATE') |
There was a problem hiding this comment.
@ekhomyakova I suppose those names comes from EKS, but I don't see updating in the list at all, so may be we can just remove updated from the list
| """ | ||
| Implementation of :func:`~kqueen.engines.base.BaseEngine.provision` | ||
| """ | ||
| # self.name = kwargs.get('name', 'noname') |
| return {} | ||
| state = STATE_MAP.get(response['cluster']['status'], config.get('CLUSTER_UNKNOWN_STATE')) | ||
|
|
||
| key = 'cluster-{}-{}'.format(response['cluster']['name'], response['cluster']['name']) |
There was a problem hiding this comment.
why names are used two times?
There was a problem hiding this comment.
one of them should be the id, but EKS uses the name as id at the moment, the only other option is to use the ARN which is extremely long arn:aws:eks:us-west-2:012345678910:cluster/prod
| try: | ||
| response = self.client.describe_cluster(self.cluster.metadata['id']) | ||
| except Exception as e: | ||
| msg = 'Fetching data from backend for cluster {} failed with the following reason:'.format(self.cluster.metadata['heat_cluster_id']) |
There was a problem hiding this comment.
self.cluster.metadata['id']
| }, | ||
| 'subnetid': { | ||
| 'type': 'text', | ||
| 'label': 'Subnet Id', |
There was a problem hiding this comment.
Subnet/s Id - since more than one can be chosen. Ideally we need to get list of them and provide ability to pick subnets on the fly, but for now we need to parse string to the list at least (on the UI part)
| aws_secret_access_key=aws_secret_key | ||
| ) | ||
| try: | ||
| list(client.list_clusters()) |
There was a problem hiding this comment.
can we used more lightweight request here? (since this request is sending for each cluster, even for list all clusters operation)
- at least add maxResults parameter=1
- or use another request maybe generate_presigned_url?
There was a problem hiding this comment.
seems, No , coz afaik only list_clusters can provide valid check on all required User IAM roles/policies and etc.. I understand that its huge request, but we are locked by small api
- Template structure defined - Kubeconfig download fixed - Cluster states fixed - Engine status fixed - TODO added current issue related with kqueen-k8s-api methods: ``` api_1 | Traceback (most recent call last): api_1 | File "/code/kqueen/models.py", line 124, in status api_1 | 'addons': kubernetes.list_services(filter_addons=True), api_1 | File "/code/kqueen/kubeapi.py", line 238, in list_services api_1 | include_uninitialized=include_uninitialized api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/apis/core_v1_api.py", line 14358, in list_service_for_all_namespaces api_1 | (data) = self.list_service_for_all_namespaces_with_http_info(**kwargs) api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/apis/core_v1_api.py", line 14455, in list_service_for_all_namespaces_with_http_info api_1 | collection_formats=collection_formats) api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api_client.py", line 321, in call_api api_1 | _return_http_data_only, collection_formats, _preload_content, _request_timeout) api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api_client.py", line 155, in __call_api api_1 | _request_timeout=_request_timeout) api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api_client.py", line 342, in request api_1 | headers=headers) api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/rest.py", line 231, in GET api_1 | query_params=query_params) api_1 | File "/usr/local/lib/python3.6/site-packages/kubernetes/client/rest.py", line 222, in request api_1 | raise ApiException(http_resp=r) api_1 | kubernetes.client.rest.ApiException: (403) ``` faced when try to parse k8s config body
Refactor EKS
- Typo fixes in EKS engine
Docs added
katyafervent
left a comment
There was a problem hiding this comment.
Please, add new pipfile.lock
| }, | ||
| 'cluster': { | ||
| 'node_count': { | ||
| # TODO unsupported, need to define template k8s input |
There was a problem hiding this comment.
I suggest to comment node_count then
| - "-i" | ||
| - "<cluster-name>" | ||
| # - "-r" | ||
| # - "<role-arn>" |
There was a problem hiding this comment.
is it suppose to be commented?
Heptio Auth configuration
|
related issue kubernetes-client/python#514 |
naumvd95
left a comment
There was a problem hiding this comment.
lets say I'm ok with that, but in fact I just want to hide this PR from my notifications tab :)
naumvd95
left a comment
There was a problem hiding this comment.
lets say I'm ok with that, but in fact I just want to hide this PR from my notifications tab :)
current issue related with kqueen-k8s-api methods:
faced when try to parse k8s config body