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

dex + istio: make service type configurable #558

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dex-auth/dex-crds/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ vars:
apiVersion: v1
fieldref:
fieldpath: data.application_secret
- name: service_type
objref:
kind: ConfigMap
name: dex-parameters
apiVersion: v1
fieldref:
fieldpath: data.service_type
configurations:
- params.yaml
images:
Expand Down
1 change: 1 addition & 0 deletions dex-auth/dex-crds/base/params.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ static_user_id=08a8684b-db88-4b73-90a9-3cd1661f5466
client_id=ldapdexapp
oidc_redirect_uris=['http://login.example.org:5555/callback/onprem-cluster']
application_secret=pUBnBOY80SnXgjibTYM9ZWNzY2xreNGQok
service_type=NodePort
2 changes: 2 additions & 0 deletions dex-auth/dex-crds/base/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ varReference:
kind: Deployment
- path: data/config.yaml
kind: ConfigMap
- path: spec/type
kind: Service
3 changes: 1 addition & 2 deletions dex-auth/dex-crds/base/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ kind: Service
metadata:
name: dex
spec:
type: NodePort
type: $(service_type)
ports:
- name: dex
port: 5556
protocol: TCP
targetPort: 5556
nodePort: 32000
selector:
app: dex
5 changes: 1 addition & 4 deletions istio/istio-install/base/istio-noauth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14044,7 +14044,7 @@ metadata:
app: istio-ingressgateway
istio: ingressgateway
spec:
type: NodePort
type: $(service_type)
selector:
release: istio
app: istio-ingressgateway
Expand All @@ -14056,16 +14056,13 @@ spec:
targetPort: 15020
-
name: http2
nodePort: 31380
port: 80
targetPort: 80
-
name: https
nodePort: 31390
port: 443
-
name: tcp
nodePort: 31400
port: 31400
-
name: https-kiali
Expand Down
16 changes: 16 additions & 0 deletions istio/istio-install/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,19 @@ images:
- name: docker.io/jaegertracing/all-in-one
newName: docker.io/jaegertracing/all-in-one
newTag: '1.9'

configMapGenerator:
- name: istio-install-parameters
env: params.env
generatorOptions:
disableNameSuffixHash: true
vars:
- name: service_type
objref:
kind: ConfigMap
name: istio-install-parameters
apiVersion: v1
fieldref:
fieldpath: data.service_type
configurations:
- params.yaml
1 change: 1 addition & 0 deletions istio/istio-install/base/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_type=NodePort
3 changes: 3 additions & 0 deletions istio/istio-install/base/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
varReference:
- path: spec/type
kind: Service
12 changes: 4 additions & 8 deletions tests/aws-aws-alb-ingress-controller-base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ rules:
verbs:
- get
- list
- watch
`)
- watch`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/cluster-role-binding.yaml", `
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -62,8 +61,7 @@ roleRef:
name: alb-ingress-controller
subjects:
- kind: ServiceAccount
name: alb-ingress-controller
`)
name: alb-ingress-controller`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/deployment.yaml", `
# Application Load Balancer (ALB) Ingress Controller Deployment Manifest.
# This manifest details sensible defaults for deploying an ALB Ingress Controller.
Expand Down Expand Up @@ -123,11 +121,9 @@ spec:
apiVersion: v1
kind: ServiceAccount
metadata:
name: alb-ingress-controller
`)
name: alb-ingress-controller`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/params.env", `
clusterName=
`)
clusterName=`)
th.writeK("/manifests/aws/aws-alb-ingress-controller/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ rules:
verbs:
- get
- list
- watch
`)
- watch`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/cluster-role-binding.yaml", `
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -114,8 +113,7 @@ roleRef:
name: alb-ingress-controller
subjects:
- kind: ServiceAccount
name: alb-ingress-controller
`)
name: alb-ingress-controller`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/deployment.yaml", `
# Application Load Balancer (ALB) Ingress Controller Deployment Manifest.
# This manifest details sensible defaults for deploying an ALB Ingress Controller.
Expand Down Expand Up @@ -175,11 +173,9 @@ spec:
apiVersion: v1
kind: ServiceAccount
metadata:
name: alb-ingress-controller
`)
name: alb-ingress-controller`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/params.env", `
clusterName=
`)
clusterName=`)
th.writeK("/manifests/aws/aws-alb-ingress-controller/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
15 changes: 5 additions & 10 deletions tests/aws-aws-alb-ingress-controller-overlays-vpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ spec:
`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/overlays/vpc/params.env", `
vpcId=
region=us-west-2
`)
region=us-west-2`)
th.writeK("/manifests/aws/aws-alb-ingress-controller/overlays/vpc", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down Expand Up @@ -107,8 +106,7 @@ rules:
verbs:
- get
- list
- watch
`)
- watch`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/cluster-role-binding.yaml", `
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -120,8 +118,7 @@ roleRef:
name: alb-ingress-controller
subjects:
- kind: ServiceAccount
name: alb-ingress-controller
`)
name: alb-ingress-controller`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/deployment.yaml", `
# Application Load Balancer (ALB) Ingress Controller Deployment Manifest.
# This manifest details sensible defaults for deploying an ALB Ingress Controller.
Expand Down Expand Up @@ -181,11 +178,9 @@ spec:
apiVersion: v1
kind: ServiceAccount
metadata:
name: alb-ingress-controller
`)
name: alb-ingress-controller`)
th.writeF("/manifests/aws/aws-alb-ingress-controller/base/params.env", `
clusterName=
`)
clusterName=`)
th.writeK("/manifests/aws/aws-alb-ingress-controller/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
21 changes: 7 additions & 14 deletions tests/aws-aws-efs-csi-driver-base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
`)
verbs: ["get", "list", "watch", "update"]`)
th.writeF("/manifests/aws/aws-efs-csi-driver/base/csi-attacher-cluster-role-binding.yaml", `
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -95,14 +94,12 @@ subjects:
roleRef:
kind: ClusterRole
name: efs-csi-external-attacher-clusterrole
apiGroup: rbac.authorization.k8s.io
`)
apiGroup: rbac.authorization.k8s.io`)
th.writeF("/manifests/aws/aws-efs-csi-driver/base/csi-controller-sa.yaml", `
apiVersion: v1
kind: ServiceAccount
metadata:
name: efs-csi-controller-sa
`)
name: efs-csi-controller-sa`)
th.writeF("/manifests/aws/aws-efs-csi-driver/base/csi-node-cluster-role.yaml", `
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -126,8 +123,7 @@ rules:
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["csi.storage.k8s.io"]
resources: ["csinodeinfos"]
verbs: ["get", "list", "watch", "update"]
`)
verbs: ["get", "list", "watch", "update"]`)
th.writeF("/manifests/aws/aws-efs-csi-driver/base/csi-node-cluster-role-binding.yaml", `
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -140,8 +136,7 @@ subjects:
roleRef:
kind: ClusterRole
name: efs-csi-node-clusterrole
apiGroup: rbac.authorization.k8s.io
`)
apiGroup: rbac.authorization.k8s.io`)
th.writeF("/manifests/aws/aws-efs-csi-driver/base/csi-node-daemon-set.yaml", `
kind: DaemonSet
apiVersion: apps/v1
Expand Down Expand Up @@ -225,15 +220,13 @@ spec:
apiVersion: v1
kind: ServiceAccount
metadata:
name: efs-csi-node-sa
`)
name: efs-csi-node-sa`)
th.writeF("/manifests/aws/aws-efs-csi-driver/base/csi-default-storage.yaml", `
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: efs-default
provisioner: efs.csi.aws.com
`)
provisioner: efs.csi.aws.com`)
th.writeK("/manifests/aws/aws-efs-csi-driver/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
24 changes: 8 additions & 16 deletions tests/aws-aws-fsx-csi-driver-base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
`)
verbs: ["get", "list", "watch", "update"]`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-attacher-cluster-role-binding.yaml", `
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -106,8 +105,7 @@ subjects:
roleRef:
kind: ClusterRole
name: fsx-csi-external-attacher-clusterrole
apiGroup: rbac.authorization.k8s.io
`)
apiGroup: rbac.authorization.k8s.io`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-controller-cluster-role.yaml", `
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -125,8 +123,7 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
`)
verbs: ["get", "list", "watch", "create", "update", "patch"]`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-controller-cluster-role-binding.yaml", `
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -139,8 +136,7 @@ subjects:
roleRef:
kind: ClusterRole
name: external-provisioner-role
apiGroup: rbac.authorization.k8s.io
`)
apiGroup: rbac.authorization.k8s.io`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-controller-sa.yaml", `
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -184,8 +180,7 @@ subjects:
roleRef:
kind: ClusterRole
name: fsx-csi-node-clusterrole
apiGroup: rbac.authorization.k8s.io
`)
apiGroup: rbac.authorization.k8s.io`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-node-daemonset.yaml", `
kind: DaemonSet
apiVersion: apps/v1
Expand Down Expand Up @@ -286,8 +281,7 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
`)
verbs: ["get", "list", "watch", "create", "update", "patch"]`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-provisioner-cluster-role-binding.yaml", `
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -300,15 +294,13 @@ subjects:
roleRef:
kind: ClusterRole
name: fsx-external-provisioner-clusterrole
apiGroup: rbac.authorization.k8s.io
`)
apiGroup: rbac.authorization.k8s.io`)
th.writeF("/manifests/aws/aws-fsx-csi-driver/base/csi-default-storage.yaml", `
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: fsx-default
provisioner: fsx.csi.aws.com
`)
provisioner: fsx.csi.aws.com`)
th.writeK("/manifests/aws/aws-fsx-csi-driver/base", `
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
Loading