Skip to content

Commit

Permalink
Feat/vcluster etcd backup (#86)
Browse files Browse the repository at this point in the history
* fix: no-proxy injection
  • Loading branch information
oliverbaehler authored Apr 26, 2023
1 parent 089484d commit d342497
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/vcluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: vcluster
description: Virtual Kubernetes Cluster
type: application
version: 0.3.0
version: 0.3.1
appVersion: 0.1.0
keywords:
- vcluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Generate etcd servers list.
{{- range $etcdcount, $e := until (int $kubernetes.etcd.replicaCount) -}}
{{- printf "https://" -}}
{{- printf "%s-etcd-%d." $fullName $etcdcount -}}
{{- printf "%s-etcd:%d" $fullName (int $kubernetes.etcd.ports.client) -}}
{{- printf "%s-etcd.%s:%d" $fullName $.Release.Namespace (int $kubernetes.etcd.ports.client) -}}
{{- if lt $etcdcount (sub (int $kubernetes.etcd.replicaCount) 1 ) -}}
{{- printf "," -}}
{{- end -}}
Expand All @@ -101,7 +101,7 @@ Generate etcd servers list.
{{- printf "%s-etcd-%d=" $fullName $etcdcount -}}
{{- printf "https://" -}}
{{- printf "%s-etcd-%d." $fullName $etcdcount -}}
{{- printf "%s-etcd:%d" $fullName (int $kubernetes.etcd.ports.peer) -}}
{{- printf "%s-etcd.%s:%d" $fullName $.Release.Namespace (int $kubernetes.etcd.ports.peer) -}}
{{- if lt $etcdcount (sub (int $kubernetes.etcd.replicaCount) 1 ) -}}
{{- printf "," -}}
{{- end -}}
Expand Down Expand Up @@ -254,7 +254,7 @@ Template for API Server
{{- define "kubernetes.api.url" -}}
{{- $kubernetes := $.Values.kubernetes -}}
{{- with $kubernetes.apiServer.service.port -}}
{{- printf "https://%s:%s" (include "kubernetes.api.service" $) (. | toString) -}}
{{- printf "https://%s.%s:%s" (include "kubernetes.api.service" $) $.Release.Namespace (. | toString) -}}
{{- end -}}
{{- end -}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data:
clusters:
- cluster:
certificate-authority: /pki/admin-client/ca.crt
server: https://{{ $fullName }}-apiserver:{{ $kubernetes.apiServer.service.port }}
server: {{ include "kubernetes.api.url" $ }}
name: default-cluster
contexts:
- context:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ spec:
{{- with $kubernetes.apiServer.envs }}
{{- include "pkg.utils.envs" (dict "envs" . "ctx" $) | nindent 8 }}
{{- end }}
{{- include "pkg.common.env" $ | nindent 8 }}
{{- include "pkg.common.proxy.env" $ | nindent 8 }}
volumeMounts:
- mountPath: /etc/kubernetes
name: apiserver-config
Expand Down
4 changes: 2 additions & 2 deletions charts/vcluster/templates/pkg/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Common Selector Labels
{{- $no_proxy = ($no_proxy | trimSuffix ",") -}}

{{/* Standard Stuff */}}
{{- $no_proxy = printf "%s,%s" $no_proxy "localhost,127.0.0.1,.svc,svc." -}}
{{- $no_proxy = printf "%s,%s,.%s" $no_proxy "localhost,127.0.0.1,.svc,svc.,$KUBERNETES_SERVICE_HOST" ($.Release.Namespace | trimAll ".") -}}

{{/* Kubernetes Component */}}
{{- if (include "kubernetes.enabled" $) -}}
Expand All @@ -104,7 +104,7 @@ Common Selector Labels
{{- $no_proxy = printf "%s,%s" $no_proxy . -}}
{{- end -}}
{{- with $kubernetes.networking.dnsDomain -}}
{{- $no_proxy = printf "%s,%s" $no_proxy . -}}
{{- $no_proxy = printf "%s,%s,%s." $no_proxy . . -}}
{{- end -}}
{{/* Inject Subnet CIDRs (GO will understand, not bash) */}}
{{- with $kubernetes.networking.podSubnet -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/vcluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ global:
# -- Proxy Host
host: ""
# -- No Proxy Hosts
no_proxy: ""
no_proxy: "10.0.0.0/8"

# Docker Registry
registry:
Expand Down

0 comments on commit d342497

Please sign in to comment.