Skip to content

Commit

Permalink
fix: move ldap to separate kustomization (#1178)
Browse files Browse the repository at this point in the history
* fix: move ldap to separate kustomization

* fix: change ldap_pass namespace

* remove ldap pass
  • Loading branch information
yashmehrotra authored Jul 27, 2023
1 parent 2b55550 commit 09a6bcc
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 203 deletions.
199 changes: 0 additions & 199 deletions fixtures/datasources/_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -578,202 +578,3 @@ kind: ConfigMap
metadata:
name: jmeter-fail-test
namespace: default
---
kind: ConfigMap
apiVersion: v1
metadata:
name: apacheds-ldif
data:
users.ldif: |
#########################################################
# MICROSOFT SCHEMA for sAMAccountName and memberOf
# these two attributes are not defined in Apache Directory Server
#########################################################
dn: cn=microsoft, ou=schema
objectclass: metaSchema
objectclass: top
cn: microsoft
dn: ou=attributetypes, cn=microsoft, ou=schema
objectclass: organizationalUnit
objectclass: top
ou: attributetypes
dn: m-oid=1.2.840.113556.1.4.221, ou=attributetypes, cn=microsoft, ou=schema
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-oid: 1.2.840.113556.1.4.221
m-name: sAMAccountName
m-equality: caseIgnoreMatch
m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
m-singleValue: TRUE
dn: m-oid=1.2.840.113556.1.4.222, ou=attributetypes, cn=microsoft, ou=schema
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-oid: 1.2.840.113556.1.4.222
m-name: memberOf
m-equality: caseIgnoreMatch
m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
m-singleValue: FALSE
dn: m-oid=1.2.840.113556.1.4.223, ou=attributetypes, cn=microsoft, ou=schema
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-oid: 1.2.840.113556.1.4.223
m-name: objectCategory
m-equality: caseIgnoreMatch
m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
m-singleValue: TRUE
dn: ou=objectclasses, cn=microsoft, ou=schema
objectclass: organizationalUnit
objectclass: top
ou: objectClasses
dn: m-oid=1.2.840.113556.1.5.6, ou=objectclasses, cn=microsoft, ou=schema
objectclass: metaObjectClass
objectclass: metaTop
objectclass: top
m-oid: 1.2.840.113556.1.5.6
m-name: simulatedMicrosoftSecurityPrincipal
m-supObjectClass: top
m-typeObjectClass: AUXILIARY
m-must: sAMAccountName
m-may: memberOf
m-must: objectCategory
############
# Domain
############
dn: ou=users,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: users
dn: uid=test,ou=users,dc=example,dc=com
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: simulatedMicrosoftSecurityPrincipal
objectCategory: User
cn: Test User
sn: test
uid: test
sAMAccountName: test
userPassword: secret
memberOf: admin
mail: [email protected]
displayName: John
dn: ou=roles,dc=example,dc=com
objectclass: top
objectclass: organizationalUnit
ou: roles
dn: cn=admin,ou=roles,dc=example,dc=com
objectClass: top
objectClass: groupOfNames
cn: admin
member: uid=test,ou=users,dc=example,dc=com
dn: ou=groups,dc=example,dc=com
objectclass: top
objectclass: organizationalunit
ou: groups
dn: cn=k8s,ou=groups,dc=example,dc=com
objectClass: top
objectClass: groupOfNames
cn: Kubernetes
member: uid=test,ou=users,dc=example,dc=com
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: apacheds
name: apacheds
spec:
replicas: 1
selector:
matchLabels:
app: apacheds
template:
metadata:
labels:
app: apacheds
spec:
containers:
- image: quay.io/toni0/apacheds:2.0.0_AM25_1
name: apacheds
resources:
requests:
cpu: 10m
memory: 300Mi
limits:
cpu: 500m
memory: 500Mi
ports:
- name: ldap
containerPort: 10389
- name: ldaps
containerPort: 10636
volumeMounts:
- name: config-ldif
mountPath: /bootstrap
env:
- name: BOOTSTRAP_FILE
value: /bootstrap/users.ldif
volumes:
- name: config-ldif
configMap:
name: apacheds-ldif
items:
- key: users.ldif
path: users.ldif
---
apiVersion: v1
kind: Service
metadata:
name: apacheds
spec:
ports:
- name: ldap
port: 10389
protocol: TCP
targetPort: 10389
- name: ldaps
port: 10636
protocol: TCP
targetPort: 10636
selector:
app: apacheds
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: test-rbac-ldap
rules:
- apiGroups: ["*"]
resources: ["pods", "nodes"]
verbs: ["list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: test-rbac-role
subjects:
- apiGroup: ""
kind: User
name: [email protected]
roleRef:
apiGroup: ""
kind: ClusterRole
name: test-rbac-ldap
1 change: 0 additions & 1 deletion fixtures/datasources/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- _setup.yaml
- ldap_pass.yaml
- mongo_fail.yaml
- mongo_pass.yaml
- mssql_fail.yaml
Expand Down
3 changes: 2 additions & 1 deletion fixtures/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- _setup.yaml
- datasources
- k8s
- minimal
- git
- topology
- _setup.yaml
- ldap
Loading

0 comments on commit 09a6bcc

Please sign in to comment.