Comments (7)
an example for setting up a host-path-provisoner #85 (comment)
from k3s.
@warmchang hostPath volumes are always owned by root; this complicates things considerably when using pre-built containers that run their process(es) as another user. The localPath provisioner described in #85 does pretty much the same but via PVCs, which don't seem to suffer from the owned-by-root issue.
from k3s.
https://rancher.com/docs/k3s/latest/en/storage/
from k3s.
Struggling with this too; is it possible to get that to work? If so, a few pointers in the general direction would be very helpful.
from k3s.
I prefer to use volume of the hostpath type directly.
An example:
$ k3s kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3-k3s.6", GitCommit:"da4e14f160174f356b1d95198f48439971cc8a85", GitTreeState:"clean", BuildDate:"2019-02-24T05:21+00:00Z", GoVersion:"go1.11.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3-k3s.6", GitCommit:"da4e14f160174f356b1d95198f48439971cc8a85", GitTreeState:"clean", BuildDate:"2019-02-24T05:21+00:00Z", GoVersion:"go1.11.4", Compiler:"gc", Platform:"linux/amd64"}
$ alias k="k3s kubectl"
$ cat pod-hostpath.yaml
apiVersion: v1
kind: Pod
metadata:
name: test-pd
spec:
containers:
- image: k8s.gcr.io/test-webserver
name: test-container
volumeMounts:
- mountPath: /test-pd
name: test-volume
volumes:
- name: test-volume
hostPath:
path: /data
type: Directory
$
$ k apply -f pod-hostpath.yaml
pod/test-pd created
$ k get pods
NAME READY STATUS RESTARTS AGE
http-8654dd748-fjdkc 1/1 Running 0 9m22s
test-pd 1/1 Running 0 13s
$ k get pod test-pd -o yaml
apiVersion: v1
kind: Pod
......
name: test-container
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /test-pd
name: test-volume
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: default-token-vz4pc
readOnly: true
dnsPolicy: ClusterFirst
......
volumes:
- hostPath:
path: /data
type: Directory
name: test-volume
- name: default-token-vz4pc
secret:
defaultMode: 420
secretName: default-token-vz4pc
status:
......
restartCount: 0
state:
running:
startedAt: "2019-02-28T11:24:20Z"
hostIP: 172.17.0.20
phase: Running
podIP: 10.42.0.7
qosClass: BestEffort
startTime: "2019-02-28T11:24:19Z"
$
$ k cluster-info
Kubernetes master is running at https://localhost:6443
CoreDNS is running at https://localhost:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
$
If switch to CSI implementation, I need to install Provisioner, Driver, Attacher and Registrar plugins, which seems too complex.
The following two articles describe the content related to the CSI host-path for reference:
- https://kubernetes-csi.github.io/docs/example.html
- https://github.com/Azure/kubernetes-volume-drivers/tree/master/csi/hostpath
Just my 2 cents. βΈβΈ π
from k3s.
My use case is for CI. If I change from PVC then it's not testing my config. Also, one particular application uses Helm to package and uses dependencies. Those dependencies use PVC. It'd be easier for me to install a plugin.
from k3s.
from k3s.
Related Issues (20)
- Use private ip with external cloud manager that doesn't know about that ip
- Allow setting `priorityClassName` on ServiceLB daemonset. HOT 5
- k3s cluster should use GPU without mentioning runtimeClassName: "nvidia" in pod specs HOT 3
- Fail to run static pod without master running HOT 2
- --node-external-ip can not add annotate flannel.alpha.coreos.com/public-ip-overwrite HOT 1
- Pods are going into pending state after upgrading from v1.26.12-k3s1 to v1.27.11-k3s1 and v1.28.5-k3s1 (Issue is quite random)
- leader-elected etcd controllers not consistently functional when leader election/lease mismatches occur HOT 4
- Update minio-go to `v7.0.70` or newer HOT 2
- Embedded helm controller does not track owner references properly
- Network policy in dual-stack cluster stops allowing ingress after pod restart HOT 14
- ingresses stop working every now and then HOT 8
- Create a new single node cluster with embedded registry mirror does not work HOT 5
- K3S startup stuck in a deadlock when a KMS provider is configured and the node is rebooted HOT 4
- Expose k3s metrics over http HOT 2
- Capturing K3s metrics over http/https from VM HOT 1
- Agent node IP not replaced with Tailscale VPN IP HOT 7
- Pods not always creating logs HOT 1
- Best practice of setting the cluster name at deployment level HOT 4
- k3s crashes if I do not start the cloud-provider
- sh: 0: cannot open β: No such file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k3s.