Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improvements for the EKS Discover UI. #38609

Merged
merged 4 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/integrations/awsoidc/eks_enroll_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func enrollEKSCluster(ctx context.Context, log logrus.FieldLogger, clock clockwo
if alreadyInstalled, err := clt.CheckAgentAlreadyInstalled(ctx, kubeClientGetter, log); err != nil {
return "", trace.Wrap(err, "could not check if teleport-kube-agent is already installed.")
} else if alreadyInstalled {
// Web UI relies on the text of this error message. If changed, sync with EnrollEksCluster.tsx
return "", trace.AlreadyExists("teleport-kube-agent is already installed on the cluster %q", clusterName)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import React, { useState, useCallback } from 'react';
import { Box, ButtonSecondary, ButtonText, Text, Toggle } from 'design';
import { Box, ButtonSecondary, ButtonText, Link, Text, Toggle } from 'design';
import styled from 'styled-components';
import { FetchStatus } from 'design/DataTable/types';
import { Danger } from 'design/Alert';
Expand Down Expand Up @@ -218,7 +218,12 @@ export function EnrollEksCluster(props: AgentStepProps) {
emitErrorEvent(
'unknown error: no results came back from enrolling the EKS cluster.'
);
} else if (result.error) {
} else if (
result.error &&
!result.error.message.includes(
'teleport-kube-agent is already installed on the cluster'
)
) {
setEnrollmentState({
status: 'error',
error: `Cluster enrollment error: ${result.error}`,
Expand Down Expand Up @@ -294,6 +299,17 @@ export function EnrollEksCluster(props: AgentStepProps) {
<Danger mt={3}>{fetchClustersAttempt.statusText}</Danger>
)}
<Text mt={4}>
<b>Note:</b> EKS enrollment will work only with clusters that have
access entries authentication mode enabled, see{' '}
<Link
href="https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html#authentication-modes"
target="_blank"
color="text.main"
>
documentation.
</Link>
</Text>
<Text mt={1}>
Select the AWS Region you would like to see EKS clusters for:
</Text>
<AwsRegionSelector
Expand Down Expand Up @@ -346,7 +362,7 @@ export function EnrollEksCluster(props: AgentStepProps) {
}}
pl={0}
>
Or click here to see instructions for manual enrollment
Or enroll manually
</ButtonText>
</Box>
</StyledBox>
Expand Down
Loading