A Kubernetes controller for managing KCP users through AWS Cognito integration. This controller creates and manages User
custom resources and automatically provisions users in AWS Cognito User Pools.
- 🚀 Automated User Management: Create, update, and delete users in AWS Cognito via Kubernetes CRDs
- 🔐 AWS Cognito Integration: Seamless integration with AWS Cognito User Pools
- 📦 Multi-platform Docker Images: Support for AMD64 and ARM64 architectures
- 🤖 Automated Releases: CI/CD pipeline with automatic versioning and Docker image publishing
- 🔧 Kubernetes Native: Built using controller-runtime framework
- Go 1.24+
- Kubernetes 1.11+
- AWS Cognito User Pool configured
- AWS credentials configured (IAM role, access keys, or instance profile)
The controller is available as a multi-platform Docker image:
docker pull ghcr.io/cogniteo/kcp-users-controller:latest
- Clone the repository:
git clone https://github.com/Cogniteo/kcp-users-controller.git
cd kcp-users-controller
- Build and install CRDs:
make install
- Deploy the controller:
make deploy IMG=ghcr.io/cogniteo/kcp-users-controller:latest
Configure AWS credentials and Cognito settings through environment variables or Kubernetes secrets:
env:
- name: AWS_REGION
value: "us-west-2"
- name: COGNITO_USER_POOL_ID
value: "us-west-2_example"
# Add other AWS configuration as needed
Create a User
custom resource:
apiVersion: kcp.cogniteo.io/v1alpha1
kind: User
metadata:
name: john-doe
namespace: default
spec:
email: [email protected]
username: johndoe
temporaryPassword: TempPass123!
# Additional user attributes
Apply the resource:
kubectl apply -f user-example.yaml
The controller will automatically:
- Create the user in AWS Cognito User Pool
- Set the temporary password
- Update the User resource status
List all users:
kubectl get users
Get detailed information:
kubectl describe user john-doe
Delete a user (this will also remove it from Cognito):
kubectl delete user john-doe
- Install dependencies:
go mod tidy
- Run tests:
make test
- Run the controller locally:
make run
Build the binary:
make build
Build Docker image:
make docker-build IMG=your-registry/kcp-users-controller:tag
Field | Type | Description |
---|---|---|
email |
string | User's email address |
username |
string | Username for the user |
temporaryPassword |
string | Temporary password (optional) |
attributes |
map[string]string | Additional user attributes |
Field | Type | Description |
---|---|---|
cognitoStatus |
string | Status in Cognito (CONFIRMED, UNCONFIRMED, etc.) |
conditions |
[]Condition | Current conditions of the user |
This project uses automated semantic versioning. Releases are automatically created when:
feat:
commits trigger minor version bumpsfix:
commits trigger patch version bumpsBREAKING CHANGE:
commits trigger major version bumps
Docker images are automatically built and pushed to ghcr.io/cogniteo/kcp-users-controller
with each release.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass:
make test
- Submit a pull request
Follow conventional commits:
feat: add new feature
fix: resolve bug
docs: update documentation
chore: maintenance tasks
Licensed under the Apache License, Version 2.0. See LICENSE for details.
For issues and questions: