From 7a59815087aaa6bef11f078d74aeae3601f08471 Mon Sep 17 00:00:00 2001 From: dhrp Date: Thu, 14 Jun 2018 14:29:51 +0200 Subject: [PATCH] made vault-operator track vault upstream image, upgrade and enable ui By installing curl into the vault image at initialization, we don't need to have a customized vault image, and can track upstream. This commit also upgrades to vault 0.10.2 and enables the (new) ui closes #290 --- example/example_vault.yaml | 2 +- pkg/apis/vault/v1alpha1/types.go | 4 ++-- pkg/util/k8sutil/vault.go | 6 +++--- pkg/util/vaultutil/vault_config.go | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/example/example_vault.yaml b/example/example_vault.yaml index 92b114a..38b0f21 100644 --- a/example/example_vault.yaml +++ b/example/example_vault.yaml @@ -4,4 +4,4 @@ metadata: name: "example" spec: nodes: 2 - version: "0.9.1-0" + version: "0.10.2" diff --git a/pkg/apis/vault/v1alpha1/types.go b/pkg/apis/vault/v1alpha1/types.go index 87128b7..1515bf8 100644 --- a/pkg/apis/vault/v1alpha1/types.go +++ b/pkg/apis/vault/v1alpha1/types.go @@ -20,9 +20,9 @@ import ( ) const ( - defaultBaseImage = "quay.io/coreos/vault" + defaultBaseImage = "vault" // version format is "-" - defaultVersion = "0.9.1-0" + defaultVersion = "0.10.2" ) type ClusterPhase string diff --git a/pkg/util/k8sutil/vault.go b/pkg/util/k8sutil/vault.go index 44c6cb8..ad7c8ba 100644 --- a/pkg/util/k8sutil/vault.go +++ b/pkg/util/k8sutil/vault.go @@ -146,9 +146,9 @@ func vaultContainer(v *api.VaultService) v1.Container { Name: "vault", Image: fmt.Sprintf("%s:%s", v.Spec.BaseImage, v.Spec.Version), Command: []string{ - "/bin/vault", - "server", - "-config=" + VaultConfigPath, + "sh", + "-c", + "setcap cap_ipc_lock=+ep /bin/vault && apk --no-cache add curl && exec /bin/vault server -config=" + VaultConfigPath, }, Env: []v1.EnvVar{ { diff --git a/pkg/util/vaultutil/vault_config.go b/pkg/util/vaultutil/vault_config.go index 4bfe966..9852452 100644 --- a/pkg/util/vaultutil/vault_config.go +++ b/pkg/util/vaultutil/vault_config.go @@ -58,6 +58,8 @@ storage "etcd" { func NewConfigWithDefaultParams(data string) string { buf := bytes.NewBufferString(data) buf.WriteString(` +ui = true + telemetry { statsd_address = "localhost:9125" }