Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
40329a5222 | |||
8cb1bd56de | |||
1aa19812a4 |
21
README.md
21
README.md
@ -1,2 +1,23 @@
|
||||
# openldap-kustom
|
||||
|
||||
Kustomization de openldap pour test des applications
|
||||
|
||||
Image prise de docker.io/bitnami et disponible sur reg.cadoles.com/proxy_cache/bitnami/openldap
|
||||
|
||||
- kubectl apply -f kustomization.yaml :
|
||||
|
||||
- création du namespace
|
||||
- création d'un service openldap
|
||||
- création pod openldap avec user admin et mot de passe a déclarer (adminpassword) et possibilité de créer des users (users et passwords a déclarer)
|
||||
|
||||
- Déclaration des secrets:
|
||||
|
||||
- kubectl create secret generic openldap --from-literal=adminpassword=MyAdminPasswd --from-literal=users=user1, user2,... --from-literal=passwords=passwd1,passwd2,... -n openldap
|
||||
|
||||
- Récupération des secrets:
|
||||
|
||||
- kubectl get secret "SecretName" -n "Namespace" -o jsonpath='{.data.maVar}' | base64 --decode
|
||||
|
||||
- Information sur le déploiement :
|
||||
|
||||
- kubectl describe -n "Namespace" deployment "DeploymentName"
|
||||
|
8
kustomization.yaml
Normal file
8
kustomization.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: openldap
|
||||
|
||||
resources:
|
||||
- ./resources/namespace.yaml
|
||||
- ./resources/openldap.yaml
|
||||
- ./resources/svc.yaml
|
4
resources/namespace.yaml
Normal file
4
resources/namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: openldap
|
43
resources/openldap.yaml
Normal file
43
resources/openldap.yaml
Normal file
@ -0,0 +1,43 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: openldap
|
||||
labels:
|
||||
app.kubernetes.io/name: openldap
|
||||
namespace: openldap
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: openldap
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: openldap
|
||||
spec:
|
||||
containers:
|
||||
- name: openldap
|
||||
image: docker.io/bitnami/openldap:latest
|
||||
# image: reg.cadoles.com/proxy_cache/library/openldap:latest
|
||||
imagePullPolicy: "Always"
|
||||
env:
|
||||
- name: LDAP_ADMIN_USERNAME
|
||||
value: "admin"
|
||||
- name: LDAP_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: adminpassword
|
||||
name: openldap
|
||||
- name: LDAP_USERS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: users
|
||||
name: openldap
|
||||
- name: LDAP_PASSWORDS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: passwords
|
||||
name: openldap
|
||||
ports:
|
||||
- name: tcp-ldap
|
||||
containerPort: 1389
|
15
resources/svc.yaml
Normal file
15
resources/svc.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: openldap
|
||||
labels:
|
||||
app.kubernetes.io/name: openldap
|
||||
namespace: openldap
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: tcp-ldap
|
||||
port: 1389
|
||||
targetPort: tcp-ldap
|
||||
selector:
|
||||
app.kubernetes.io/name: openldap
|
Loading…
Reference in New Issue
Block a user