Skip to content

Commit

Permalink
Merge pull request #15 from iAnomaly/optional-deployment
Browse files Browse the repository at this point in the history
Allow deployment to be optional
  • Loading branch information
haad authored Mar 17, 2021
2 parents 72121b9 + c58c7a7 commit c1edbbb
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 82 deletions.
145 changes: 74 additions & 71 deletions stable/coredns/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion stable/coredns/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.rbac.create }}
{{- if and .Values.deployment.enabled .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
2 changes: 1 addition & 1 deletion stable/coredns/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.rbac.create }}
{{- if and .Values.deployment.enabled .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
3 changes: 3 additions & 0 deletions stable/coredns/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.deployment.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -31,3 +33,4 @@ data:
{{- range .Values.zoneFiles }}
{{ .filename }}: {{ toYaml .contents | indent 4 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/coredns/templates/deployment-autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
- /cluster-proportional-autoscaler
- --namespace={{ .Release.Namespace }}
- --configmap={{ template "coredns.fullname" . }}-autoscaler
- --target=Deployment/{{ template "coredns.fullname" . }}
- --target=Deployment/{{ default (include "coredns.fullname" .) .Values.deployment.name }}
- --logtostderr=true
- --v=2
{{- end }}
5 changes: 4 additions & 1 deletion stable/coredns/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.deployment.enabled }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "coredns.fullname" . }}
name: {{ default (include "coredns.fullname" .) .Values.deployment.name }}
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
Expand Down Expand Up @@ -145,3 +147,4 @@ spec:
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 8 }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions stable/coredns/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "coredns.fullname" . }}
name: {{ default (include "coredns.fullname" .) .Values.deployment.name }}
minReplicas: {{ .Values.hpa.minReplicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:
{{ toYaml .Values.hpa.metrics | indent 4 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/coredns/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.podDisruptionBudget -}}
{{- if and .Values.deployment.enabled .Values.podDisruptionBudget -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
Expand Down
2 changes: 1 addition & 1 deletion stable/coredns/templates/podsecuritypolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.rbac.pspEnable }}
{{- if and .Values.deployment.enabled .Values.rbac.pspEnable }}
{{ if .Capabilities.APIVersions.Has "policy/v1beta1" }}
apiVersion: policy/v1beta1
{{ else }}
Expand Down
2 changes: 1 addition & 1 deletion stable/coredns/templates/service-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.prometheus.service.enabled }}
{{- if and .Values.deployment.enabled .Values.prometheus.service.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down
3 changes: 3 additions & 0 deletions stable/coredns/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.deployment.enabled }}
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -40,3 +42,4 @@ spec:
ports:
{{ include "coredns.servicePorts" . | indent 2 -}}
type: {{ default "ClusterIP" .Values.serviceType }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/coredns/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.serviceAccount.create }}
{{- if and .Values.deployment.enabled .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
2 changes: 1 addition & 1 deletion stable/coredns/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.prometheus.monitor.enabled }}
{{- if and .Values.deployment.enabled .Values.prometheus.monitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
4 changes: 4 additions & 0 deletions stable/coredns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,7 @@ autoscaler:
## Annotations for the coredns-autoscaler configmap
# i.e. strategy.spinnaker.io/versioned: "false" to ensure configmap isn't renamed
annotations: {}

deployment:
enabled: true
name: ""

0 comments on commit c1edbbb

Please sign in to comment.