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

change cert generate method and add pd and kv webhook #406

Merged
merged 11 commits into from
Apr 29, 2019
38 changes: 18 additions & 20 deletions tests/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package tests

import (
"crypto/tls"
"database/sql"
"encoding/json"
"fmt"
Expand All @@ -30,6 +31,7 @@ import (
"github.com/golang/glog"
pingcapErrors "github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/tidb-operator/tests/pkg/apimachinery"
"github.com/pingcap/tidb-operator/tests/pkg/webhook"
admissionV1beta1 "k8s.io/api/admissionregistration/v1beta1"
"k8s.io/api/apps/v1beta1"
Expand Down Expand Up @@ -117,7 +119,7 @@ type OperatorActions interface {
RegisterWebHookAndService(info *OperatorConfig) error
RegisterWebHookAndServiceOrDie(info *OperatorConfig)
CleanWebHookAndService(info *OperatorConfig) error
StartValidatingAdmissionWebhookServerOrDie()
StartValidatingAdmissionWebhookServerOrDie(info *OperatorConfig)
}

type operatorActions struct {
Expand All @@ -140,6 +142,7 @@ type OperatorConfig struct {
WebhookServiceName string
WebhookSecretName string
WebhookConfigName string
Context *apimachinery.CertContext
}

type TidbClusterConfig struct {
Expand All @@ -166,6 +169,16 @@ type TidbClusterConfig struct {
BlockWriteConfig blockwriter.Config
}

func (oi *OperatorConfig) ConfigTLS() *tls.Config {
sCert, err := tls.X509KeyPair(oi.Context.Cert, oi.Context.Key)
if err != nil {
glog.Fatal(err)
}
return &tls.Config{
Certificates: []tls.Certificate{sCert},
}
}

func (tc *TidbClusterConfig) BackupHelmSetString(m map[string]string) string {

set := map[string]string{
Expand Down Expand Up @@ -1864,23 +1877,8 @@ func (oa *operatorActions) RegisterWebHookAndService(info *OperatorConfig) error

namespace := os.Getenv("NAMESPACE")
configName := info.WebhookConfigName
filePath := "/webhook.local.config/certificates/ca.crt"

fd, err := os.Open(filePath)
if err != nil {
glog.Errorf("file can't open file path %s err %v", filePath, err)
return err
}
defer fd.Close()

ca, err := ioutil.ReadAll(fd)

if err != nil {
glog.Errorf("file can't read file path %s err %v", filePath, err)
return err
}

_, err = client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Create(&admissionV1beta1.ValidatingWebhookConfiguration{
_, err := client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Create(&admissionV1beta1.ValidatingWebhookConfiguration{
ObjectMeta: metav1.ObjectMeta{
Name: configName,
},
Expand All @@ -1901,7 +1899,7 @@ func (oa *operatorActions) RegisterWebHookAndService(info *OperatorConfig) error
Name: info.WebhookServiceName,
Path: strPtr("/pods"),
},
CABundle: ca,
CABundle: info.Context.SigningCert,
},
},
},
Expand Down Expand Up @@ -1998,11 +1996,11 @@ func (oa *operatorActions) drainerHealth(info *TidbClusterConfig, hostName strin
return len(healths.PumpPos) > 0 && healths.Synced
}

func (oa *operatorActions) StartValidatingAdmissionWebhookServerOrDie() {
func (oa *operatorActions) StartValidatingAdmissionWebhookServerOrDie(info *OperatorConfig) {
http.HandleFunc("/pods", webhook.ServePods)
server := &http.Server{
Addr: ":443",
TLSConfig: oa.cfg.ConfigTLS(),
TLSConfig: info.ConfigTLS(),
}
err := server.ListenAndServeTLS("", "")
if err != nil {
Expand Down
11 changes: 8 additions & 3 deletions tests/cmd/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ package main
import (
"fmt"
_ "net/http/pprof"
"os"

"github.com/golang/glog"
"github.com/jinzhu/copier"
"k8s.io/apiserver/pkg/util/logs"

"github.com/pingcap/tidb-operator/tests"
"github.com/pingcap/tidb-operator/tests/backup"
"github.com/pingcap/tidb-operator/tests/pkg/apimachinery"
"github.com/pingcap/tidb-operator/tests/pkg/client"
)

Expand All @@ -38,10 +40,9 @@ func main() {

cli, kubeCli := client.NewCliOrDie()

oa := tests.NewOperatorActions(cli, kubeCli, conf)
context := apimachinery.SetupServerCert(os.Getenv("NAMESPACE"), "webhook-service")

// start a http server in goruntine
go oa.StartValidatingAdmissionWebhookServerOrDie()
oa := tests.NewOperatorActions(cli, kubeCli, conf)

operatorInfo := &tests.OperatorConfig{
Namespace: "pingcap",
Expand All @@ -54,8 +55,12 @@ func main() {
WebhookServiceName: "webhook-service",
WebhookSecretName: "webhook-secret",
WebhookConfigName: "webhook-config",
Context: context,
}

// start a http server in goruntine
go oa.StartValidatingAdmissionWebhookServerOrDie(operatorInfo)

initTidbVersion, err := conf.GetTiDBVersion()
if err != nil {
glog.Fatal(err)
Expand Down
12 changes: 9 additions & 3 deletions tests/cmd/stability/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import (
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"time"

"github.com/golang/glog"
"github.com/jinzhu/copier"
"github.com/pingcap/tidb-operator/tests/pkg/apimachinery"
"github.com/pingcap/tidb-operator/tests/pkg/client"
"k8s.io/apiserver/pkg/util/logs"

Expand All @@ -37,16 +39,16 @@ func main() {

conf := tests.ParseConfigOrDie()
cli, kubeCli := client.NewCliOrDie()

context := apimachinery.SetupServerCert(os.Getenv("NAMESPACE"), "webhook-service")

oa := tests.NewOperatorActions(cli, kubeCli, conf)
fta := tests.NewFaultTriggerAction(cli, kubeCli, conf)
fta.CheckAndRecoverEnvOrDie()

tidbVersion := conf.GetTiDBVersionOrDie()
upgardeTiDBVersions := conf.GetUpgradeTidbVersionsOrDie()

// start a http server in goruntine
go oa.StartValidatingAdmissionWebhookServerOrDie()

// operator config
operatorCfg := &tests.OperatorConfig{
Namespace: "pingcap",
Expand All @@ -58,8 +60,12 @@ func main() {
WebhookServiceName: "webhook-service",
WebhookSecretName: "webhook-secret",
WebhookConfigName: "webhook-config",
Context: context,
}

// start a http server in goruntine
go oa.StartValidatingAdmissionWebhookServerOrDie(operatorCfg)

// TODO remove this
// create database and table and insert a column for test backup and restore
initSql := `"create database record;use record;create table test(t char(32))"`
Expand Down
16 changes: 0 additions & 16 deletions tests/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package tests

import (
"crypto/tls"
"flag"
"fmt"
"github.com/pingcap/tidb-operator/tests/pkg/blockwriter"
Expand Down Expand Up @@ -63,11 +62,6 @@ func NewConfig() *Config {
flag.StringVar(&cfg.TidbVersions, "tidb-versions", "v2.1.3,v2.1.4", "tidb versions")
flag.StringVar(&cfg.OperatorTag, "operator-tag", "master", "operator tag used to choose charts")
flag.StringVar(&cfg.OperatorImage, "operator-image", "pingcap/tidb-operator:latest", "operator image")
flag.StringVar(&cfg.CertFile, "tls-cert-file", cfg.CertFile, ""+
"File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated "+
"after server cert).")
flag.StringVar(&cfg.KeyFile, "tls-private-key-file", cfg.KeyFile, ""+
"File containing the default x509 private key matching --tls-cert-file.")
flag.StringVar(&cfg.OperatorRepoDir, "operator-repo-dir", "/tidb-operator", "local directory to which tidb-operator cloned")
flag.Parse()

Expand Down Expand Up @@ -132,16 +126,6 @@ func (c *Config) GetTiDBVersionOrDie() string {
return v
}

func (c *Config) ConfigTLS() *tls.Config {
sCert, err := tls.LoadX509KeyPair(c.CertFile, c.KeyFile)
if err != nil {
glog.Fatal(err)
}
return &tls.Config{
Certificates: []tls.Certificate{sCert},
}
}

func (c *Config) GetUpgradeTidbVersions() []string {
tidbVersions := strings.Split(c.TidbVersions, ",")

Expand Down
20 changes: 0 additions & 20 deletions tests/manifests/e2e/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
---
apiVersion: v1
kind: Secret
metadata:
name: webhook-secret
namespace: tidb-operator-e2e
type: Opaque
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM2ekNDQWRPZ0F3SUJBZ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SXhSS3cxUE5lRFZ4WEdseHpaZzFLMjZyUXhCNUtJdW4KeHRmMFh2dDRZZ2NnMTJPVHVNMVRwcFlaaHhRM3k5TVBRdm9nK3lTRktoREZ4ZEJ6TUt0RDY0QXoxU1Q5VVUvawo1WjBSYVlyMlgrOENBd0VBQWFNak1DRXdEZ1lEVlIwUEFRSC9CQVFEQWdLa01BOEdBMVVkRXdFQi93UUZNQU1CCkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBS21XczJYNXRuTm4vTmNnOENJSGpNMUIyRDN3SDE2d0ttb2oKelVQcFEvdXpBaWZ5ZW1WdytKNEVjWnVyVlpSUlpBUFp0Kyt1RTYvS2kxcUFPNmp1U0dSU0xXaVA3ZFA5SXF6dwpIRDZ6Nzl5dDBFMDJSRFlVUzhsbVJqWlFhbzJoNVJVTi81ZXVabmtqaWFFQ2VlOUMxVGkyaWwrMHdUZEdQbFl1CmFRTTZYMU45aXZiK3huSnROQlE2STJseTBDNG94aFZKM1o0SC80Ym9Vd3UzT3d0OEhmL21NYzA0bkl6N1lZOGwKUm12U3BrNWYxM0k1VjRLTUZuQ1V4WjAyWGVTbkY1dWVNYktpcUo0NXk3cVJ2SWIydlNBRVFHbWx4M1piRjNPRwpUdC9BWk1ITkM3ZnNWQmY5c1QrQUFEMGtTSXc3SERiMXBGOEFUVU84UHRHZzh5NGhJQTg9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -61,14 +49,9 @@ spec:
- --operator-tag=e2e
- --operator-image=pingcap/tidb-operator:latest
- --tidb-versions=v2.1.3,v2.1.4
- --tls-cert-file=/webhook.local.config/certificates/tls.crt
- --tls-private-key-file=/webhook.local.config/certificates/tls.key
volumeMounts:
- mountPath: /logDir
name: logdir
- name: webhook-certs
readOnly: true
mountPath: /webhook.local.config/certificates
env:
- name: NAMESPACE
valueFrom:
Expand All @@ -79,7 +62,4 @@ spec:
hostPath:
path: /var/log
type: Directory
- name: webhook-certs
secret:
secretName: webhook-secret
restartPolicy: Never
20 changes: 0 additions & 20 deletions tests/manifests/stability/stability.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
---
apiVersion: v1
kind: Secret
metadata:
name: webhook-secret
namespace: tidb-operator-stability
type: Opaque
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvRENDQWVTZ0F3SUJBZ0lJVS9pL0hYaGpvaXN3RFFZSktvWklodmNOQVFFTEJRQXdIVEViTUJrR0ExVUUKQXhNU1pUSmxMWE5sY25abGNpMWpaWEowTFdOaE1CNFhEVEU1TURReE5EQTJNVFUwTWxvWERUSXdNRFF4TXpBMgpNVFUwTTFvd05qRTBNRElHQTFVRUF4TXJkMlZpYUc5dmF5MXpaWEoyYVdObExuUnBaR0l0YjNCbGNtRjBiM0l0CmMzUmhZbWxzYVhSNUxuTjJZekNDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFMVmwKZCtTR1dONDNSd3hNTUt3MVZhWG1vYWRtWXU1VjNsNlhVTjczZTNSYUZ2RDlYZEI0MUovc0EvQmp5NThqSm1OKwpoYURTczgvMVA1L1JHODFhVExpUUZDS3FWdTY3bDQvR3Y1a1gyZ3I4UHJMcjBkVW9hbGpyYUpzbm9VdVJ5VEJQCkJWSm1BQWppQlAySmJoWldIVy9HWCtvNjNTa3NucHZmZEcxVXA3M3NCS0hYRCt5dXEydnVMOHI0WTIveHU4SnYKZUFhbUE0K0hHdHNuNlUrQWVwc0V3QjdDcEQ3SWd6ejVROE9HVWtUcVg1NVJtNFJyM3dyOWJDY3ZyZmZNd0VZZgpLME9jWmNEcG9yRnkyNkxCeWx6WjJCOWdDRlhzdFN6V2xaSDZ2TmhJaDZ5OEl3YzlvWjRWZWFJOTkzUmF4cHpRCi8ySzhhbGVCZHl3TmNLeFZGbVVDQXdFQUFhTW5NQ1V3RGdZRF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GSUNBVEUtLS0tLQo=
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -59,17 +47,12 @@ spec:
command:
- /usr/local/bin/stability-test
- --config=/etc/tidb-operator-stability/config.yaml
- --tls-cert-file=/webhook.local.config/certificates/tls.crt
- --tls-private-key-file=/webhook.local.config/certificates/tls.key
volumeMounts:
- mountPath: /logDir
name: logdir
- name: config
readOnly: true
mountPath: /etc/tidb-operator-stability
- name: webhook-certs
readOnly: true
mountPath: /webhook.local.config/certificates
env:
- name: MY_NODE_NAME
valueFrom:
Expand All @@ -90,7 +73,4 @@ spec:
items:
- key: config
path: config.yaml
- name: webhook-certs
secret:
secretName: webhook-secret
restartPolicy: Never
Loading