├── .helmignore ├── assets └── icon.png ├── test ├── acceptance │ ├── tests │ │ ├── fixtures │ │ │ ├── bases │ │ │ │ ├── mesh-gateway │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── proxydefaults.yaml │ │ │ │ ├── static-metrics-app │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── service.yaml │ │ │ │ │ └── deployment.yaml │ │ │ │ ├── static-client │ │ │ │ │ ├── serviceaccount.yaml │ │ │ │ │ ├── service.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── psp-rolebinding.yaml │ │ │ │ │ ├── anyuid-scc-rolebinding.yaml │ │ │ │ │ ├── privileged-scc-rolebinding.yaml │ │ │ │ │ └── deployment.yaml │ │ │ │ └── static-server │ │ │ │ │ ├── serviceaccount.yaml │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ ├── service.yaml │ │ │ │ │ ├── psp-rolebinding.yaml │ │ │ │ │ ├── anyuid-scc-rolebinding.yaml │ │ │ │ │ ├── privileged-scc-rolebinding.yaml │ │ │ │ │ └── deployment.yaml │ │ │ ├── cases │ │ │ │ ├── static-client-inject │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── patch.yaml │ │ │ │ ├── static-client-tproxy │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── patch.yaml │ │ │ │ ├── static-server-inject │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── patch.yaml │ │ │ │ ├── static-client-multi-dc │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── patch.yaml │ │ │ │ └── static-client-namespaces │ │ │ │ │ ├── kustomization.yaml │ │ │ │ │ └── patch.yaml │ │ │ └── crds │ │ │ │ ├── mesh.yaml │ │ │ │ ├── serviceresolver.yaml │ │ │ │ ├── ingressgateway.yaml │ │ │ │ ├── terminatinggateway.yaml │ │ │ │ ├── servicerouter.yaml │ │ │ │ ├── proxydefaults.yaml │ │ │ │ ├── servicesplitter.yaml │ │ │ │ ├── servicedefaults.yaml │ │ │ │ └── serviceintentions.yaml │ │ ├── basic │ │ │ └── main_test.go │ │ ├── sync │ │ │ └── main_test.go │ │ ├── connect │ │ │ └── main_test.go │ │ ├── consul-dns │ │ │ └── main_test.go │ │ ├── controller │ │ │ └── main_test.go │ │ ├── metrics │ │ │ └── main_test.go │ │ ├── ingress-gateway │ │ │ └── main_test.go │ │ ├── terminating-gateway │ │ │ └── main_test.go │ │ ├── mesh-gateway │ │ │ └── main_test.go │ │ └── example │ │ │ └── main_test.go │ ├── go.mod │ └── framework │ │ ├── logger │ │ └── logger.go │ │ └── suite │ │ └── suite.go ├── terraform │ ├── aks │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── main.tf │ ├── eks │ │ ├── outputs.tf │ │ └── variables.tf │ ├── openshift │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── oc-login.sh │ └── gke │ │ ├── outputs.tf │ │ ├── variables.tf │ │ └── main.tf └── unit │ ├── _helpers.bash │ ├── prometheus.bats │ ├── test-runner.bats │ ├── controller-webhook-service.bats │ ├── controller-clusterrolebinding.bats │ ├── controller-leader-election-role.bats │ ├── controller-leader-election-rolebinding.bats │ ├── controller-mutatingwebhookconfiguration.bats │ ├── create-federation-secret-rolebinding.bats │ ├── crd-meshes.bats │ ├── crd-proxydefaults.bats │ ├── crd-ingressgateways.bats │ ├── crd-servicerouters.bats │ ├── crd-servicedefaults.bats │ ├── crd-serviceintentions.bats │ ├── crd-serviceresolvers.bats │ ├── crd-servicesplitters.bats │ ├── crd-terminatinggateway.bats │ ├── server-podsecuritypolicy.bats │ ├── controller-podsecuritypolicy.bats │ ├── connect-inject-clusterrolebinding.bats │ ├── server-securitycontextconstraints.bats │ ├── mesh-gateway-clusterrolebinding.bats │ ├── connect-inject-service.bats │ ├── client-snapshot-agent-podsecuritypolicy.bats │ ├── sync-catalog-podsecuritypolicy.bats │ ├── connect-inject-podsecuritypolicy.bats │ ├── client-snapshot-agent-rolebinding.bats │ ├── webhook-cert-manager-deployment.bats │ ├── client-rolebinding.bats │ ├── server-rolebinding.bats │ ├── connect-inject-authmethod-clusterrole.bats │ ├── create-federation-secret-podsecuritypolicy.bats │ ├── ingress-gateways-rolebinding.bats │ ├── webhook-cert-manager-clusterrolebinding.bats │ ├── sync-catalog-clusterrolebinding.bats │ ├── connect-inject-authmethod-clusterrolebinding.bats │ ├── terminating-gateways-rolebinding.bats │ ├── connect-inject-mutatingwebhook.bats │ ├── tls-init-podsecuritypolicy.bats │ ├── mesh-gateway-podsecuritypolicy.bats │ ├── server-acl-init-podsecuritypolicy.bats │ ├── tls-init-cleanup-podsecuritypolicy.bats │ ├── server-acl-init-cleanup-podsecuritypolicy.bats │ ├── create-federation-secret-serviceaccount.bats │ ├── server-acl-init-rolebinding.bats │ ├── ingress-gateways-podsecuritypolicy.bats │ ├── tls-init-cleanup-job.bats │ ├── tls-init-rolebinding.bats │ ├── terminating-gateways-podsecuritypolicy.bats │ └── server-acl-init-cleanup-rolebinding.bats ├── .gitignore ├── hack ├── helm-reference-gen │ ├── go.mod │ ├── parse_error.go │ └── go.sum └── aws-acceptance-test-cleanup │ └── go.mod ├── .github ├── pull_request_template.md └── ISSUE_TEMPLATE │ ├── config.yml │ ├── question.md │ └── feature_request.md ├── Makefile ├── addons ├── values │ └── prometheus.yaml └── gen.sh ├── templates ├── webhook-cert-manager-serviceaccount.yaml ├── controller-leader-election-rolebinding.yaml ├── controller-clusterrolebinding.yaml ├── controller-webhook-service.yaml ├── mesh-gateway-clusterrolebinding.yaml ├── NOTES.txt ├── connect-inject-authmethod-clusterrole.yaml ├── client-rolebinding.yaml ├── server-rolebinding.yaml ├── controller-serviceaccount.yaml ├── mesh-gateway-serviceaccount.yaml ├── create-federation-secret-serviceaccount.yaml ├── webhook-cert-manager-clusterrolebinding.yaml ├── connect-inject-authmethod-serviceaccount.yaml ├── connect-inject-service.yaml ├── server-acl-init-serviceaccount.yaml ├── client-serviceaccount.yaml ├── server-serviceaccount.yaml ├── server-acl-init-cleanup-serviceaccount.yaml ├── controller-leader-election-role.yaml ├── sync-catalog-clusterrolebinding.yaml ├── client-snapshot-agent-rolebinding.yaml ├── enterprise-license-serviceaccount.yaml ├── connect-inject-clusterrolebinding.yaml ├── tls-init-cleanup-serviceaccount.yaml ├── tls-init-serviceaccount.yaml ├── connect-inject-leader-election-rolebinding.yaml ├── connect-inject-serviceaccount.yaml ├── create-federation-secret-rolebinding.yaml ├── ingress-gateways-rolebinding.yaml ├── server-disruptionbudget.yaml ├── sync-catalog-serviceaccount.yaml ├── server-acl-init-rolebinding.yaml ├── client-snapshot-agent-serviceaccount.yaml ├── server-acl-init-cleanup-rolebinding.yaml ├── enterprise-license-rolebinding.yaml ├── terminating-gateways-rolebinding.yaml ├── tls-init-rolebinding.yaml ├── connect-inject-leader-election-role.yaml ├── tls-init-cleanup-rolebinding.yaml ├── server-acl-init-cleanup-role.yaml ├── client-config-configmap.yaml ├── tls-init-role.yaml ├── controller-podsecuritypolicy.yaml ├── server-role.yaml ├── webhook-cert-manager-podsecuritypolicy.yaml ├── mesh-gateway-service.yaml ├── webhook-cert-manager-clusterrole.yaml ├── client-snapshot-agent-role.yaml ├── sync-catalog-podsecuritypolicy.yaml ├── create-federation-secret-podsecuritypolicy.yaml ├── connect-inject-podsecuritypolicy.yaml ├── ingress-gateways-serviceaccount.yaml ├── server-acl-init-podsecuritypolicy.yaml ├── mesh-gateway-podsecuritypolicy.yaml ├── dns-service.yaml ├── terminating-gateways-serviceaccount.yaml ├── server-acl-init-cleanup-podsecuritypolicy.yaml ├── server-acl-init-role.yaml ├── client-snapshot-agent-podsecuritypolicy.yaml ├── enterprise-license-podsecuritypolicy.yaml ├── server-podsecuritypolicy.yaml ├── mesh-gateway-clusterrole.yaml ├── enterprise-license-role.yaml ├── ingress-gateways-podsecuritypolicy.yaml ├── tls-init-cleanup-podsecuritypolicy.yaml ├── tls-init-podsecuritypolicy.yaml ├── tls-init-cleanup-role.yaml ├── terminating-gateways-podsecuritypolicy.yaml ├── connect-inject-clusterrole.yaml ├── ingress-gateways-role.yaml ├── terminating-gateways-role.yaml ├── client-role.yaml ├── sync-catalog-clusterrole.yaml ├── server-securitycontextconstraints.yaml ├── connect-inject-authmethod-clusterrolebinding.yaml ├── create-federation-secret-role.yaml ├── client-securitycontextconstraints.yaml ├── connect-inject-mutatingwebhook.yaml ├── server-config-configmap.yaml ├── controller-clusterrole.yaml ├── ingress-gateways-service.yaml └── webhook-cert-manager-configmap.yaml ├── README.md └── Chart.yaml /.helmignore: -------------------------------------------------------------------------------- 1 | .git/ 2 | .terraform/ 3 | bin/ 4 | test/ 5 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hashicorp/consul-helm/HEAD/assets/icon.png -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/mesh-gateway/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - proxydefaults.yaml 3 | -------------------------------------------------------------------------------- /test/terraform/aks/outputs.tf: -------------------------------------------------------------------------------- 1 | output "kubeconfigs" { 2 | value = local_file.kubeconfigs.*.filename 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .terraform/ 3 | .terraform.tfstate* 4 | terraform.tfstate* 5 | terraform.tfvars 6 | values.dev.yaml 7 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-metrics-app/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yaml 3 | - service.yaml 4 | -------------------------------------------------------------------------------- /test/terraform/eks/outputs.tf: -------------------------------------------------------------------------------- 1 | output "kubeconfigs" { 2 | value = [for cl in module.eks : pathexpand(format("~/.kube/%s", cl.cluster_id))] 3 | } 4 | -------------------------------------------------------------------------------- /test/terraform/openshift/outputs.tf: -------------------------------------------------------------------------------- 1 | output "kubeconfigs" { 2 | value = [for rg in azurerm_resource_group.test : format("$HOME/.kube/%s", rg.name)] 3 | } -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-client/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: static-client 5 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-server/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: static-server 5 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-inject/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../bases/static-client 3 | 4 | patchesStrategicMerge: 5 | - patch.yaml -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-tproxy/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../bases/static-client 3 | 4 | patchesStrategicMerge: 5 | - patch.yaml -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-server-inject/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../bases/static-server 3 | 4 | patchesStrategicMerge: 5 | - patch.yaml -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-multi-dc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../bases/static-client 3 | 4 | patchesStrategicMerge: 5 | - patch.yaml -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-namespaces/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../../bases/static-client 3 | 4 | patchesStrategicMerge: 5 | - patch.yaml 6 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/crds/mesh.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: consul.hashicorp.com/v1alpha1 2 | kind: Mesh 3 | metadata: 4 | name: mesh 5 | spec: 6 | transparentProxy: 7 | meshDestinationsOnly: true -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/crds/serviceresolver.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: consul.hashicorp.com/v1alpha1 2 | kind: ServiceResolver 3 | metadata: 4 | name: resolver 5 | spec: 6 | redirect: 7 | service: bar 8 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/mesh-gateway/proxydefaults.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: consul.hashicorp.com/v1alpha1 2 | kind: ProxyDefaults 3 | metadata: 4 | name: global 5 | spec: 6 | meshGateway: 7 | mode: local 8 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-client/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: static-client 5 | spec: 6 | selector: 7 | app: static-client 8 | ports: 9 | - port: 80 -------------------------------------------------------------------------------- /hack/helm-reference-gen/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/consul-helm/hack/helm-reference-gen 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/stretchr/testify v1.6.1 7 | gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 8 | ) 9 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-client/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yaml 3 | - service.yaml 4 | - serviceaccount.yaml 5 | - psp-rolebinding.yaml 6 | - anyuid-scc-rolebinding.yaml 7 | - privileged-scc-rolebinding.yaml -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-server/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yaml 3 | - service.yaml 4 | - serviceaccount.yaml 5 | - psp-rolebinding.yaml 6 | - anyuid-scc-rolebinding.yaml 7 | - privileged-scc-rolebinding.yaml -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-tproxy/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: static-client 5 | spec: 6 | template: 7 | metadata: 8 | annotations: 9 | "consul.hashicorp.com/connect-inject": "true" -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-metrics-app/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: static-metrics-app 5 | spec: 6 | selector: 7 | app: static-metrics-app 8 | ports: 9 | - port: 80 10 | targetPort: 9090 11 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-server/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: static-server 5 | spec: 6 | selector: 7 | app: static-server 8 | ports: 9 | - name: http 10 | port: 80 11 | targetPort: 8080 12 | -------------------------------------------------------------------------------- /hack/aws-acceptance-test-cleanup/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/consul-helm/hack/aws-acceptance-test-cleanup 2 | 3 | go 1.16 4 | 5 | require ( 6 | github.com/aws/aws-sdk-go v1.38.63 7 | github.com/cenkalti/backoff/v4 v4.1.1 8 | github.com/davecgh/go-spew v1.1.1 // indirect 9 | ) 10 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/crds/ingressgateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: consul.hashicorp.com/v1alpha1 2 | kind: IngressGateway 3 | metadata: 4 | name: ingress-gateway 5 | spec: 6 | listeners: 7 | - port: 8080 8 | protocol: "tcp" 9 | services: 10 | - name: "foo" 11 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Changes proposed in this PR: 2 | - 3 | - 4 | 5 | How I've tested this PR: 6 | 7 | How I expect reviewers to test this PR: 8 | 9 | 10 | Checklist: 11 | - [ ] Bats tests added 12 | - [ ] CHANGELOG entry added (*HashiCorp engineers only, community PRs should not add a changelog entry*) 13 | 14 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/crds/terminatinggateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: consul.hashicorp.com/v1alpha1 2 | kind: TerminatingGateway 3 | metadata: 4 | name: terminating-gateway 5 | spec: 6 | services: 7 | - name: name 8 | caFile: "caFile" 9 | certFile: "certFile" 10 | keyFile: "keyFile" 11 | sni: "sni" 12 | -------------------------------------------------------------------------------- /test/acceptance/tests/basic/main_test.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/acceptance/tests/sync/main_test.go: -------------------------------------------------------------------------------- 1 | package sync 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/terraform/gke/outputs.tf: -------------------------------------------------------------------------------- 1 | output "cluster_ids" { 2 | value = google_container_cluster.cluster.*.id 3 | } 4 | 5 | output "cluster_names" { 6 | value = google_container_cluster.cluster.*.name 7 | } 8 | 9 | output "kubeconfigs" { 10 | value = [for cl in google_container_cluster.cluster : format("$HOME/.kube/%s", cl.name)] 11 | } 12 | -------------------------------------------------------------------------------- /test/acceptance/tests/connect/main_test.go: -------------------------------------------------------------------------------- 1 | package connect 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-client/psp-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: static-client 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: test-psp 9 | subjects: 10 | - kind: ServiceAccount 11 | name: static-client -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-server/psp-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: static-server 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: test-psp 9 | subjects: 10 | - kind: ServiceAccount 11 | name: static-server -------------------------------------------------------------------------------- /test/acceptance/tests/consul-dns/main_test.go: -------------------------------------------------------------------------------- 1 | package consuldns 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/acceptance/tests/controller/main_test.go: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testSuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testSuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testSuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/acceptance/tests/metrics/main_test.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-inject/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: static-client 5 | spec: 6 | template: 7 | metadata: 8 | annotations: 9 | "consul.hashicorp.com/connect-inject": "true" 10 | "consul.hashicorp.com/connect-service-upstreams": "static-server:1234" -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/cases/static-client-multi-dc/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: static-client 5 | spec: 6 | template: 7 | metadata: 8 | annotations: 9 | "consul.hashicorp.com/connect-inject": "true" 10 | "consul.hashicorp.com/connect-service-upstreams": "static-server:1234:dc2" -------------------------------------------------------------------------------- /test/acceptance/tests/ingress-gateway/main_test.go: -------------------------------------------------------------------------------- 1 | package ingressgateway 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/acceptance/tests/terminating-gateway/main_test.go: -------------------------------------------------------------------------------- 1 | package terminatinggateway 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | testsuite "github.com/hashicorp/consul-helm/test/acceptance/framework/suite" 8 | ) 9 | 10 | var suite testsuite.Suite 11 | 12 | func TestMain(m *testing.M) { 13 | suite = testsuite.NewSuite(m) 14 | os.Exit(suite.Run()) 15 | } 16 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-client/anyuid-scc-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: static-client-openshift-anyuid 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: system:openshift:scc:anyuid 9 | subjects: 10 | - kind: ServiceAccount 11 | name: static-client -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-server/anyuid-scc-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: static-server-openshift-anyuid 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: system:openshift:scc:anyuid 9 | subjects: 10 | - kind: ServiceAccount 11 | name: static-server -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TEST_IMAGE?=consul-helm-test 2 | 3 | test-docker: 4 | @docker build --rm -t '$(TEST_IMAGE)' -f $(CURDIR)/test/docker/Test.dockerfile $(CURDIR) 5 | 6 | # Generate Helm reference docs from values.yaml and update Consul website. 7 | # Usage: make gen-docs consul= 8 | gen-docs: 9 | @cd hack/helm-reference-gen; go run ./... $(consul) 10 | 11 | .PHONY: test-docker 12 | -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-client/privileged-scc-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: static-client-openshift-privileged 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: system:openshift:scc:privileged 9 | subjects: 10 | - kind: ServiceAccount 11 | name: static-client -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/bases/static-server/privileged-scc-rolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: static-server-openshift-privileged 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: ClusterRole 8 | name: system:openshift:scc:privileged 9 | subjects: 10 | - kind: ServiceAccount 11 | name: static-server -------------------------------------------------------------------------------- /test/acceptance/tests/fixtures/crds/servicerouter.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: consul.hashicorp.com/v1alpha1 2 | kind: ServiceDefaults 3 | metadata: 4 | name: router 5 | spec: 6 | protocol: http 7 | --- 8 | apiVersion: consul.hashicorp.com/v1alpha1 9 | kind: ServiceRouter 10 | metadata: 11 | name: router 12 | spec: 13 | routes: 14 | - match: 15 | http: 16 | pathPrefix: "/foo" 17 | -------------------------------------------------------------------------------- /test/acceptance/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/consul-helm/test/acceptance 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/gruntwork-io/terratest v0.31.2 7 | github.com/hashicorp/consul/api v1.9.0 8 | github.com/hashicorp/consul/sdk v0.8.0 9 | github.com/stretchr/testify v1.5.1 10 | gopkg.in/yaml.v2 v2.2.8 11 | k8s.io/api v0.19.3 12 | k8s.io/apimachinery v0.19.3 13 | k8s.io/client-go v0.19.3 14 | ) 15 | -------------------------------------------------------------------------------- /test/unit/_helpers.bash: -------------------------------------------------------------------------------- 1 | # chart_dir returns the directory for the chart 2 | chart_dir() { 3 | echo ${BATS_TEST_DIRNAME}/../.. 4 | } 5 | 6 | # Usage: assert_empty helm template -s