Skip to content

Commit

Permalink
refactor: refactor dvcr from direct templating to helpers
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Fedotov <[email protected]>
  • Loading branch information
nevermarine committed Nov 14, 2024
1 parent 441362a commit f1f5bec
Showing 1 changed file with 6 additions and 47 deletions.
53 changes: 6 additions & 47 deletions templates/dvcr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,54 +94,13 @@ spec:
{{- end }}
env: {{ include "dvcr.envs" . | nindent 12 }}
volumeMounts: {{ include "dvcr.volumeMounts" . | nindent 12 }}
- name: kube-rbac-proxy
{{- include "helm_lib_module_container_security_context_read_only_root_filesystem" . | nindent 10 }}
image: {{ include "helm_lib_module_common_image" (list . "kubeRbacProxy") }}
args:
- "--secure-listen-address=$(KUBE_RBAC_PROXY_LISTEN_ADDRESS):8082"
- "--client-ca-file=/etc/kube-rbac-proxy/ca.crt"
- "--v=2"
- "--logtostderr=true"
- "--stale-cache-interval=1h30m"
- "--livez-path=/livez"
env:
- name: KUBE_RBAC_PROXY_LISTEN_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_RBAC_PROXY_CONFIG
value: |
excludePaths:
- /config
upstreams:
- upstream: http://127.0.0.1:5001/metrics
path: /metrics
authorization:
resourceAttributes:
namespace: d8-virtualization
apiGroup: apps
apiVersion: v1
resource: deployments
subresource: http
name: dvcr
resources:
requests:
{{- include "helm_lib_module_ephemeral_storage_only_logs" . | nindent 14 }}
{{- if not ( .Values.global.enabledModules | has "vertical-pod-autoscaler") }}
{{- include "helm_lib_container_kube_rbac_proxy_resources" . | nindent 14 }}
{{- end }}
volumeMounts:
- name: kube-rbac-proxy-ca
mountPath: /etc/kube-rbac-proxy
ports:
- containerPort: 8082
name: https-metrics
protocol: TCP
{{- $kubeRbacProxySettings := dict }}
{{- $_ := set $kubeRbacProxySettings "resource" "deployment" }}
{{- $_ := set $kubeRbacProxySettings "name" "dvcr" }}
{{- $_ := set $kubeRbacProxySettings "upstream" "https://127.0.0.1:5001/metrics" }}
{{- include "kube_rbac_proxy.sidecar_container" (tuple . $kubeRbacProxySettings) | nindent 8 }}
volumes: {{ include "dvcr.volumes" . | nindent 8 }}
- name: kube-rbac-proxy-ca
configMap:
defaultMode: 420
name: kube-rbac-proxy-ca.crt
{{- include "kube_rbac_proxy.sidecar_container" (tuple . $kubeRbacProxySettings) | nindent 8 }}
{{- include "helm_lib_priority_class" (tuple . $priorityClassName) | nindent 6 }}
{{- include "helm_lib_node_selector" (tuple . "system") | nindent 6 }}
{{- include "helm_lib_tolerations" (tuple . "system") | nindent 6 }}
Expand Down

0 comments on commit f1f5bec

Please sign in to comment.