diff --git a/Makefile b/Makefile index 78899077b..15fc3c384 100644 --- a/Makefile +++ b/Makefile @@ -144,10 +144,8 @@ docker-push: e2e-setup: helm install --create-namespace -n flux-system helm-flux http://oam.dev/catalog/helm-flux2-0.1.0.tgz helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz - helm repo add jetstack https://charts.jetstack.io helm repo update - helm upgrade --install --create-namespace --namespace cert-manager cert-manager jetstack/cert-manager --version v1.2.0 --set installCRDs=true --wait - helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set admissionWebhooks.certManager.enabled=true --set image.repository=vela-core-test --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core + helm upgrade --install --create-namespace --namespace vela-system --set image.pullPolicy=IfNotPresent --set image.repository=vela-core-test --set image.tag=$(GIT_COMMIT) --wait kubevela ./charts/vela-core ginkgo version ginkgo -v -r e2e/setup kubectl wait --for=condition=Ready pod -l app.kubernetes.io/name=vela-core,app.kubernetes.io/instance=kubevela -n vela-system --timeout=600s diff --git a/apis/types/types.go b/apis/types/types.go index fee0c92dc..c755ef796 100644 --- a/apis/types/types.go +++ b/apis/types/types.go @@ -50,8 +50,6 @@ type EnvMeta struct { Email string `json:"email,omitempty"` Domain string `json:"domain,omitempty"` - // Below are not arguments, should be auto-generated - Issuer string `json:"issuer"` Current string `json:"current,omitempty"` } diff --git a/charts/vela-core/templates/admission-webhooks/job-patch/clusterrole.yaml b/charts/vela-core/templates/admission-webhooks/job-patch/clusterrole.yaml index 9e6d858e5..96b0ba33f 100644 --- a/charts/vela-core/templates/admission-webhooks/job-patch/clusterrole.yaml +++ b/charts/vela-core/templates/admission-webhooks/job-patch/clusterrole.yaml @@ -18,4 +18,11 @@ rules: verbs: - get - update + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - get + - update {{- end }} diff --git a/charts/vela-core/templates/admission-webhooks/job-patch/job-patchWebhook.yaml b/charts/vela-core/templates/admission-webhooks/job-patch/job-patchWebhook.yaml index d93c8b027..03744aeed 100644 --- a/charts/vela-core/templates/admission-webhooks/job-patch/job-patchWebhook.yaml +++ b/charts/vela-core/templates/admission-webhooks/job-patch/job-patchWebhook.yaml @@ -32,6 +32,7 @@ spec: - --namespace={{ .Release.Namespace }} - --secret-name={{ template "kubevela.fullname" . }}-admission - --patch-failure-policy={{ .Values.admissionWebhooks.failurePolicy }} + - --crds=applications.core.oam.dev restartPolicy: OnFailure serviceAccountName: {{ template "kubevela.fullname" . }}-admission {{- with .Values.admissionWebhooks.patch.affinity }} diff --git a/charts/vela-core/values.yaml b/charts/vela-core/values.yaml index 5818c8b55..96b321bdc 100644 --- a/charts/vela-core/values.yaml +++ b/charts/vela-core/values.yaml @@ -88,8 +88,8 @@ admissionWebhooks: patch: enabled: true image: - repository: jettech/kube-webhook-certgen - tag: v1.5.0 + repository: wonderflow/kube-webhook-certgen + tag: v2.1 pullPolicy: IfNotPresent affinity: {} tolerations: [] diff --git a/design/vela-core/route.md b/design/vela-core/route.md index 1dd444bb9..e0c39e63e 100644 --- a/design/vela-core/route.md +++ b/design/vela-core/route.md @@ -1,8 +1,8 @@ # Route Trait Design -The main idea of route trait is to let users have an entrypoint to visit their App. +The main idea of [route trait](https://github.com/oam-dev/catalog/tree/master/traits/routetrait) is to let users have an entrypoint to visit their App. -In k8s world, if you want to do so, you have to understand K8s [Serivce](https://kubernetes.io/docs/concepts/services-networking/service/) +In k8s world, if you want to do so, you have to understand K8s [Service](https://kubernetes.io/docs/concepts/services-networking/service/) , [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/), [Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/). It's not easy to get all of these things work well. diff --git a/docs/en/developers/config-enviroments.md b/docs/en/developers/config-enviroments.md index a180fd456..0efb7cbc1 100644 --- a/docs/en/developers/config-enviroments.md +++ b/docs/en/developers/config-enviroments.md @@ -2,7 +2,8 @@ title: Setting Up Deployment Environment --- -A deployment environment is where you could configure the workspace, email for certificate issuer and domain for your applications globally. A typical set of deployment environment is `test`, `staging`, `prod`, etc. +A deployment environment is where you could configure the workspace, email for contact and domain for your applications globally. +A typical set of deployment environment is `test`, `staging`, `prod`, etc. ## Create environment diff --git a/hack/crd/update.go b/hack/crd/update.go index 62b305cfa..4cf0d5dd0 100644 --- a/hack/crd/update.go +++ b/hack/crd/update.go @@ -64,16 +64,6 @@ func fixNewSchemaValidationCheck(crds []string) error { } ioutil.WriteFile(crd, []byte(strings.Join(newData, "\n")), 0644) } - // fix issue https://github.com/oam-dev/kubevela/issues/993 - if strings.HasSuffix(crd, "legacy/charts/vela-core-legacy/crds/standard.oam.dev_routes.yaml") { - for _, line := range strings.Split(string(data), "\n") { - if strings.Contains(line, "default: Issuer") { - continue - } - newData = append(newData, line) - } - ioutil.WriteFile(crd, []byte(strings.Join(newData, "\n")), 0644) - } } return nil } diff --git a/pkg/utils/env/env.go b/pkg/utils/env/env.go index da55b5c98..8d9c971f0 100644 --- a/pkg/utils/env/env.go +++ b/pkg/utils/env/env.go @@ -25,23 +25,16 @@ import ( "os" "path/filepath" - acmev1 "github.com/wonderflow/cert-manager-api/pkg/apis/acme/v1" - certmanager "github.com/wonderflow/cert-manager-api/pkg/apis/certmanager/v1" - v1 "github.com/wonderflow/cert-manager-api/pkg/apis/meta/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8stypes "k8s.io/apimachinery/pkg/types" - "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/oam-dev/kubevela/apis/types" "github.com/oam-dev/kubevela/pkg/utils/system" ) -// ProductionACMEServer is the production ACME Server from let's encrypt -const ProductionACMEServer = "https://acme-v02.api.letsencrypt.org/directory" - // GetEnvDirByName will get env dir from name func GetEnvDirByName(name string) string { envdir, _ := system.GetEnvDir() @@ -79,9 +72,6 @@ func CreateOrUpdateEnv(ctx context.Context, c client.Client, envName string, env if envArgs.Email == "" { envArgs.Email = old.Email } - if envArgs.Issuer == "" { - envArgs.Issuer = old.Issuer - } if envArgs.Namespace == "" { envArgs.Namespace = old.Namespace } @@ -103,33 +93,6 @@ func CreateOrUpdateEnv(ctx context.Context, c client.Client, envName string, env } } - // Create Issuer For SSL if both email and domain are all set. - if envArgs.Email != "" && envArgs.Domain != "" { - issuerName := "oam-env-" + envArgs.Name - if err := c.Create(ctx, &certmanager.Issuer{ - ObjectMeta: metav1.ObjectMeta{Name: issuerName, Namespace: envArgs.Namespace}, - Spec: certmanager.IssuerSpec{ - IssuerConfig: certmanager.IssuerConfig{ - ACME: &acmev1.ACMEIssuer{ - Email: envArgs.Email, - Server: ProductionACMEServer, - PrivateKey: v1.SecretKeySelector{ - LocalObjectReference: v1.LocalObjectReference{Name: "oam-env-" + envArgs.Name + ".key"}, - }, - Solvers: []acmev1.ACMEChallengeSolver{{ - HTTP01: &acmev1.ACMEChallengeSolverHTTP01{ - Ingress: &acmev1.ACMEChallengeSolverHTTP01Ingress{Class: pointer.StringPtr("nginx")}, - }, - }}, - }, - }, - }, - }); err != nil && !apierrors.IsAlreadyExists(err) { - return message, err - } - envArgs.Issuer = issuerName - } - data, err := json.Marshal(envArgs) if err != nil { return message, err diff --git a/references/cli/up_test.go b/references/cli/up_test.go index 57f6455d1..5f6fa4645 100644 --- a/references/cli/up_test.go +++ b/references/cli/up_test.go @@ -36,7 +36,6 @@ func TestUp(t *testing.T) { env := types.EnvMeta{ Name: "up", Namespace: "env-up", - Issuer: "up", } o := common.AppfileOptions{ IO: ioStream,