-
Notifications
You must be signed in to change notification settings - Fork 230
Re-introduce PR#1030 baseDomain patch and add backend logic #1176
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
Changes from all commits
d46c74b
5147e3f
e100d17
210f049
9f7fff8
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 |
|---|---|---|
|
|
@@ -35,6 +35,7 @@ const ( | |
| defaultManifestDirEtc = "/etc/microshift/manifests" | ||
| // for files embedded in ostree. i.e. cni/other component customizations | ||
| defaultManifestDirLib = "/usr/lib/microshift/manifests" | ||
| DefaultClusterName = "microshift" | ||
| ) | ||
|
|
||
| var ( | ||
|
|
@@ -44,13 +45,11 @@ var ( | |
| ) | ||
|
|
||
| type ClusterConfig struct { | ||
| URL string `json:"url"` | ||
|
|
||
| URL string `json:"url"` | ||
| ClusterCIDR string `json:"clusterCIDR"` | ||
| ServiceCIDR string `json:"serviceCIDR"` | ||
| ServiceNodePortRange string `json:"serviceNodePortRange"` | ||
| DNS string `json:"-"` | ||
| Domain string `json:"domain"` | ||
|
mangelajo marked this conversation as resolved.
|
||
| } | ||
|
|
||
| type IngressConfig struct { | ||
|
|
@@ -61,22 +60,22 @@ type IngressConfig struct { | |
| type MicroshiftConfig struct { | ||
| LogVLevel int `json:"logVLevel"` | ||
|
|
||
| SubjectAltNames []string `json:"subjectAltNames"` | ||
| NodeName string `json:"nodeName"` | ||
| NodeIP string `json:"nodeIP"` | ||
|
|
||
| Cluster ClusterConfig `json:"cluster"` | ||
| SubjectAltNames []string `json:"subjectAltNames"` | ||
| NodeName string `json:"nodeName"` | ||
| NodeIP string `json:"nodeIP"` | ||
| BaseDomain string `json:"baseDomain"` | ||
| Cluster ClusterConfig `json:"cluster"` | ||
|
|
||
| Ingress IngressConfig `json:"-"` | ||
| } | ||
|
|
||
| // Top level config | ||
| // Top level config file | ||
| type Config struct { | ||
| NodeName string `json:"nodeName"` | ||
| NodeIP string `json:"nodeIP"` | ||
| URL string `json:"url"` | ||
| ClusterDomain string `json:"clusterDomain"` | ||
| Network Network `json:"network"` | ||
| DNS DNS `json:"dns"` | ||
|
fzdarsky marked this conversation as resolved.
|
||
| Debugging Debugging `json:"debugging"` | ||
| SubjectAltNames []string `json:"subjectAltNames"` | ||
| } | ||
|
|
@@ -106,6 +105,19 @@ type ClusterNetworkEntry struct { | |
| CIDR string `json:"cidr,omitempty"` | ||
| } | ||
|
|
||
| type DNS struct { | ||
| // baseDomain is the base domain of the cluster. All managed DNS records will | ||
| // be sub-domains of this base. | ||
| // | ||
| // For example, given the base domain `example.com`, router exposed | ||
| // domains will be formed as `*.apps.microshift.example.com` by default, | ||
| // and API service will have a DNS entry for `api.microshift.example.com`, | ||
| // as well as "api-int.microshift.example.com" for internal k8s API access. | ||
| // | ||
| // Once set, this field cannot be changed. | ||
|
Contributor
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. Do we need another ticket to protect against the value changing?
Member
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. I believe that this is a comment inherited from the OCP config API: https://github.com/openshift/api/blob/master/config/v1/types_dns.go#L27-L34 We might want to update it if it doesn't apply to MicroShift
Contributor
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. It does apply to MicroShift, too, I think @dhellmann 's concern was more where/how this is enforced.
Contributor
Author
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. We may want to enforce against changes, I agree. |
||
| BaseDomain string `json:"baseDomain"` | ||
| } | ||
|
|
||
| type Debugging struct { | ||
| // Valid values are: "Normal", "Debug", "Trace", "TraceAll". | ||
| // Defaults to "Normal". | ||
|
|
@@ -180,12 +192,12 @@ func NewMicroshiftConfig() *MicroshiftConfig { | |
| SubjectAltNames: subjectAltNames, | ||
| NodeName: nodeName, | ||
| NodeIP: nodeIP, | ||
| BaseDomain: "example.com", | ||
| Cluster: ClusterConfig{ | ||
| URL: "https://127.0.0.1:6443", | ||
| ClusterCIDR: "10.42.0.0/16", | ||
| ServiceCIDR: "10.43.0.0/16", | ||
| ServiceNodePortRange: "30000-32767", | ||
| Domain: "cluster.local", | ||
| }, | ||
| } | ||
| } | ||
|
|
@@ -333,8 +345,8 @@ func (c *MicroshiftConfig) ReadFromConfigFile(configFile string) error { | |
| if config.Network.ServiceNodePortRange != "" { | ||
| c.Cluster.ServiceNodePortRange = config.Network.ServiceNodePortRange | ||
| } | ||
| if config.ClusterDomain != "" { | ||
| c.Cluster.Domain = config.ClusterDomain | ||
| if config.DNS.BaseDomain != "" { | ||
| c.BaseDomain = config.DNS.BaseDomain | ||
| } | ||
| if len(config.SubjectAltNames) > 0 { | ||
| c.SubjectAltNames = config.SubjectAltNames | ||
|
|
@@ -375,8 +387,8 @@ func (c *MicroshiftConfig) ReadFromCmdLine(flags *pflag.FlagSet) error { | |
| if s, err := flags.GetString("service-node-port-range"); err == nil && flags.Changed("service-node-port-range") { | ||
| c.Cluster.ServiceNodePortRange = s | ||
| } | ||
| if s, err := flags.GetString("cluster-domain"); err == nil && flags.Changed("cluster-domain") { | ||
| c.Cluster.Domain = s | ||
| if s, err := flags.GetString("base-domain"); err == nil && flags.Changed("base-domain") { | ||
| c.BaseDomain = s | ||
| } | ||
|
|
||
| return nil | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.