Jian Li | 4b5048a | 2020-10-08 02:57:45 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.openstacknetworking.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.IpPrefix; |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | |
| 22 | /** |
| 23 | * An interface which defines how to integrate openstack with kubernetes. |
| 24 | */ |
| 25 | public interface OpenstackK8sIntegrationService { |
| 26 | |
| 27 | /** |
| 28 | * Installs K8S pass-through CNI related flow rules. |
| 29 | * |
| 30 | * @param k8sNodeIp kubernetes node IP address |
| 31 | * @param podCidr kubernetes POD CIDR |
| 32 | * @param serviceCidr kubernetes service CIDR |
| 33 | * @param podGatewayIp kubernetes POD's gateway IP |
| 34 | * @param osK8sIntPortName openstack k8s integration patch port name |
| 35 | * @param k8sIntOsPortMac k8s integration to openstack patch port MAC |
| 36 | */ |
| 37 | void installCniPtNodeRules(IpAddress k8sNodeIp, IpPrefix podCidr, |
| 38 | IpPrefix serviceCidr, IpAddress podGatewayIp, |
| 39 | String osK8sIntPortName, MacAddress k8sIntOsPortMac); |
| 40 | |
| 41 | /** |
| 42 | * Uninstalls K8S pass-through CNI related flow rules. |
| 43 | * |
| 44 | * @param k8sNodeIp kubernetes node IP address |
| 45 | * @param podCidr kubernetes POD CIDR |
| 46 | * @param serviceCidr kubernetes service CIDR |
| 47 | * @param podGatewayIp kubernetes POD's gateway IP |
| 48 | * @param osK8sIntPortName openstack k8s integration patch port name |
| 49 | * @param k8sIntOsPortMac k8s integration to openstack patch port MAC |
| 50 | */ |
| 51 | void uninstallCniPtNodeRules(IpAddress k8sNodeIp, IpPrefix podCidr, |
| 52 | IpPrefix serviceCidr, IpAddress podGatewayIp, |
| 53 | String osK8sIntPortName, MacAddress k8sIntOsPortMac); |
Jian Li | 6d2ffbf | 2020-11-04 15:58:18 +0900 | [diff] [blame^] | 54 | |
| 55 | /** |
| 56 | * Installs K8S pass-through CNI related node port flow rules. |
| 57 | * |
| 58 | * @param k8sNodeIp kubernetes node IP address |
| 59 | * @param osK8sExtPortName openstack k8s external patch port name |
| 60 | */ |
| 61 | void installCniPtNodePortRules(IpAddress k8sNodeIp, String osK8sExtPortName); |
| 62 | |
| 63 | /** |
| 64 | * Uninstalls K8S pass-through CNI related node port flow rules. |
| 65 | * |
| 66 | * @param k8sNodeIp kubernetes node IP address |
| 67 | * @param osK8sExtPortName openstack k8s external patch port name |
| 68 | */ |
| 69 | void uninstallCniPtNodePortRules(IpAddress k8sNodeIp, String osK8sExtPortName); |
Jian Li | 4b5048a | 2020-10-08 02:57:45 +0900 | [diff] [blame] | 70 | } |