Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

[stable/redis] add RBAC - #5971

Merged
k8s-ci-robot merged 3 commits into
helm:masterfrom
Polyconseil:redis-add-rbac
Jun 13, 2018
Merged

k8s-ci-robot merged 3 commits into
helm:masterfrom
Polyconseil:redis-add-rbac

Conversation

@barryib

@barryib barryib commented Jun 6, 2018 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Add RBAC (serviceAccount, Role, Rolebinding) option to the sbale/redis chart.

/cc @prydonius @tompizmor @sameersbn @carrodher @juan131

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 6, 2018
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 6, 2018
@barryib

barryib commented Jun 6, 2018

Copy link
Copy Markdown
Contributor Author

@prydonius

Copy link
Copy Markdown
Member

@barryib AFAIK Redis does not use the k8s API so I can't see why this change is necessary, anything I'm missing?

@barryib

barryib commented Jun 6, 2018 •

Copy link
Copy Markdown
Contributor Author

@prydonius In our k8s clusters, every pod should run with a service account and should validate against pod security policy. I got error like this:

Events:
  Type     Reason        Age                From                    Message
  ----     ------        ----               ----                    -------
  Warning  FailedCreate  5s (x12 over 16s)  statefulset-controller  create Pod redis-master-0 in StatefulSet redis-master failed error: pods "redis-master-0" is forbidden: unable to validate against any pod security policy: []

So with this PR, redis chart will create a service account and bind it to the role with the given rules:

redis:
  serviceAccount:
    create: true
  rbac:
    create: true
    role:
      rules:
        - apiGroups:
            - extensions
          resources:
            - podsecuritypolicies
          verbs:
            - use
          resourceNames:
            - bme.unprivileged

@prydonius prydonius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, thanks for the information @barryib. @unguiculus what do you think about this? It sounds like we may need to add this to all charts if we add it here.

Comment thread stable/redis/Chart.yaml Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please bump this to 3.4.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prydonius done with 9edcea6

@unguiculus unguiculus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments. Otherwise LGTM.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to wrap into an if block.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unguiculus Forget about precedent comment. Fixed in cb66927

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to wrap into an if block.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unguiculus removing the if block will unconditionally ’serviceAcvount’ even if the serviceAccountName is empty. Furthermore, it'll pod will try to run with a possibly inexistent service account.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unguiculus Forget about precedent comment. Fixed in cb66927

@juan131 juan131 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of comments about the wording, but it's ok to me

Comment thread stable/redis/values.yaml Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use enabled as we do for other components such as livenessProbes, readinessProbes, etc.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread stable/redis/values.yaml Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use enabled as we do for other components such as livenessProbes, readinessProbes, etc.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prydonius

Copy link
Copy Markdown
Member

/ok-to-test

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm Indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 13, 2018
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: barryib, prydonius

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2018
@k8s-ci-robot
k8s-ci-robot merged commit 247c852 into helm:master Jun 13, 2018
@barryib
barryib deleted the redis-add-rbac branch June 13, 2018 19:11
jainishshah17 added a commit to jainishshah17/charts that referenced this pull request Jun 14, 2018
* art-ha-static-volumes: (60 commits)
  added support for static pv
  [stable/artifactory] adding support for edge node and replicator (helm#5649)
  [stable/grafana] Set the user and fs group for grafana (helm#5854)
  [stable/stolon] Fix issue with secret deletion during helm upgrade (helm#5903)
  cert-manager: fast-forward to upstream 36289cf0 (helm#5919)
  Split Jenkins readiness and liveness probe periods (helm#5704)
  Kafka release name check (helm#5770)
  Adding JFrog Distribution (helm#5631)
  Correct default zookeeper host to be compatible with zk charts (helm#5824)
  [stable/redis] add RBAC (helm#5971)
  [stable/wordpress] Set dependencies to latest version (helm#6074)
  [stable/rabbitmq] Release 1.1.6 (helm#6095)
  [stable/mariadb] Fix configurable parameters (helm#6092)
  [stable/keycloak] Add option to configure sidecars and misc improvements (helm#6090)
  [stable/kubewatch] - Use maintained bitnami image for kubewatch (helm#5871)
  [stable/ghost] Release 4.0.1 (helm#6085)
  update PROCESSES.md to clarify promotion process (helm#6084)
  [incubator/drone] Move drone from incubator to stable (helm#5780)
  fix for helm#6039 (helm#6042)
  [stable/sonatype-nexus] Update image to 3.12.1 (helm#6076)
  ...
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
* [stable/redis] add RBAC

* [stable/redis] bump chart version

* [stable/redis] use "default" SA if SA is not defined

Signed-off-by: voron <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants