Skip to content

Commit

Permalink
chore: sync labels and sort attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Aug 22, 2023
1 parent 7a440d1 commit aaeb29c
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 156 deletions.
71 changes: 32 additions & 39 deletions charts/atlas-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,53 @@ kind: Deployment
metadata:
name: {{ include "atlas-operator.fullname" . }}
labels:
{{- include "atlas-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: atlas-operator
app.kubernetes.io/part-of: atlas-operator
control-plane: controller-manager
{{- include "atlas-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "atlas-operator.selectorLabels" . | nindent 6 }}
control-plane: controller-manager
{{- include "atlas-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
control-plane: controller-manager
{{- include "atlas-operator.selectorLabels" . | nindent 8 }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
kubectl.kubernetes.io/default-container: manager
{{- end }}
labels:
control-plane: controller-manager
{{- include "atlas-operator.selectorLabels" . | nindent 8 }}
spec:
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "atlas-operator.serviceAccountName" . }}
terminationGracePeriodSeconds: 10
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: manager
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "atlas-operator.serviceAccountName" . }}
terminationGracePeriodSeconds: 10
79 changes: 43 additions & 36 deletions charts/atlas-operator/templates/leader-election-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,58 @@ kind: Role
metadata:
name: {{ include "atlas-operator.leaderElectionRole" . }}
labels:
{{- include "atlas-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: atlas-operator
app.kubernetes.io/part-of: atlas-operator
{{- include "atlas-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "atlas-operator.leaderElectionRole" . }}-binding
labels:
{{- include "atlas-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: atlas-operator
app.kubernetes.io/part-of: atlas-operator
{{- include "atlas-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "atlas-operator.leaderElectionRole" . }}
name: '{{ include "atlas-operator.leaderElectionRole" . }}'
subjects:
- kind: ServiceAccount
name: {{ include "atlas-operator.serviceAccountName" . }}
- kind: ServiceAccount
name: '{{ include "atlas-operator.serviceAccountName" . }}'
namespace: '{{ .Release.Namespace }}'
{{- end }}
179 changes: 99 additions & 80 deletions charts/atlas-operator/templates/manager-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,114 @@ kind: ClusterRole
metadata:
name: {{ include "atlas-operator.managerRoleName" . }}
labels:
{{- include "atlas-operator.labels" . | nindent 4 }}
{{- include "atlas-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- db.atlasgo.io
resources:
- atlasschemas
- atlasmigrations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- db.atlasgo.io
resources:
- atlasschemas/finalizers
- atlasmigrations/finalizers
verbs:
- update
- apiGroups:
- db.atlasgo.io
resources:
- atlasschemas/status
- atlasmigrations/status
verbs:
- get
- patch
- update
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- db.atlasgo.io
resources:
- atlasmigrations
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- db.atlasgo.io
resources:
- atlasmigrations/finalizers
verbs:
- update
- apiGroups:
- db.atlasgo.io
resources:
- atlasmigrations/status
verbs:
- get
- patch
- update
- apiGroups:
- db.atlasgo.io
resources:
- atlasschemas
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- db.atlasgo.io
resources:
- atlasschemas/finalizers
verbs:
- update
- apiGroups:
- db.atlasgo.io
resources:
- atlasschemas/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "atlas-operator.managerRoleName" . }}-binding
labels:
{{- include "atlas-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: atlas-operator
app.kubernetes.io/part-of: atlas-operator
{{- include "atlas-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "atlas-operator.managerRoleName" . }}
name: '{{ include "atlas-operator.managerRoleName" . }}'
subjects:
- kind: ServiceAccount
name: {{ include "atlas-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
- kind: ServiceAccount
name: '{{ include "atlas-operator.serviceAccountName" . }}'
namespace: '{{ .Release.Namespace }}'
{{- end }}
5 changes: 4 additions & 1 deletion charts/atlas-operator/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ kind: ServiceAccount
metadata:
name: {{ include "atlas-operator.serviceAccountName" . }}
labels:
{{- include "atlas-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: atlas-operator
app.kubernetes.io/part-of: atlas-operator
{{- include "atlas-operator.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down

0 comments on commit aaeb29c

Please sign in to comment.