All Projects → redradrat → aws-iam-operator

redradrat / aws-iam-operator

Licence: Apache-2.0 License
AWS IAM Operator for Kubernetes

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to aws-iam-operator

Wordpress Operator
WordPress operator for Kubernetes
Stars: ✭ 127 (+452.17%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Operators
Collection of Kubernetes Operators built with KUDO.
Stars: ✭ 175 (+660.87%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Captain
A Helm 3 Controller
Stars: ✭ 129 (+460.87%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Sens8
Kubernetes controller for Sensu checks
Stars: ✭ 42 (+82.61%)
Mutual labels:  kubernetes-operator, kubernetes-controller
kotary
Managing Kubernetes Quota with confidence
Stars: ✭ 85 (+269.57%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Spark On K8s Operator
Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Stars: ✭ 1,780 (+7639.13%)
Mutual labels:  kubernetes-operator, kubernetes-controller
cdap-operator
CDAP Kubernetes Operator
Stars: ✭ 17 (-26.09%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Operator Kit
A library for creating a Kubernetes Operator
Stars: ✭ 275 (+1095.65%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Strimzi Kafka Operator
Apache Kafka running on Kubernetes
Stars: ✭ 2,833 (+12217.39%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Rbacsync
Automatically sync groups into Kubernetes RBAC
Stars: ✭ 197 (+756.52%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Kudo
Kubernetes Universal Declarative Operator (KUDO)
Stars: ✭ 849 (+3591.3%)
Mutual labels:  kubernetes-operator, kubernetes-controller
kubereplay
Seamless integration of goReplay and Kubernetes
Stars: ✭ 30 (+30.43%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Mysql Operator
Bulletproof MySQL on Kubernetes using Percona Server
Stars: ✭ 527 (+2191.3%)
Mutual labels:  kubernetes-operator, kubernetes-controller
K8gb
A cloud native Kubernetes Global Balancer
Stars: ✭ 113 (+391.3%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Airflow Operator
Kubernetes custom controller and CRDs to managing Airflow
Stars: ✭ 278 (+1108.7%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Cronjobber
Cronjobber is a cronjob controller for Kubernetes with support for time zones
Stars: ✭ 169 (+634.78%)
Mutual labels:  kubernetes-operator, kubernetes-controller
port-map-operator
LoadBalancer Service type implementation for home Kubernetes clusters via Port Control Protocol.
Stars: ✭ 25 (+8.7%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Bonny
The Elixir based Kubernetes Development Framework
Stars: ✭ 190 (+726.09%)
Mutual labels:  kubernetes-operator, kubernetes-controller
mysql-operator
Asynchronous MySQL Replication on Kubernetes using Percona Server and Openark's Orchestrator.
Stars: ✭ 810 (+3421.74%)
Mutual labels:  kubernetes-operator, kubernetes-controller
wordpress-operator
Bitpoke Kubernetes operator for WordPress
Stars: ✭ 159 (+591.3%)
Mutual labels:  kubernetes-operator, kubernetes-controller

AWS IAM Operator

An operator that enables AWS IAM management via Kubernetes custom resources.

Installation

CRD

The CRDs can easily be applied to the cluster with kubectl:

kubectl kustomize 'github.com/redradrat/aws-iam-operator/config/crd?ref=master' | kubectl apply -f -

or for a specific GITREF (e.g. branch, tag) with:

kubectl kustomize 'github.com/redradrat/aws-iam-operator/config/crd?ref=GITREF' | kubectl apply -f -

Controllers

The controller deployment incl. RBAC & CRD can be applied to the cluster with kubectl:

kubectl kustomize 'github.com/redradrat/aws-iam-operator/config/default?ref=master' | kubectl apply -f -

Controller Manager Options

The controller manager has a couple of input options, which you can set as paramaters on container startup.

...
    spec:
      containers:
      - command:
        - /manager
        args:
        - --enable-leader-election # For HA setup
        - --resource-prefix "testcluster-" # set a prefix to all created AWS resources (e.g. "testcluster-" -> "testcluster-user")
        image: redradrat/aws-iam-operator:latest
        name: manager

Custom Resources

Role

The Role resource abstracts an AWS IAM Role.

Setting an assumeRolePolicy or an assumeRolePolicyRef is mandatory. Creating a ServiceAccount resource is possible via createServiceAccount. The created ServiceAccount includes the EKS OIDC support annotation.

apiVersion: aws-iam.redradrat.xyz/v1beta1
kind: Role
metadata:
  name: role-sample
  namespace: default
spec:
  // Either
  assumeRolePolicyRef:
    name: assumerolepolicy-sample
    namespace: default
  // OR
  assumeRolePolicy:
    - effect: "Allow"
      principal:
        "Federated": "blabla"
      actions:
        - "sts:AssumeRoleWithWebIdentity"
      conditions:
        "StringEquals":
          "blablabla": "system:serviceaccount:kube-system:aws-cluster-autoscaler"
  createServiceAccount: true
  maxSessionDuration: 3600

Resulting ServiceAccount:

❯ k get sa role-sample -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::0000000000:role/role-sample
  creationTimestamp: "2020-02-30T00:25:61Z"
  name: role-sample
  namespace: default
  ownerReferences:
  - apiVersion: aws-iam.redradrat.xyz/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: Role
    name: role-sample
    uid: ...

AssumeRolePolicy

The AssumeRolePolicy is an auxiliary resource for the Role resource. It provides a way to define a single trust policy for multiple roles.

apiVersion: aws-iam.redradrat.xyz/v1beta1
kind: AssumeRolePolicy
metadata:
  name: assumerolepolicy-sample
spec:
  statement:
    - sid: someid
      effect: "Allow"
      principal:
        "Federated": "blabla"
      actions:
        - "xxxx:DescribeSomething"
      resources:
        - "*"
      conditions:
        "StringEquals":
          "aws:SourceIp": "172.0.0.1"

Policy

The Policy resource abstracts an AWS IAM Policy.

For conditions, please check https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html for valid Operators. For the comparison, only single String-type values are allowed as comparison values. For keys please check out https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html

apiVersion: aws-iam.redradrat.xyz/v1beta1
kind: Policy
metadata:
  name: policy-sample
spec:
  statement:
    - sid: someid
      effect: "Allow"
      actions:
        - "xxxx:DescribeSomething"
      resources:
        - "*"
      conditions:
        "StringEquals":
          "aws:SourceIp": "172.0.0.1"

PolicyAttachment

The Policy resource abstracts the attachment of an AWS IAM Policy to another AWS IAM Resource e.g. Role (in future maybe User, Groups, etc.).

apiVersion: aws-iam.redradrat.xyz/v1beta1
kind: PolicyAttachment
metadata:
  name: policyattachment-sample
spec:
  policy:
    name: policy-sample
    namespace: default
  target:
    type: Role
    name: role-sample
    namespace: default

User

The User resource abstracts an AWS IAM User.

Setting createLoginProfile or an createProgrammaticAccess is optional. Creating a Secret resource, containing Console Login Data, is possible via createLoginProfile. The created secret includes the username and password. Creating a Secret resource, containing a Programmatic Access, is possible via createProgrammaticAccess. The created secret includes the both the Key ID and the Secret.

apiVersion: aws-iam.redradrat.xyz/v1beta1
kind: User
metadata:
  name: user-sample
spec:
  createLoginProfile: true
  createProgrammaticAccess: true

Resulting Secrets:

❯ k get secrets user-sample-login -o yaml
apiVersion: v1
data:
  password: ...
  username: ...
kind: Secret
metadata:
  name: user-sample-login
  namespace: default
  ownerReferences:
  - apiVersion: aws-iam.redradrat.xyz/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: User
    name: user-sample
    uid: 784d4ff5-377e-4172-a1cf-1b34387a3d6b
type: Opaque
❯ k get secret user-sample-accesskey -o yaml
apiVersion: v1
data:
  id: ...
  secret: ...
kind: Secret
metadata:
  name: user-sample-accesskey
  namespace: default
  ownerReferences:
  - apiVersion: aws-iam.redradrat.xyz/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: User
    name: user-sample
type: Opaque

Group

The Group resource abstracts an AWS IAM Group.

Adding IAM Users to the group, is possible via users. The referenced users need to be created via this operator.

apiVersion: aws-iam.redradrat.xyz/v1beta1
kind: Group
metadata:
  name: group-sample
spec:
  users:
  - name: user-sample
    namespace: default
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].