diff --git a/contrib/charts/cert-manager/templates/deployment.yaml b/contrib/charts/cert-manager/templates/deployment.yaml index e1fd4c032..f9d3c70d9 100644 --- a/contrib/charts/cert-manager/templates/deployment.yaml +++ b/contrib/charts/cert-manager/templates/deployment.yaml @@ -21,10 +21,16 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.extraArgs }} args: -{{ toYaml .Values.extraArgs | indent 12 }} + - --cluster-resource-namespace=$(POD_NAMESPACE) + {{- if .Values.extraArgs }} +{{ toYaml .Values.extraArgs | indent 10 }} {{- end }} + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace resources: {{ toYaml .Values.resources | indent 12 }} {{- if .Values.ingressShim.enabled }} @@ -33,7 +39,7 @@ spec: imagePullPolicy: {{ .Values.ingressShim.image.pullPolicy }} {{- if .Values.ingressShim.extraArgs }} args: -{{ toYaml .Values.ingressShim.extraArgs | indent 12 }} +{{ toYaml .Values.ingressShim.extraArgs | indent 10 }} {{- end }} resources: {{ toYaml .Values.ingressShim.resources | indent 12 }} diff --git a/docs/deploy/rbac/deployment.yaml b/docs/deploy/rbac/deployment.yaml index 12e8f62ef..333e77d9e 100644 --- a/docs/deploy/rbac/deployment.yaml +++ b/docs/deploy/rbac/deployment.yaml @@ -23,6 +23,13 @@ spec: - name: cert-manager image: "quay.io/jetstack/cert-manager-controller:v0.2.3" imagePullPolicy: IfNotPresent + args: + - --cluster-resource-namespace=$(POD_NAMESPACE) + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace resources: requests: cpu: 10m diff --git a/docs/deploy/without-rbac/deployment.yaml b/docs/deploy/without-rbac/deployment.yaml index 8f5863e18..644fc22c9 100644 --- a/docs/deploy/without-rbac/deployment.yaml +++ b/docs/deploy/without-rbac/deployment.yaml @@ -23,6 +23,13 @@ spec: - name: cert-manager image: "quay.io/jetstack/cert-manager-controller:v0.2.3" imagePullPolicy: IfNotPresent + args: + - --cluster-resource-namespace=$(POD_NAMESPACE) + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace resources: requests: cpu: 10m diff --git a/test/e2e/clusterissuer/clusterissuer_ca.go b/test/e2e/clusterissuer/clusterissuer_ca.go index 1ee701c6f..5d4918419 100644 --- a/test/e2e/clusterissuer/clusterissuer_ca.go +++ b/test/e2e/clusterissuer/clusterissuer_ca.go @@ -22,7 +22,7 @@ import ( "github.com/jetstack/cert-manager/test/util" ) -const clusterResourceNamespace = "kube-system" +const clusterResourceNamespace = "cert-manager" var _ = framework.CertManagerDescribe("CA ClusterIssuer", func() { f := framework.NewDefaultFramework("create-ca-clusterissuer") diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 9bcd27055..03dfbbb23 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -34,6 +34,8 @@ import ( _ "github.com/jetstack/cert-manager/test/e2e/issuer" ) +const certManagerDeploymentNamespace = "cert-manager" + // TestE2E checks configuration parameters (specified through flags) and then runs // E2E tests using the Ginkgo runner. func RunE2ETests(t *testing.T) { @@ -47,7 +49,7 @@ func RunE2ETests(t *testing.T) { } glog.Infof("Installing cert-manager helm chart") - InstallHelmChart(t, releaseName, "./contrib/charts/cert-manager", "cert-manager", "./test/fixtures/cert-manager-values.yaml") + InstallHelmChart(t, releaseName, "./contrib/charts/cert-manager", certManagerDeploymentNamespace, "./test/fixtures/cert-manager-values.yaml") glog.Infof("Installing boulder chart") // 10 minute timeout for boulder install due to large images