Rename dex namespace, add new ytt value to deploy/tools, and remove Tilt

- Rename the test/deploy/dex directory to test/deploy/tools
- Rename the dex namespace to tools
- Add a new ytt value called `pinny_ldap_password` for the tools
  ytt templates
- This new value is not used on main at this time. We intend to use
  it in the forthcoming ldap branch. We're defining it on main so
  that the CI scripts can use it across all branches and PRs.

Signed-off-by: Ryan Richard <richardry@vmware.com>
This commit is contained in:
Andrew Keesler
2021-04-05 15:01:49 -07:00
committed by Ryan Richard
parent 9cd2b6e855
commit c53507809d
20 changed files with 180 additions and 590 deletions
@@ -1,11 +1,11 @@
#! Copyright 2020 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cert-issuer
namespace: dex
namespace: tools
labels:
app: cert-issuer
---
@@ -13,7 +13,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cert-issuer
namespace: dex
namespace: tools
labels:
app: cert-issuer
rules:
@@ -25,13 +25,13 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cert-issuer
namespace: dex
namespace: tools
labels:
app: cert-issuer
subjects:
- kind: ServiceAccount
name: cert-issuer
namespace: dex
namespace: tools
roleRef:
kind: Role
name: cert-issuer
@@ -41,7 +41,7 @@ apiVersion: batch/v1
kind: Job
metadata:
name: cert-issuer
namespace: dex
namespace: tools
labels:
app: cert-issuer
spec:
@@ -71,11 +71,21 @@ spec:
-ca ca.pem -ca-key ca-key.pem \
-config /tmp/cfssl-default.json \
-profile www \
-cn "dex.dex.svc.cluster.local" \
-hostname "dex.dex.svc.cluster.local" \
-cn "dex.tools.svc.cluster.local" \
-hostname "dex.tools.svc.cluster.local" \
/tmp/csr.json \
| cfssljson -bare dex
echo "generating LDAP server certificate..."
cfssl gencert \
-ca ca.pem -ca-key ca-key.pem \
-config /tmp/cfssl-default.json \
-profile www \
-cn "ldap.tools.svc.cluster.local" \
-hostname "ldap.tools.svc.cluster.local" \
/tmp/csr.json \
| cfssljson -bare ldap
chmod -R 777 /var/certs
echo "generated certificates:"
@@ -90,12 +100,12 @@ spec:
args:
- -c
- |
kubectl get secrets -n dex certs -o jsonpath='created: {.metadata.creationTimestamp}' || \
kubectl create secret generic certs --from-file=/var/certs
kubectl get secrets -n tools certs -o jsonpath='created: {.metadata.creationTimestamp}' || \
kubectl create secret generic -n tools certs --from-file=/var/certs
volumeMounts:
- name: certs
mountPath: /var/certs
volumes:
- name: certs
emptyDir: {}
restartPolicy: Never
restartPolicy: Never
@@ -6,7 +6,7 @@
#@ load("@ytt:yaml", "yaml")
#@ def dexConfig():
issuer: https://dex.dex.svc.cluster.local/dex
issuer: https://dex.tools.svc.cluster.local/dex
storage:
type: sqlite3
config:
@@ -36,19 +36,12 @@ staticPasswords:
userID: "061d23d1-fe1e-4777-9ae9-59cd12abeaaa"
#@ end
---
apiVersion: v1
kind: Namespace
metadata:
name: dex
labels:
name: dex
---
apiVersion: v1
kind: ConfigMap
metadata:
name: dex-config
namespace: dex
namespace: tools
labels:
app: dex
data:
@@ -58,7 +51,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: dex
namespace: dex
namespace: tools
labels:
app: dex
spec:
@@ -102,7 +95,7 @@ apiVersion: v1
kind: Service
metadata:
name: dex
namespace: dex
namespace: tools
labels:
app: dex
spec:
+8
View File
@@ -0,0 +1,8 @@
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
---
apiVersion: v1
kind: Namespace
metadata:
name: tools
@@ -1,4 +1,4 @@
#! Copyright 2020 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0
#@ load("@ytt:data", "data")
@@ -7,7 +7,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: proxy
namespace: dex
namespace: tools
labels:
app: proxy
spec:
@@ -62,7 +62,7 @@ apiVersion: v1
kind: Service
metadata:
name: proxy
namespace: dex
namespace: tools
labels:
app: proxy
spec:
@@ -71,4 +71,4 @@ spec:
app: proxy
ports:
- port: 3128
nodePort: #@ data.values.ports.node
nodePort: #@ data.values.ports.node
@@ -22,3 +22,6 @@ supervisor_redirect_uris: []
#! The bcrypt-hashed password of the pinny test user account.
pinny_bcrypt_passwd_hash:
#! The plaintext password of the LDAP test account user.
pinny_ldap_password: