Compare commits
8 Commits
11538db808
...
misc
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b442b728a | |||
| d4dceafb8c | |||
| 1ea019717e | |||
| 6e118f5a3a | |||
| d6a43ad78b | |||
| 250e3bb9bb | |||
| d6d463e866 | |||
| f6544c3ce7 |
@@ -0,0 +1,149 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner-service-account
|
||||||
|
namespace: local-path-storage
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner-role
|
||||||
|
namespace: local-path-storage
|
||||||
|
rules:
|
||||||
|
- apiGroups: [ "" ]
|
||||||
|
resources: [ "pods" ]
|
||||||
|
verbs: [ "get", "list", "watch", "create", "patch", "update", "delete" ]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner-role
|
||||||
|
rules:
|
||||||
|
- apiGroups: [ "" ]
|
||||||
|
resources: [ "nodes", "persistentvolumeclaims", "configmaps", "pods", "pods/log" ]
|
||||||
|
verbs: [ "get", "list", "watch" ]
|
||||||
|
- apiGroups: [ "" ]
|
||||||
|
resources: [ "persistentvolumes" ]
|
||||||
|
verbs: [ "get", "list", "watch", "create", "patch", "update", "delete" ]
|
||||||
|
- apiGroups: [ "" ]
|
||||||
|
resources: [ "events" ]
|
||||||
|
verbs: [ "create", "patch" ]
|
||||||
|
- apiGroups: [ "storage.k8s.io" ]
|
||||||
|
resources: [ "storageclasses" ]
|
||||||
|
verbs: [ "get", "list", "watch" ]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner-bind
|
||||||
|
namespace: local-path-storage
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: local-path-provisioner-role
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: local-path-provisioner-service-account
|
||||||
|
namespace: local-path-storage
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner-bind
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: local-path-provisioner-role
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: local-path-provisioner-service-account
|
||||||
|
namespace: local-path-storage
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner
|
||||||
|
namespace: local-path-storage
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: local-path-provisioner
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: local-path-provisioner
|
||||||
|
spec:
|
||||||
|
serviceAccountName: local-path-provisioner-service-account
|
||||||
|
containers:
|
||||||
|
- name: local-path-provisioner
|
||||||
|
image: rancher/local-path-provisioner:v0.0.28
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
command:
|
||||||
|
- local-path-provisioner
|
||||||
|
- --debug
|
||||||
|
- start
|
||||||
|
- --config
|
||||||
|
- /etc/config/config.json
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-volume
|
||||||
|
mountPath: /etc/config/
|
||||||
|
env:
|
||||||
|
- name: POD_NAMESPACE
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
|
- name: CONFIG_MOUNT_PATH
|
||||||
|
value: /etc/config/
|
||||||
|
volumes:
|
||||||
|
- name: config-volume
|
||||||
|
configMap:
|
||||||
|
name: local-path-config
|
||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: local-path
|
||||||
|
provisioner: rancher.io/local-path
|
||||||
|
volumeBindingMode: WaitForFirstConsumer
|
||||||
|
reclaimPolicy: Retain
|
||||||
|
---
|
||||||
|
kind: ConfigMap
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: local-path-config
|
||||||
|
namespace: local-path-storage
|
||||||
|
data:
|
||||||
|
config.json: |-
|
||||||
|
{
|
||||||
|
"nodePathMap": [
|
||||||
|
{
|
||||||
|
"node": "DEFAULT_PATH_FOR_NON_LISTED_NODES",
|
||||||
|
"paths": [
|
||||||
|
"/opt/local-path-provisioner"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
setup: |-
|
||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
mkdir -m 0777 -p "$VOL_DIR"
|
||||||
|
teardown: |-
|
||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
rm -rf "$VOL_DIR"
|
||||||
|
helperPod.yaml: |-
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: helper-pod
|
||||||
|
spec:
|
||||||
|
priorityClassName: system-node-critical
|
||||||
|
tolerations:
|
||||||
|
- key: node.kubernetes.io/disk-pressure
|
||||||
|
operator: Exists
|
||||||
|
effect: NoSchedule
|
||||||
|
containers:
|
||||||
|
- name: helper-pod
|
||||||
|
image: busybox
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
||||||
kind: HelmRelease
|
|
||||||
metadata:
|
|
||||||
name: local-path-provisioner
|
|
||||||
namespace: local-path-storage
|
|
||||||
spec:
|
|
||||||
interval: 1h
|
|
||||||
driftDetection:
|
|
||||||
mode: enabled
|
|
||||||
chart:
|
|
||||||
spec:
|
|
||||||
chart: local-path-provisioner
|
|
||||||
version: master-head
|
|
||||||
sourceRef:
|
|
||||||
kind: GitRepository
|
|
||||||
namespace: flux-system
|
|
||||||
name: local-path-provisioner
|
|
||||||
interval: 24h
|
|
||||||
values:
|
|
||||||
storageClass:
|
|
||||||
reclaimPolicy: Retain
|
|
||||||
@@ -16,4 +16,4 @@ spec:
|
|||||||
name: flux-system
|
name: flux-system
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: namespaces
|
- name: namespaces
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
@@ -11,19 +11,38 @@ spec:
|
|||||||
sourceRef:
|
sourceRef:
|
||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
name: bitnami
|
name: bitnami
|
||||||
|
namespace: flux-system
|
||||||
interval: 60m
|
interval: 60m
|
||||||
values:
|
values:
|
||||||
config:
|
containerSecurityContext:
|
||||||
receivers:
|
enabled: true
|
||||||
- name: "dump"
|
runAsNonRoot: false
|
||||||
file:
|
privileged: true
|
||||||
layout:
|
readOnlyRootFilesystem: false
|
||||||
message: "{{ .Message }}"
|
allowPrivilegeEscalation: true
|
||||||
reason: "{{ .Reason }}"
|
nodeSelector:
|
||||||
type: "{{ .Type }}"
|
kubernetes.io/hostname: rpi5-cluster-node-1
|
||||||
count: "{{ .Count }}"
|
metrics:
|
||||||
kind: "{{ .InvolvedObject.Kind }}"
|
enabled: true
|
||||||
name: "{{ .InvolvedObject.Name }}"
|
---
|
||||||
namespace: "{{ .Namespace }}"
|
apiVersion: networking.k8s.io/v1
|
||||||
component: "{{ .Source.Component }}"
|
kind: Ingress
|
||||||
host: "{{ .Source.Host }}"
|
metadata:
|
||||||
|
name: kubernetes-event-exporter-ingress
|
||||||
|
namespace: prometheus
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||||
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: "event-exporter.cluster.local"
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- pathType: Prefix
|
||||||
|
path: "/"
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: kubernetes-event-exporter-metrics
|
||||||
|
port:
|
||||||
|
number: 2112
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
apiVersion: source.toolkit.fluxcd.io/v1
|
|
||||||
kind: GitRepository
|
|
||||||
metadata:
|
|
||||||
name: local-path-provisioner
|
|
||||||
namespace: flux-system
|
|
||||||
spec:
|
|
||||||
interval: 5m
|
|
||||||
ref:
|
|
||||||
branch: main
|
|
||||||
secretRef:
|
|
||||||
name: flux-system
|
|
||||||
timeout: 60s
|
|
||||||
url: https://github.com/rancher/local-path-provisioner.git
|
|
||||||
Reference in New Issue
Block a user