Last active
March 2, 2025 16:55
-
-
Save SchoolGuy/4153fe952bf16437a6eee6a4ecf4006a to your computer and use it in GitHub Desktop.
k3s STS for NFS Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: nfs-server-exports | |
namespace: nfs-server | |
data: | |
exports: | | |
/k8s-pool *(rw,fsid=0,sync,no_subtree_check,no_root_squash) | |
--- | |
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: nfs-server | |
namespace: nfs-server | |
spec: | |
selector: | |
matchLabels: | |
app: nfs-server | |
serviceName: "nfs-server" | |
updateStrategy: | |
type: RollingUpdate | |
template: | |
metadata: | |
labels: | |
app: nfs-server | |
spec: | |
nodeSelector: | |
kubernetes.io/hostname: "node01.home.lan" | |
affinity: | |
nodeAffinity: | |
requiredDuringSchedulingIgnoredDuringExecution: | |
nodeSelectorTerms: | |
- matchExpressions: | |
- key: kubernetes.io/os | |
operator: In | |
values: | |
- linux | |
serviceAccountName: nfs-server | |
restartPolicy: Always | |
containers: | |
- name: nfs-server | |
# https://build.opensuse.org/package/show/devel:kubic:containers/opensuse-nfs-server-image | |
image: registry.opensuse.org/opensuse/nfs-server:latest | |
imagePullPolicy: Always | |
args: ["/k8s-pool"] | |
ports: | |
- containerPort: 2049 | |
protocol: TCP | |
- containerPort: 2049 | |
protocol: UDP | |
- containerPort: 111 | |
protocol: UDP | |
resources: | |
requests: | |
cpu: 10m | |
memory: 256Mi | |
limits: | |
memory: 512Mi | |
volumeMounts: | |
- name: nfs-server-config | |
mountPath: /etc/exports | |
subPath: exports | |
- name: nfs-server-storage | |
mountPath: /k8s-pool | |
securityContext: | |
privileged: true | |
volumes: | |
- name: nfs-server-config | |
configMap: | |
name: nfs-server-exports | |
volumeClaimTemplates: | |
- metadata: | |
name: nfs-server-storage | |
annotations: | |
k8up.io/backup: "false" | |
spec: | |
accessModes: [ "ReadWriteOnce" ] | |
storageClassName: local-path | |
resources: | |
requests: | |
storage: 100Gi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment