-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yun Li <yunli1@microsoft.com>
- Loading branch information
1 parent
62692f4
commit c7798f9
Showing
5 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
17 changes: 17 additions & 0 deletions
17
src/sonic-yang-models/tests/yang_model_tests/tests/kubernetes_master.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"KUBERNETES_MASTER_WITH_CORRECT_VALUES": { | ||
"desc": "CONFIG KUBERNETES_MASTER TABLE WITH ALL THE CORRECT VALUES" | ||
}, | ||
"KUBERNETES_MASTER_WITH_INVALID_BOOLEAN_TYPE" : { | ||
"desc": "Referring invalid kubernetes_master boolean types.", | ||
"eStrKey": "Pattern", | ||
"eStr": ["false|true|False|True"] | ||
}, | ||
"KUBERNETES_MASTER_INVALID_PORT": { | ||
"desc": "Configure invalid PORT in kubernetes_master.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"KUBERNETES_MASTER_INVALID_IP" : { | ||
"desc": "Configure invalid IP in kubernetes_master." | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/sonic-yang-models/tests/yang_model_tests/tests_config/kubernetes_master.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"KUBERNETES_MASTER_WITH_CORRECT_VALUES": { | ||
"sonic-kubernetes_master:sonic-kubernetes_master": { | ||
"sonic-kubernetes_master:KUBERNETES_MASTER": { | ||
"sonic-kubernetes_master:SERVER": { | ||
"ip": "192.168.122.11", | ||
"port": "6443", | ||
"disable": "False", | ||
"insecure": "True" | ||
} | ||
} | ||
} | ||
}, | ||
"KUBERNETES_MASTER_WITH_INVALID_BOOLEAN_TYPE": { | ||
"sonic-kubernetes_master:sonic-kubernetes_master": { | ||
"sonic-kubernetes_master:KUBERNETES_MASTER": { | ||
"sonic-kubernetes_master:SERVER": { | ||
"ip": "192.168.122.11", | ||
"port": "6443", | ||
"disable": "FAlse", | ||
"insecure": "True" | ||
} | ||
} | ||
} | ||
}, | ||
"KUBERNETES_MASTER_INVALID_PORT": { | ||
"sonic-kubernetes_master:sonic-kubernetes_master": { | ||
"sonic-kubernetes_master:KUBERNETES_MASTER": { | ||
"sonic-kubernetes_master:SERVER": { | ||
"ip": "192.168.122.11", | ||
"port": "65536", | ||
"disable": "False", | ||
"insecure": "True" | ||
} | ||
} | ||
} | ||
}, | ||
"KUBERNETES_MASTER_INVALID_IP": { | ||
"sonic-kubernetes_master:sonic-kubernetes_master": { | ||
"sonic-kubernetes_master:KUBERNETES_MASTER": { | ||
"sonic-kubernetes_master:SERVER": { | ||
"ip": 10, | ||
"port": "6443", | ||
"disable": "False", | ||
"insecure": "True" | ||
} | ||
} | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/sonic-yang-models/yang-models/sonic-kubernetes_master.yang
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module sonic-kubernetes_master { | ||
|
||
yang-version 1.1; | ||
|
||
namespace "http://github.com/Azure/sonic-kubernetes_master"; | ||
prefix kubernetes_master; | ||
|
||
import ietf-inet-types { | ||
prefix inet; | ||
} | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
description "KUBERNETES_MASTER YANG Module for SONiC OS"; | ||
|
||
revision 2022-10-09 { | ||
description "First Revision"; | ||
} | ||
|
||
container sonic-kubernetes_master { | ||
|
||
container KUBERNETES_MASTER { | ||
|
||
description "KUBERNETES_MASTER part of config_db.json"; | ||
|
||
container SERVER { | ||
|
||
leaf ip { | ||
description "Kubernetes api server endpoint"; | ||
type string; | ||
} | ||
|
||
leaf port { | ||
description "Kubernetes api server port"; | ||
type inet:port-number; | ||
} | ||
|
||
leaf disable { | ||
description "This configuration identicates whether disable kubernetes"; | ||
type stypes:boolean_type; | ||
default "false"; | ||
} | ||
|
||
leaf insecure { | ||
description "This configuration identicates it will download kubernetes | ||
CA by http other than https"; | ||
type stypes:boolean_type; | ||
default "true"; | ||
} | ||
|
||
} | ||
/* end of container SERVER */ | ||
} | ||
/* end of container KUBERNETES_MASTER */ | ||
} | ||
/* end of top level container */ | ||
} | ||
/* end of module sonic-kubernetes_master */ |