@@ -73,6 +73,15 @@ func (d *deployer) initialize() error {
73
73
d .SSHPublicKeyPath = publicKeyPath
74
74
d .SSHPrivateKeyPath = privateKeyPath
75
75
}
76
+ case "azure" :
77
+ publicKeyPath , privateKeyPath , err := util .CreateSSHKeyPair (d .ClusterName )
78
+ if err != nil {
79
+ return err
80
+ }
81
+ d .SSHPublicKeyPath = publicKeyPath
82
+ d .SSHPrivateKeyPath = privateKeyPath
83
+ // TODO: Check if we can use "kops" as SSH user
84
+ d .SSHUser = "ubuntu"
76
85
case "digitalocean" :
77
86
if d .SSHPrivateKeyPath == "" {
78
87
d .SSHPrivateKeyPath = os .Getenv ("DO_SSH_PRIVATE_KEY_FILE" )
@@ -180,6 +189,7 @@ func (d *deployer) verifyKopsFlags() error {
180
189
181
190
switch d .CloudProvider {
182
191
case "aws" :
192
+ case "azure" :
183
193
case "gce" :
184
194
case "digitalocean" :
185
195
default :
@@ -222,14 +232,24 @@ func (d *deployer) env() []string {
222
232
// Recognized by the e2e framework
223
233
// https://github.com/kubernetes/kubernetes/blob/a750d8054a6cb3167f495829ce3e77ab0ccca48e/test/e2e/framework/ssh/ssh.go#L59-L62
224
234
vars = append (vars , fmt .Sprintf ("KUBE_SSH_KEY_PATH=%v" , d .SSHPrivateKeyPath ))
235
+ } else if d .CloudProvider == "azure" {
236
+ // Pass through some env vars if set
237
+ for _ , k := range []string {"AZURE_TENANT_ID" , "AZURE_SUBSCRIPTION_ID" , "AZURE_CLIENT_ID" , "AZURE_FEDERATED_TOKEN_FILE" , "AZURE_STORAGE_ACCOUNT" } {
238
+ v := os .Getenv (k )
239
+ if v != "" {
240
+ vars = append (vars , k + "=" + v )
241
+ } else {
242
+ klog .Warningf ("Azure env var %s is empty." , k )
243
+ }
244
+ }
225
245
} else if d .CloudProvider == "digitalocean" {
226
246
// Pass through some env vars if set
227
247
for _ , k := range []string {"DIGITALOCEAN_ACCESS_TOKEN" , "S3_ACCESS_KEY_ID" , "S3_SECRET_ACCESS_KEY" } {
228
248
v := os .Getenv (k )
229
249
if v != "" {
230
250
vars = append (vars , k + "=" + v )
231
251
} else {
232
- klog .Warningf ("DO env var %s is empty.. " , k )
252
+ klog .Warningf ("DO env var %s is empty." , k )
233
253
}
234
254
}
235
255
}
@@ -339,6 +359,9 @@ func (d *deployer) stateStore() string {
339
359
}
340
360
d .createBucket = true
341
361
ss = "s3://" + bucketName
362
+ case "azure" :
363
+ // TODO: Use dynamic container name
364
+ ss = "azureblob://cluster-state"
342
365
case "gce" :
343
366
d .createBucket = true
344
367
ss = "gs://" + gce .GCSBucketName (d .GCPProject , "state" )
0 commit comments