Skip to content
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

remove sealed-secrets for kubeapps distribution #376

Merged
merged 2 commits into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions cmd/kubeapps/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"encoding/json"
"fmt"
"io"
"regexp"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -99,17 +98,6 @@ List of components that kubeapps up installs:
return fmt.Errorf("kubernetes v1.8+ is required to run Kubeapps")
}

if ssecrets, _ := ssecretsExists(c); ssecrets {
fmt.Printf("WARNING: sealed-secrets exists and was not installed by Kubeapps, continuing could override and interfere with your existing sealed-secrets controller.\nContinue? (y/n): ")
if ok := confirmPrompt(); !ok {
return fmt.Errorf("aborted")
}
fmt.Printf("Are you really sure? (yes/no): ")
if ok := confirmPrompt(); !ok {
return fmt.Errorf("aborted")
}
}

manifest, err := fsGetFile("/kubeapps-objs.yaml")
if err != nil {
return fmt.Errorf("can't read kubeapps manifest: %v", err)
Expand Down Expand Up @@ -305,31 +293,6 @@ func mongoSecretExists(c kubecfg.UpdateCmd, name, ns string) (*unstructured.Unst
return prevSec, true, nil
}

// checks if sealed-secrets exists outside of the Kubeapps install
func ssecretsExists(c kubecfg.UpdateCmd) (bool, error) {
gvk := schema.GroupVersionKind{Group: "apps", Version: "v1beta1", Kind: "Deployment"}
rc, err := clientForGroupVersionKind(c.ClientPool, c.Discovery, gvk, "kube-system")
if err != nil {
return false, err
}
ssc, err := rc.Get("sealed-secrets-controller", metav1.GetOptions{})
if err != nil {
return false, err
}
return ssc.GetLabels()["created-by"] != "kubeapps", nil
}

func confirmPrompt() bool {
var response string
_, err := fmt.Scanln(&response)
if err != nil {
return false
}

r := regexp.MustCompile("(?i)^y(es)?")
return r.MatchString(response)
}

func buildSecretObject(pw map[string]string, name, ns string) *unstructured.Unstructured {
return &unstructured.Unstructured{
Object: map[string]interface{}{
Expand Down
2 changes: 0 additions & 2 deletions manifests/kubeapps.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local kubecfg = import "kubecfg.libsonnet";
local host = null;
local tls = false;
local kubeless = import "kubeless.jsonnet";
local ssecrets = import "sealed-secrets.jsonnet";

local labels = {
metadata+: {
Expand Down Expand Up @@ -37,7 +36,6 @@ local labelifyEach(src) = {
// NB: these are left in their usual namespaces, to avoid forcing
// non-default command line options onto client tools
kubeless: labelifyEach(kubeless),
ssecrets: [s + labels for s in ssecrets],

dashboard_:: (import "kubeapps-dashboard.jsonnet") {
namespace:: $.namespace,
Expand Down
13 changes: 0 additions & 13 deletions manifests/sealed-secrets.jsonnet

This file was deleted.

122 changes: 0 additions & 122 deletions manifests/sealedsecret-controller.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions manifests/sealedsecret-crd.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions manifests/sealedsecret-tpr.yaml

This file was deleted.