Skip to content
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

Kubeops manifests to follow YAML best practices #1528

Merged
merged 1 commit into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 35 additions & 37 deletions chart/kubeapps/templates/kubeops-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,48 @@ spec:
app: {{ template "kubeapps.kubeops.fullname" . }}
release: {{ .Release.Name }}
spec:
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ template "kubeapps.kubeops.fullname" . }}
# Increase termination timeout to let remaining operations to finish before killing the pods
# This is because new releases/upgrades/deletions are synchronous operations
terminationGracePeriodSeconds: 300
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: kubeops
image: {{ template "kubeapps.image" (list .Values.kubeops.image .Values.global) }}
command:
- /kubeops
args:
- --user-agent-comment=kubeapps/{{ .Chart.AppVersion }}
- --assetsvc-url=http://{{ template "kubeapps.assetsvc.fullname" . }}:{{ .Values.assetsvc.service.port }}
ports:
- name: http
containerPort: {{ .Values.kubeops.service.port }}
{{- if .Values.kubeops.livenessProbe }}
livenessProbe: {{- toYaml .Values.kubeops.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.kubeops.readinessProbe }}
readinessProbe: {{- toYaml .Values.kubeops.readinessProbe | nindent 12 }}
{{- end }}
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
resources:
{{ toYaml .Values.kubeops.resources | indent 12 }}
{{- with .Values.kubeops.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.kubeops.affinity }}
affinity: {{- include "kubeapps.tplValue" (dict "value" .Values.kubeops.affinity "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.kubeops.nodeSelector }}
nodeSelector: {{- include "kubeapps.tplValue" (dict "value" .Values.kubeops.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.kubeops.tolerations }}
tolerations: {{- include "kubeapps.tplValue" (dict "value" .Values.kubeops.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
{{- with .Values.kubeops.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.kubeops.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: kubeops
image: {{ template "kubeapps.image" (list .Values.kubeops.image .Values.global) }}
command:
- /kubeops
args:
- --user-agent-comment=kubeapps/{{ .Chart.AppVersion }}
- --assetsvc-url=http://{{ template "kubeapps.assetsvc.fullname" . }}:{{ .Values.assetsvc.service.port }}
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: http
containerPort: {{ .Values.kubeops.service.port }}
{{- if .Values.kubeops.livenessProbe }}
livenessProbe: {{- toYaml .Values.kubeops.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.kubeops.readinessProbe }}
readinessProbe: {{- toYaml .Values.kubeops.readinessProbe | nindent 12 }}
{{- end }}
{{- if .Values.kubeops.resources }}
resources: {{- toYaml .Values.kubeops.resources | nindent 12 }}
{{- end }}
{{- end }}{{/* matches useHelm3 */}}
12 changes: 6 additions & 6 deletions chart/kubeapps/templates/kubeops-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
8 changes: 4 additions & 4 deletions chart/kubeapps/templates/kubeops-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ metadata:
spec:
type: ClusterIP
ports:
- port: {{ .Values.kubeops.service.port }}
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.kubeops.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "kubeapps.kubeops.fullname" . }}
release: {{ .Release.Name }}
Expand Down