-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add support for Istio multi-cluster #447
Merged
stefanprodan
merged 6 commits into
fluxcd:master
from
viditganpi:canary-for-multi-cluster-istio
Feb 20, 2020
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2cb6ce4
Subject:- Canary support for istio multi cluster
5462db7
1. Modified cmd/main to consume host kubeconfig
8e996b6
removed mode, fallback to default mode for secret file
1f0a4d9
Changes
13342e5
corrected formatting
0d493f6
removed non-required binary file
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,11 +42,31 @@ spec: | |
imagePullSecrets: | ||
- name: {{ .Values.image.pullSecret }} | ||
{{- end }} | ||
volumes: | ||
{{- if .Values.kubeconfigHost }} | ||
- name: kubeconfig | ||
secret: | ||
secretName: "{{ .Values.kubeconfigHost }}" | ||
{{- end }} | ||
{{- if .Values.kubeconfigSource }} | ||
- name: kubeconfig-source | ||
secret: | ||
secretName: "{{ .Values.kubeconfigSource }}" | ||
{{- end }} | ||
containers: | ||
- name: flagger | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsUser: 10001 | ||
volumeMounts: | ||
{{- if .Values.kubeconfigHost }} | ||
- name: kubeconfig | ||
mountPath: "/tmp/istio-host" | ||
{{- end }} | ||
{{- if .Values.kubeconfigSource }} | ||
- name: kubeconfig-source | ||
mountPath: "/tmp/istio-source" | ||
{{- end }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
|
@@ -90,6 +110,12 @@ spec: | |
{{- if .Values.eventWebhook }} | ||
- -event-webhook={{ .Values.eventWebhook }} | ||
{{- end }} | ||
{{- if .Values.kubeconfigSource }} | ||
- -kubeconfig=/tmp/istio-source/config1 | ||
{{- end }} | ||
{{- if .Values.kubeconfigHost }} | ||
- -kubeconfig-host=/tmp/istio-host/config1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace |
||
{{- end }} | ||
livenessProbe: | ||
exec: | ||
command: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ var ( | |
leaderElectionNamespace string | ||
enableConfigTracking bool | ||
ver bool | ||
kubeconfigHost string | ||
) | ||
|
||
func init() { | ||
|
@@ -83,6 +84,7 @@ func init() { | |
flag.StringVar(&leaderElectionNamespace, "leader-election-namespace", "kube-system", "Namespace used to create the leader election config map.") | ||
flag.BoolVar(&enableConfigTracking, "enable-config-tracking", true, "Enable secrets and configmaps tracking.") | ||
flag.BoolVar(&ver, "version", false, "Print version") | ||
flag.StringVar(&kubeconfigHost, "kubeconfig-host", "", "Path to a kubeconfig for host cluster. Only required if cluster has a host cluster.") | ||
} | ||
|
||
func main() { | ||
|
@@ -111,20 +113,26 @@ func main() { | |
if err != nil { | ||
logger.Fatalf("Error building kubeconfig: %v", err) | ||
} | ||
|
||
fmt.Println(cfg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this please. |
||
kubeClient, err := kubernetes.NewForConfig(cfg) | ||
if err != nil { | ||
logger.Fatalf("Error building kubernetes clientset: %v", err) | ||
} | ||
|
||
meshClient, err := clientset.NewForConfig(cfg) | ||
flaggerClient, err := clientset.NewForConfig(cfg) | ||
if err != nil { | ||
logger.Fatalf("Error building mesh clientset: %v", err) | ||
logger.Fatalf("Error building flagger clientset: %s", err.Error()) | ||
} | ||
|
||
flaggerClient, err := clientset.NewForConfig(cfg) | ||
//if host kube config is there than this should be spawned with host kubeconfig | ||
cfgHost, err := clientcmd.BuildConfigFromFlags(masterURL, kubeconfigHost) | ||
if err != nil { | ||
logger.Fatalf("Error building flagger clientset: %s", err.Error()) | ||
logger.Fatalf("Error building host kubeconfig: %v", err) | ||
} | ||
|
||
meshClient, err := clientset.NewForConfig(cfgHost) | ||
if err != nil { | ||
logger.Fatalf("Error building mesh clientset: %v", err) | ||
} | ||
|
||
verifyCRDs(flaggerClient, logger) | ||
|
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace
config1
withkubeconfig