Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocserv error 2 (No such file or directory) calling stat for '/etc/ocserv/ocserv.conf #27

Open
JuneZhao opened this issue Nov 7, 2017 · 6 comments

Comments

@JuneZhao
Copy link

JuneZhao commented Nov 7, 2017

我用k8s创建这个container 下面是我的yaml文件:

apiVersion: v1
kind: Service
metadata:
name: ocservsv
labels:
app: ocservapp
spec:
type: NodePort
ports:

  • port: 443
    selector:
    app: ocservapp
    type: LoadBalancer

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-ocservcontainer
labels:
app: ocservapp
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: azurescea

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-ocserv-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: ocservapp
spec:
containers:
- name: ocservcontainer
image: wppurking/ocserv-docker
securityContext:
privileged: true
ports:
- containerPort: 443
name: ocservtcp443
- containerPort: 443
name: ocservudp443
protocol: UDP
volumeMounts:
- name: ocserv-persistent-storage
mountPath: /etc/ocserv
volumes:
- name: ocserv-persistent-storage
persistentVolumeClaim:
claimName: pvc-ocservcontainer

但是创建完成之后日志会提示这个错误:
net.ipv4.ip_forward = 1
ocserv error 2 (No such file or directory) calling stat for '/etc/ocserv/ocserv.conf'

@JuneZhao
Copy link
Author

JuneZhao commented Nov 7, 2017

我知道了需要先 git clone 下来,但是我不知道 k8s内部怎么管理某个container启动的路径,所以有什么办法把这个路径加到你的这个container里面吗?/etc/ocserv

@JuneZhao
Copy link
Author

JuneZhao commented Nov 9, 2017

@wppurking

@JuneZhao
Copy link
Author

JuneZhao commented Nov 9, 2017

@wyattpan @wyatt_pan

@wppurking
Copy link
Owner

@JuneZhao 额, 我还没有使用过 k8s, 但是如果只是简单启动一个 ocserv, 需要用到那么复杂的 k8s 吗?

@JuneZhao
Copy link
Author

@wppurking 好的吧,主要是我还有一些其他的服务就正好一起了,用普通的docker 起好像也有些问题。

@lacek
Copy link

lacek commented Jan 15, 2018

@JuneZhao 你的命令少了挂载ocserv目录的参数吧:-v ~/ocserv-docker/ocserv:/etc/ocserv
`~/ocserv-docker`是git clone回来的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants