Giter Club home page Giter Club logo

cmmc's People

Contributors

bakayolo avatar dependabot[bot] avatar jonwinton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cmmc's Issues

feature: Custom Validators (webhooks)

Currently, cmmc only supports doing JSONSchema validation.

It would be nice to support something like a custom validators via some syntax in the MergeTarget like:

   # ....
   data: 
     key:
       validator:
         url: <...>

For this to be usable, this should also have a proto definition of a request/response spec of a sort.

CMMC fails merging `mapRoles` and `mapUsers` at the same time

I have a config map with mapRoles and mapUsers define that I want CMMC to merge in the aws-auth configmap. Unfortunately, it only merge the mapUsers and ignore the mapRoles.


Here is my configmap CMMC will grab

apiVersion: v1
data:
  mapRoles: |
    - "groups":
      - "system:masters"
      "rolearn": "arn:aws:iam::261357321482:role/shuffle-labs-atlantis-dev-ecs_task_execution"
      "username": "atlantis"
  mapUsers: |
    - "groups":
      - "system:masters"
      "userarn": "arn:aws:iam::261357321482:user/ben"
      "username": "ben"
kind: ConfigMap
metadata:
  annotations:
    config.cmmc.k8s.cash.app/watched-by-merge-source: kube-system/aws-auth-map-users
  labels:
    cmmc.k8s.cash.app/merge: aws-auth-map
  name: aws-auth-mapping-cmmc
  namespace: kube-system

Here is the merged aws-auth configmap

apiVersion: v1
data:
  mapRoles: |
    - groups:
      - system:bootstrappers
      - system:nodes
      rolearn: arn:aws:iam::261357321482:role/shuffle-labs-private_eks-dev-eks-node
      username: system:node:{{EC2PrivateDNSName}}
  mapUsers: |
    - "groups":
      - "system:masters"
      "userarn": "arn:aws:iam::261357321482:user/ben"
      "username": "ben"
kind: ConfigMap
metadata:
  annotations:
    config.cmmc.k8s.cash.app/managed-by-merge-target: kube-system/kube-system-aws-auth
  name: aws-auth
  namespace: kube-system

Controller test cleanup

After #10, the controller tests are fairly brittle and hard to change/read. Need to invest some time into cleaning them up so they are easier to understand.

jsonSchemaFromRef

Currently, we support adding JSONSchema as a field that is an inlined string, it would be nice to also be able to reference a ConfigMap here so it can be managed separately.

This is not super important, but can be a nice to have.

docs: Metrics

Document the custom metrics that are emitted by CMMC.

sourceGauge: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "cmmc_resource_sources",
Help: "Number of sources per resource.",
},
[]string{"kind", "namespace", "name"},
),
conditionGauge: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "cmmc_resource_condition",
Help: "The current condition of the CMMC Resource.",
},
[]string{"kind", "namespace", "name", "type", "status"},
),
}
}

docs/feature: How to deploy

I wanna use cmmc for managing my eks auth but I did not find any information explaining how to deploy it on a kubernetes cluster.
Is there any guide I can follow?
Thanks

Permissive mode for MergeTarget?

Currently, once a MergeTarget manages a ConfigMap, any changes to the managed resource will be overwritten by CMMC. It might be useful to allow a permissive mode to the MergeTarget (probably per key), so that a change to the target, as long as it doesn't intersect with anything that CMMC is writing, will be persisted.

Rough notes here on how this could work during reconciliation:

  • we do all target CM data manipulation in MergeTarget.ReduceDataState
  • While the output of the target config map is deterministic generally, the order of the merge depends on the order of the MergeSourceList, and we can make sure that this has a deterministic order as well (a subtask).
  • If that merge order is deterministic, we should be able to do some simpler diffing to see what features has been added/removed given the prior Init state.
  • We probably want to update the Init state to reflect this.
  • If someone appends to the target CM, we currently have only one initial state, not a bunch of patches, so we would (in the current implementation), reorder the target. Does this matter? Would we be able to maintain this order going forward? Probably not since someone can then change contributing sources to add things so we might want to keep the simple thing here.

How can I contribute

I'd like to debug this issue by myself but there is no information about how to contribute / how to run the project locally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.