Panfactum LogoPanfactum
Getting StartedConnect to Infrastructure

Connect to Infrastructure

Objective

Retrieve credentials for connecting to the various components of your organization's infrastructure.

User Provisioning

To access live infrastructure, you must first have an account in your organization's identity provider (IdP). 1 This account with be used to sign in to all service providers.

If your organization's administrators have not already provisioned your account, ask them now. You will need to follow this guide to set up your user for the first time.

Once your user is provisioned, make sure you are able to access your organization's Authentik dashboard: 2

Authentik dashboard

The applications you see will vary based on your organization's settings.

Accessing AWS

If your organization granted you AWS access, you should see AWS in your Authentik dashboard. You can click on the app to get brought to the access portal showing your individual account access:

AWS access portal

Your visible accounts and roles will vary based on your organization's settings.

AWS CLI Access

These accounts and roles are already available for use inside your local repository. They are configured under the aws_dir directory (defaults to .aws).

Access is made available via AWS CLI/SDK profiles. You can view all your organization's profiles by running aws configure list-profiles.

Each profile is of the format <account>-<role>.

You may not have access to all of your organization's profiles. Check the access portal to see which accounts and roles you can use.

You can set your active profile by setting the AWS_PROFILE environment variable (e.g., export AWS_PROFILE=<your_profile>) or by passing the --profile <your_profile> flag to the aws CLI.

Let's confirm this works:

  1. Set AWS_PROFILE to a profile you have access to.

  2. Run aws sso login to complete the single sign-on verification.

  3. Run aws sts get-caller-identity. This should successfully return a result that looks like this:

    891377197483    arn:aws:sts::891377197483:assumed-role/AWSReservedSSO_Superuser_ed8b0abf4bb50ae8/jack@panfactum.com     AROA47CRYUGV33VTVQCPO:jack@panfactum.com
    

Accessing Kubernetes

For each AWS account that you have access to, you can view the information about their deployed Kubernetes clusters via the Web UI: 3

  1. Log into an account

  2. Navigate to the appropriate AWS region (top right dropdown)

  3. Navigate to the Elastic Kubernetes Service (EKS) page (via the search box)

  4. Select a cluster

  5. You should see a dashboard that looks like this:

    EKS dashboard

Kubernetes CLI Access

The above dashboard is read-only. If you want to make changes to your cluster, you will need to access your clusters from the CLI. This will require setting up your kubeconfig file.

We provide an easy way to do this by performing the following actions within your organization's repository:

  1. Copy the config.user.example.yaml file in your kube_dir folder (defaults to .kube) to config.user.yaml.

  2. Update the config.user.yaml to include the clusters you want to access and what AWS profile you want to use for that access. See the reference docs for the specific syntax.

  3. Run pf-update-kube to create your kubeconfig file.

  4. Select a cluster context by running kubectx.

  5. Run kubectl cluster-info and you should see a successful result like the following:

    Kubernetes control plane is running at https://83063DDB274B2A04B6A7DC29DCB1740E.gr7.us-east-2.eks.amazonaws.com
    CoreDNS is running at https://83063DDB274B2A04B6A7DC29DCB1740E.gr7.us-east-2.eks.amazonaws.com/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
    
    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
    

In the Panfactum stack, we highly recommend k9s as the tool for interactively interfacing with your Kubernetes clusters. We will reference it often in our documentation, so you should gain familiarity.

Launch it now via k9s:

EKS dashboard

Next Steps

🎉 You are now all set up to begin working with live infrastructure in the Panfactum stack. 🎉

Here are some ideas for next steps:

Previous
Getting Started Guide:
Step 4 /4

Footnotes

  1. The IdP itself should have already been provisioned in the bootstrapping guide. ↩

  2. If you are not sure the URL, ask an organization administrator or refer to your organization's internal documentation. ↩

  3. You can see what accounts and regions your clusters are deployed to by examining the environments_dir folder in your repository (defaults to environments). Search for aws_eks module folders. Ask an organization administrator if your need further guidance. ↩