-
Notifications
You must be signed in to change notification settings - Fork 81
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
Does danm work with calico? #106
Comments
Updated dn so metadata.name matches spec.NetworkID -- didn't know they have to match apiVersion: danm.k8s.io/v1 Pod still failed to start but with new error: Warning FailedCreatePodSandBox 7s kubelet, mtx-huawei2-bld02 Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "834f6e9a1d195a6d410a3e39d1ddb8333d71874801414ce84ba2c04b492086bf" network for pod "sriov-pod": NetworkPlugin cni failed to set up pod "sriov-pod_example-sriov" network: CNI network could not be set up: CNI operation for network:calico-mgmt failed with:CNI delegation failed due to error:Error delegating ADD to CNI plugin:calico because:OS exec call failed:no etcd endpoints specified |
glad you really decided to try DANM :) danm.k8s.io/interfaces: | |
ah sorry, only saw the update now. I'm still on my morning coffee :) and for the error: it is thrown by the Calico code, after DANM has delegated the operation. I guess Calico expects some configuration to be present in its backend which is missing. But I confess I'm not that big of a Calico expert, so not sure exactly what's missing. |
after some doc reading: |
Quite agree with Levo, seems the problem come from the configuration file for calico, in my opinion, at least "etcd_endpoints" "etcd_key_file" "etcd_cert_file" and "etcd_ca_cert_file" are needed. |
Thank you guys. Without DANM, Calico has been working on the k8s cluster as the overlay network, I just reused / renamed its config file to calico-mgmt.conf for danm, so wasn't sure why / where to add the additional config info when it's used as a delegate? (btw, I've used calico with multus, reusing the same config file, didn't have this kind of issue...) |
Hmm, interesting. We need to go deeper then :)
|
I followed kubeadm doc to apply calico on k8s, Back then it used 2 files, In calico daemonset it specified k8s for datastore, not etcd.
When running multus with calico, I used the same option, "datastore_type": "kubernetes", cat /etc/cni/net.d/05-multus.conf{ So DANM's way of delegating with calico is more restricted? Thanks. -Jessica |
well, when handling static delegates you can say it like that. we don't support chaining together plugins, because chaining is usually simply not needed. When it comes to dynamic delegates everything is configured through the same dynamic, centralized REST API. Therefore I would say these delegates are actually way less restrictive than sticking to the component specific static CNI files. So, trying to come up with some takeaways, and next steps:
|
The portmap cni was there by default in calico-config, not sure why, k8s doc just says it's required to support hostPort. our apps don't use that. Gonna remove and see. Thanks. -Jessica |
Thank you sir, worked w/o cni chaining, cat calico-mgmt.conf{ Gonna move on to add sriov network. Thanks. -Jessica ps. will soon be away for 2 weeks |
Cool! |
Please let me know if should put this in a new issue. continue to follow example/device_plugin_demo $ cat sriov_net.yaml
|
not picky when it comes to number of issues, no KPIs for it :) so we can continue it in this thread if you want! so, two issues. The second is a config issue in the manifest, but it is actually the desired result: CIDR is not defined in the network manifest, meaning that the network represents a L2 network. So, if you want L3 VFs (with IP), add the "cidr" attribute to the manifest to define the subnet from which IPs can be allocated to a Pod |
Is this line not enough in above dn? Could you find a complete example of sriov with dynamic? Even better if it also has routing across nodes... Thanks. -Jessica |
ah my bad, did not notice yours already has a CIDR! yes it should be enough. if you are running 3.3: can you send me the exact output of "kubectl describe sriov-a -n example-sriov", and the the output of kubectl logs of any netwatcher Pod? regarding routing: well, with SR-IOV you are basically building a good, old-fashioned L2 domain. so assuming you have configured the VLAN tag in the DanmNet for all of your PFs of all of your computes in your switch, connectivity between nodes is achieved by the simple in-subnet switching |
Meanwhile: if you do use 4.0 I corrected the "none" type issue in #110 |
Let's leave consider this thread closed from the perspective of the original issue, but if you still have any questions related to SR-IOV feel free to open a new one! |
@clivez Hello there, I am now utilizing Danm to create the calico networks, but I am facing the same error "CNI operation for network:calico-1 failed with:CNI delegation failed due to error:Error delegating ADD to CNI plugin:calico because:OS exec call failed:no etcd endpoints specified". In the meanwhile, I try to setup etcd_endpoints IP, referenced from etcd_pod_kube_system, in both /etc/cni/net.d/calico-1.conf and /etc/cni/net.d/calico-kubeconfig, it seems not working. Sorry, If I should not reply an closed issue, I'll open another new one or ask on slack. |
I think the problem here was similar to what you have experienced with your Flannel config, i.e. the Calico config in this case was also in "chained" format |
Hello,
First attempt to try out DANM. Followed readme to build, started netwatcher. Modified / simplified example from project, but test pod failed to start.
apiVersion: danm.k8s.io/v1
kind: DanmNet
metadata:
name: cali-mgmt
namespace: example-sriov
spec:
NetworkID: calico-mgmt
NetworkType: calico
$ kubectl get dn -n example-sriov
NAME AGE
cali-mgmt 29m
[root@mtx-bld08 net.d]# cat calico-mgmt.conf
{
"name": "k8s-pod-network",
"cniVersion": "0.3.0",
"plugins": [
{
"type": "calico",
"log_level": "info",
"datastore_type": "kubernetes",
"nodename": "mtx-huawei2-bld08",
"mtu": 1440,
"ipam": {
"type": "host-local",
"subnet": "usePodCidr"
},
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
}
},
{
"type": "portmap",
"snat": true,
"capabilities": {"portMappings": true}
}
]
}
apiVersion: v1
kind: Pod
metadata:
name: sriov-pod
namespace: example-sriov
labels:
env: test
annotations:
danm.k8s.io/interfaces: |
[
{"network":"calico-mgmt", "ip":"dynamic"}
]
spec:
containers:
image: busybox:latest
args:
Events:
Type Reason Age From Message
Normal Scheduled 3s default-scheduler Successfully assigned example-sriov/sriov-pod to mtx-huawei2-bld04
Warning FailedCreatePodSandBox 2s kubelet, mtx-huawei2-bld04 Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "6831107ccc88762a8d717bbcaf0ee5cd62c83576076adcfd62cb156d4ac31732" network for pod "sriov-pod": NetworkPlugin cni failed to set up pod "sriov-pod_example-sriov" network: CNI network could not be set up: CNI operation for network: failed with:failed to get network object for Pod:sriov-pod's connection no.:0 due to:requested network:calico-mgmt of type:DanmNet in namespace:example-sriov does not exist
Environment:
Where to find this?
kubectl version
):[mtx@mtx-bld08 danm]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
[root@mtx-bld08 net.d]# cat 00-danm.conf
{
"name": "meta_cni",
"name_comment": "Mandatory parameter, but can be anything",
"type": "danm",
"type_comment": "Mandatory parameter according to CNI spec, MUST be set to danm",
"kubeconfig": "/etc/cni/net.d/danm-kubeconfig",
"kubeconfig_comment": "Mandatory parameter, must point to a valid kubeconfig file containing the necessary RBAC setting for DANM's user",
"cniDir": "/etc/cni/net.d",
"cniDir_comment": "Optional parameter, if defined CNI config files for static delegates are searched here. Default value is /etc/cni/net.d",
"namingScheme": "awesome",
"namingScheme_comment": "Optional parameter, if it is set to legacy container network interface names are set exactly to DanmNet.Spec.Options.container_prefix, otherwise prefix simply behaves as a prefix and is suffixed with a sequence ID. Default value is empty (e.g. not legacy)"
}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: caas:danm
rules:
resources:
verbs: [ "*" ]
resources: [ "pods" ]
verbs: [ "get","watch","list"]
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: caas:danm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: caas:danm
subjects:
kind: ServiceAccount
namespace: kube-system
name: danm
OS (e.g. from /etc/os-release):
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
uname -a
):Linux mtx-huawei2-bld08 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 15 17:36:42 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Thanks. -Jessica
The text was updated successfully, but these errors were encountered: