-
Notifications
You must be signed in to change notification settings - Fork 8
Role bindings, service accounts, [openshift] security context constraints for keylime agents #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,9 @@ spec: | |
| selector: | ||
| matchLabels: | ||
| {{- include "agent.selectorLabels" . | nindent 6 }} | ||
| {{- if .Values.serviceAccount.create -}} | ||
| serviceAccountName: {{ include "agent.serviceAccountName" . }} | ||
| {{- end }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| template: | ||
| metadata: | ||
| {{- with .Values.podAnnotations }} | ||
|
|
@@ -21,7 +24,9 @@ spec: | |
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- if .Values.serviceAccount.create -}} | ||
| serviceAccountName: {{ include "agent.serviceAccountName" . }} | ||
| {{- end }} | ||
| initContainers: | ||
| - name: {{ .Chart.Name }}-init | ||
| env: | ||
|
|
@@ -167,6 +172,7 @@ spec: | |
| selector: | ||
| matchLabels: | ||
| {{- include "agentplugin.selectorLabels" . | nindent 6 }} | ||
| serviceAccountName: {{ include "agent.serviceAccountName" . }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| template: | ||
| metadata: | ||
| {{- with .Values.podAnnotations }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {{ if .Values.global.openshift }} | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: {{ include "agent.roleName" . }} | ||
| rules: | ||
| - apiGroups: | ||
| - security.openshift.io | ||
| resources: | ||
| - securitycontextconstraints | ||
| resourceNames: | ||
| {{ if .Values.global.service.agent.privileged }} | ||
| - privileged | ||
| {{ else }} | ||
| - hostmount-anyuid | ||
| {{ end }} | ||
| verbs: | ||
| - use | ||
| {{ end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| {{ if .Values.global.openshift }} | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: {{ include "agent.roleBindingName" . }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: {{ include "agent.roleName" . }} | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "agent.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| {{ end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might also be an indentation issue here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the spacing of jinja conditionals does not matter, however the spacing of stanzas covered under jinja conditionals does. That being said, I believe that the service account specification in the case you are pointing out should be associated with the
specnot theselector. I should probably move the declaration to make it less ambiguous or easier to read, but experimentation seems to confirm that it's at least correct. Let me know if you think otherwise.