Skip to content

Commit

Permalink
Changed examples structure - Added missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerlinux committed Sep 21, 2017
2 parents a84bcb2 + 0756ece commit 82a7fb3
Show file tree
Hide file tree
Showing 110 changed files with 4,201 additions and 1,058 deletions.
244 changes: 129 additions & 115 deletions Makefile

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions addons/cluster-autoscaler/v1.4.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
- name: ssl-certs
hostPath:
path: {{SSL_CERT_PATH}}
dnsPolicy: "Default"
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
Expand Down
8 changes: 8 additions & 0 deletions addons/cluster-autoscaler/v1.6.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ rules:
verbs:
- watch
- list
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- watch
- list

---

Expand Down Expand Up @@ -182,6 +189,7 @@ spec:
- name: ssl-certs
hostPath:
path: {{SSL_CERT_PATH}}
dnsPolicy: "Default"
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
Expand Down
19 changes: 14 additions & 5 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {

cmd.Flags().StringVar(&options.Image, "image", options.Image, "Image to use for all instances.")

cmd.Flags().StringVar(&options.Networking, "networking", "kubenet", "Networking mode to use. kubenet (default), classic, external, kopeio-vxlan (or kopeio), weave, flannel, calico, canal, kube-router.")
cmd.Flags().StringVar(&options.Networking, "networking", "kubenet", "Networking mode to use. kubenet (default), classic, external, kopeio-vxlan (or kopeio), weave, flannel-vxlan (or flannel), flannel-udp, calico, canal, kube-router, romana.")

cmd.Flags().StringVar(&options.DNSZone, "dns-zone", options.DNSZone, "DNS hosted zone to use (defaults to longest matching zone)")
cmd.Flags().StringVar(&options.OutDir, "out", options.OutDir, "Path to write any local output")
Expand Down Expand Up @@ -694,14 +694,23 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
jumboFrameMTUSize := int32(8912)
cluster.Spec.Networking.Weave.MTU = &jumboFrameMTUSize
}
case "flannel":
cluster.Spec.Networking.Flannel = &api.FlannelNetworkingSpec{}
case "flannel", "flannel-vxlan":
cluster.Spec.Networking.Flannel = &api.FlannelNetworkingSpec{
Backend: "vxlan",
}
case "flannel-udp":
glog.Warningf("flannel UDP mode is not recommended; consider flannel-vxlan instead")
cluster.Spec.Networking.Flannel = &api.FlannelNetworkingSpec{
Backend: "udp",
}
case "calico":
cluster.Spec.Networking.Calico = &api.CalicoNetworkingSpec{}
case "canal":
cluster.Spec.Networking.Canal = &api.CanalNetworkingSpec{}
case "kube-router":
cluster.Spec.Networking.Kuberouter = &api.KuberouterNetworkingSpec{}
case "romana":
cluster.Spec.Networking.Romana = &api.RomanaNetworkingSpec{}
default:
return fmt.Errorf("unknown networking mode %q", c.Networking)
}
Expand Down Expand Up @@ -739,7 +748,7 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e

case api.TopologyPrivate:
if !supportsPrivateTopology(cluster.Spec.Networking) {
return fmt.Errorf("Invalid networking option %s. Currently only '--networking kopeio-vxlan (or kopeio)', '--networking weave', '--networking flannel', '--networking calico', '--networking canal', '--networking kube-router' are supported for private topologies", c.Networking)
return fmt.Errorf("Invalid networking option %s. Currently only '--networking kopeio-vxlan (or kopeio)', '--networking weave', '--networking flannel', '--networking calico', '--networking canal', '--networking kube-router', '--networking romana' are supported for private topologies", c.Networking)
}
cluster.Spec.Topology = &api.TopologySpec{
Masters: api.TopologyPrivate,
Expand Down Expand Up @@ -985,7 +994,7 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e

func supportsPrivateTopology(n *api.NetworkingSpec) bool {

if n.CNI != nil || n.Kopeio != nil || n.Weave != nil || n.Flannel != nil || n.Calico != nil || n.Canal != nil || n.Kuberouter != nil {
if n.CNI != nil || n.Kopeio != nil || n.Weave != nil || n.Flannel != nil || n.Calico != nil || n.Canal != nil || n.Kuberouter != nil || n.Romana != nil {
return true
}
return false
Expand Down
6 changes: 6 additions & 0 deletions cmd/kops/create_cluster_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func TestCreateClusterHA(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_encrypt", "v1alpha2")
}

// TestCreateClusterHAGCE runs kops create cluster ha-gce.example.com --cloud gce --zones us-test1-a,us-test1-b,us-test1-c --master-zones us-test1-a,us-test1-b,us-test1-c
func TestCreateClusterHAGCE(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_gce", "v1alpha2")
}

// TestCreateClusterHASharedZones tests kops create cluster when the master count is bigger than the number of zones
func TestCreateClusterHASharedZones(t *testing.T) {
// Cannot be expressed in v1alpha1 API: runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_shared_zones", "v1alpha1")
Expand Down Expand Up @@ -90,6 +95,7 @@ func runCreateClusterIntegrationTest(t *testing.T, srcDir string, version string
defer h.Close()

h.SetupMockAWS()
h.SetupMockGCE()

publicKeyPath := path.Join(h.TempDir, "id_rsa.pub")
privateKeyPath := path.Join(h.TempDir, "id_rsa")
Expand Down
8 changes: 6 additions & 2 deletions cmd/kops/delete_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"fmt"

"io"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -128,7 +127,12 @@ func RunDeleteSecret(f *util.Factory, out io.Writer, options *DeleteSecretOption
return fmt.Errorf("found multiple matching secrets; specify the id of the key")
}

err = keyStore.DeleteSecret(secrets[0])
switch secrets[0].Type {
case fi.SecretTypeSecret:
err = secretStore.DeleteSecret(secrets[0])
default:
err = keyStore.DeleteSecret(secrets[0])
}
if err != nil {
return fmt.Errorf("error deleting secret: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Monitoring supports the horizontal pod autoscaler.

Install using:
```
kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/monitoring-standalone/v1.6.0.yaml
kubectl create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/monitoring-standalone/v1.7.0.yaml
```


Expand Down
Loading

0 comments on commit 82a7fb3

Please sign in to comment.