-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add k8s master table yang model #12331
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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." | ||
} | ||
} |
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" | ||
} | ||
} | ||
} | ||
} | ||
} |
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"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be false too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently sonic join logic is to download k8a default ca.crt and combine it with local ame certificate, we get the kubeconfig credential. The default ca.crt is stored in k8s configmap, we download it from apiserver endpoint, and sonic impossibly have the default ca.crt, but if sonic want to establish secure connection with apiserver, sonic needs k8s default ca.crt. So, the downloading k8s default ca request can only be insecure currently. So, I set the default value "true". |
||
} | ||
|
||
} | ||
/* end of container SERVER */ | ||
} | ||
/* end of container KUBERNETES_MASTER */ | ||
} | ||
/* end of top level container */ | ||
} | ||
/* end of module sonic-kubernetes_master */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use IPAddress type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be IPAddress type and DNS domain type, currently use inet:host to cover both of them.