Skip to content
Snippets Groups Projects
Commit aa899eec authored by CLEMENTE Damien's avatar CLEMENTE Damien
Browse files

Update 7 files

- /conf_file/wordpress.yml
- /conf_file/rbac.yml
- /conf_file/persistent_volume.yml
- /conf_file/openldap.yaml
- /conf_file/metallb-config.yaml
- /conf_file/kubelet.yaml
- /conf_file/kube-flannel.yml
parent 5401b631
No related branches found
No related tags found
No related merge requests found
---
kind: Namespace
apiVersion: v1
metadata:
name: kube-flannel
labels:
k8s-app: flannel
pod-security.kubernetes.io/enforce: privileged
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: flannel
name: flannel
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: flannel
name: flannel
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: flannel
subjects:
- kind: ServiceAccount
name: flannel
namespace: kube-flannel
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: flannel
name: flannel
namespace: kube-flannel
---
kind: ConfigMap
apiVersion: v1
metadata:
name: kube-flannel-cfg
namespace: kube-flannel
labels:
tier: node
k8s-app: flannel
app: flannel
data:
cni-conf.json: |
{
"name": "cbr0",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "flannel",
"delegate": {
"hairpinMode": true,
"isDefaultGateway": true
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
net-conf.json: |
{
"Network": "10.20.0.0/16",
"EnableNFTables": false,
"Backend": {
"Type": "vxlan"
}
}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-flannel-ds
namespace: kube-flannel
labels:
tier: node
app: flannel
k8s-app: flannel
spec:
selector:
matchLabels:
app: flannel
template:
metadata:
labels:
tier: node
app: flannel
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
hostNetwork: true
priorityClassName: system-node-critical
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccountName: flannel
initContainers:
- name: install-cni-plugin
image: ghcr.io/flannel-io/flannel-cni-plugin:v1.6.2-flannel1
command:
- cp
args:
- -f
- /flannel
- /opt/cni/bin/flannel
volumeMounts:
- name: cni-plugin
mountPath: /opt/cni/bin
- name: install-cni
image: ghcr.io/flannel-io/flannel:v0.26.4
command:
- cp
args:
- -f
- /etc/kube-flannel/cni-conf.json
- /etc/cni/net.d/10-flannel.conflist
volumeMounts:
- name: cni
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: ghcr.io/flannel-io/flannel:v0.26.4
command:
- /opt/bin/flanneld
args:
- --ip-masq
- --kube-subnet-mgr
resources:
requests:
cpu: "100m"
memory: "50Mi"
securityContext:
privileged: false
capabilities:
add: ["NET_ADMIN", "NET_RAW"]
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: EVENT_QUEUE_DEPTH
value: "5000"
volumeMounts:
- name: run
mountPath: /run/flannel
- name: flannel-cfg
mountPath: /etc/kube-flannel/
- name: xtables-lock
mountPath: /run/xtables.lock
volumes:
- name: run
hostPath:
path: /run/flannel
- name: cni-plugin
hostPath:
path: /opt/cni/bin
- name: cni
hostPath:
path: /etc/cni/net.d
- name: flannel-cfg
configMap:
name: kube-flannel-cfg
- name: xtables-lock
hostPath:
path: /run/xtables.lock
type: FileOrCreate
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
kubernetesVersion: "1.28.0"
controlPlaneEndpoint: "kube01"
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: my-pool
namespace: metallb-system
spec:
addresses:
- 192.168.10.100-192.168.10.110 # Plage d'IP LoadBalancer
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: my-advert
namespace: metallb-system
apiVersion: v1
kind: Secret
metadata:
name: openldap-secrets
namespace: openldap
type: Opaque
data:
organization: "ZGV2b3Bz" #devops
domain: "dW56eQ==" #unzy
password: "bXlwYXNzd29yZA==" #mypassword
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: openldap-data-disk
namespace: openldap
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: openldap-deployment
namespace: openldap
labels:
app: openldap
spec:
replicas: 1
selector:
matchLabels:
app: openldap
template:
metadata:
labels:
app: openldap
spec:
containers:
- name: openldap
image: osixia/openldap:1.3.0
ports:
- containerPort: 389
- containerPort: 636
env:
- name: LDAP_ORGANISATION
valueFrom:
secretKeyRef:
name: openldap-secrets
key: organization
- name: LDAP_DOMAIN
valueFrom:
secretKeyRef:
name: openldap-secrets
key: domain
- name: LDAP_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: openldap-secrets
key: password
volumeMounts:
- name: openldap-volume
mountPath: "/var/lib/ldap"
subPath: database
- name: openldap-volume
mountPath: "/etc/ldap/slapd.d"
subPath: config
volumes:
- name: openldap-volume
persistentVolumeClaim:
claimName: openldap-data-disk
---
apiVersion: v1
kind: Service
metadata:
name: openldap-service
namespace: openldap
spec:
selector:
app: openldap
ports:
- name: openldap1
protocol: TCP
port: 389
targetPort: 389
- name: openldap2
protocol: TCP
port: 636
targetPort: 636
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: phpldapadmin-deployment
namespace: openldap
labels:
app: phpldapadmin
spec:
replicas: 1
selector:
matchLabels:
app: phpldapadmin
template:
metadata:
labels:
app: phpldapadmin
spec:
containers:
- name: phpldapadmin
image: osixia/phpldapadmin:0.9.0
ports:
- containerPort: 443
env:
- name: PHPLDAPADMIN_LDAP_HOSTS
value: openldap-service
---
apiVersion: v1
kind: Service
metadata:
name: phpldapadmin-service
namespace: openldap
spec:
type: LoadBalancer
selector:
app: phpldapadmin
ports:
- protocol: TCP
port: 9943
targetPort: 443
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /opt/kubedata
persistentVolumeReclaimPolicy: Delete
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment