forked from kubernetes/kops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
58 additions
and
3 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Examples of how to embed kops / use the kops API | ||
|
||
The kops API is still a work in progress, but this is where we will put examples of how it can be used. | ||
|
||
``` | ||
make examples | ||
``` | ||
|
||
``` | ||
kops-api-example -name api1.example.com -zones us-east-1c | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"k8s.io/kops/pkg/client/simple/vfsclientset" | ||
"k8s.io/kops/upup/pkg/fi/cloudup" | ||
) | ||
|
||
func apply() error { | ||
clientset := vfsclientset.NewVFSClientset(registryBase) | ||
|
||
cluster, err := clientset.Clusters().Get(clusterName) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
applyCmd := &cloudup.ApplyClusterCmd{ | ||
Cluster: cluster, | ||
Clientset: clientset, | ||
TargetName: cloudup.TargetDirect, | ||
} | ||
err = applyCmd.Run() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
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