PHPackages                             benagricola/eks-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. benagricola/eks-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

benagricola/eks-auth
====================

Provides a pre-authenticated HTTPClient for consumption by existing PHP Kubernetes Client libraries

v0.0.3(5y ago)1334[1 PRs](https://github.com/benagricola/php-eks-auth/pulls)MITPHPPHP &gt;=7.3

Since Apr 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/benagricola/php-eks-auth)[ Packagist](https://packagist.org/packages/benagricola/eks-auth)[ Docs](https://github.com/benagricola/php-eks-auth)[ RSS](/packages/benagricola-eks-auth/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

PHP EKS Auth
============

[](#php-eks-auth)

This library uses the AWS V3 SDK to create an authenticated `GuzzleHttp\Client` instance that can be passed to your compatible PHP Kubernetes client (only tested with `maclof/kubernetes-client`).

All you need to authenticate with an EKS cluster is valid AWS credentials in your environment.

This library will pull the EKS endpoint details from AWS based on `$clusterName` and `$region`, using the default credential provider from `aws-sdk-php`.

The `GuzzleHttp\Client` instance will be preconfigured with a `DynamicCertificate` Middleware that writes the CA certificate of the cluster to a temporary file so it can be passed to the underlying HTTP Handler (usually Curl).

The temporary certificate file is created and deleted on every request so does not need to be cleaned up, and means connections are fully verified.

Usage
-----

[](#usage)

Require it:

```
composer require benagricola/eks-auth
```

Then use it in your project:

```
use EKSAuth\Client\Factory as ClientFactory;

# Example using maclof/kubernetes-client
use Maclof\Kubernetes\Client;

// Create a new ClientFactory.
// EKS Cluster details are cached for the
// lifetime of this Factory instance.
$cf = new ClientFactory();

// Get our client. A new Token will be generated every
// time getClient() is called.

// We pass our own function that instantiates a new
// Maclof\Kubernetes\Client instance with the
// pre-configured \GuzzleHttp\Client.
$k8s = $cf->getClient($clusterName, $region, function($httpClient) {
    return new Client([], $httpClient);
});

$namespaces = $k8s->namespaces()->find();
...
```

Note: This library only catches and re-throws an error when the requested cluster does not exist. You should wrap the `ClientFactory->getClient()` call in a `try{} catch(Exception $e){}` block to avoid throwing all sorts of errors from the underlying libraries.

Contributing
------------

[](#contributing)

Submit a pull request. I'm not a PHP dev so the codebase has no tests.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1889d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/717328?v=4)[Ben Agricola](/maintainers/benagricola)[@benagricola](https://github.com/benagricola)

---

Top Contributors

[![benagricola](https://avatars.githubusercontent.com/u/717328?v=4)](https://github.com/benagricola "benagricola (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

amazonamazon-eksauthenticationekskubernetesphpawskuberneteseksaws-eks

### Embed Badge

![Health badge](/badges/benagricola-eks-auth/health.svg)

```
[![Health](https://phpackages.com/badges/benagricola-eks-auth/health.svg)](https://phpackages.com/packages/benagricola-eks-auth)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[google/auth

Google Auth Library for PHP

1.4k294.2M216](/packages/google-auth)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.0k](/packages/league-flysystem-aws-s3-v3)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[pmill/aws-cognito

A PHP client for AWS Cognito user pools

74266.5k3](/packages/pmill-aws-cognito)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
