Add ntp to network catalogue
Adds an ntp object to the NetworkCatalogue schema and populates default ntp servers into the networking base catalogue. Also adds replacement rules in: * function/k8scontrol/replacements * function/workers-capm3/replacements Change-Id: I5dedda563c8825c283e7ba846bedb0b282459d41
This commit is contained in:
parent
c8d9160fe2
commit
b69a641940
@ -67,3 +67,9 @@ spec:
|
|||||||
type: dns
|
type: dns
|
||||||
- address: 8.8.4.4
|
- address: 8.8.4.4
|
||||||
type: dns
|
type: dns
|
||||||
|
ntp:
|
||||||
|
servers:
|
||||||
|
- 0.pool.ntp.org
|
||||||
|
- 1.pool.ntp.org
|
||||||
|
- 2.pool.ntp.org
|
||||||
|
- 3.pool.ntp.org
|
@ -175,6 +175,16 @@ spec:
|
|||||||
format: cidr
|
format: cidr
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
ntp:
|
||||||
|
description: NtpSpec defines the spec for NTP servers
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
servers:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
|
@ -43,3 +43,14 @@ replacements:
|
|||||||
objref:
|
objref:
|
||||||
kind: Metal3Cluster
|
kind: Metal3Cluster
|
||||||
fieldrefs: ["spec.controlPlaneEndpoint"]
|
fieldrefs: ["spec.controlPlaneEndpoint"]
|
||||||
|
|
||||||
|
# Replace the k8s controlplane NTP servers
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: NetworkCatalogue
|
||||||
|
name: networking
|
||||||
|
fieldref: spec.ntp
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: KubeadmControlPlane
|
||||||
|
fieldrefs: ["spec.kubeadmConfigSpec.ntp"]
|
||||||
|
@ -3,3 +3,4 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- workers-env-vars.yaml
|
- workers-env-vars.yaml
|
||||||
- generated-secrets.yaml
|
- generated-secrets.yaml
|
||||||
|
- networking.yaml
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: ReplacementTransformer
|
||||||
|
metadata:
|
||||||
|
name: workers-networking-replacements
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |-
|
||||||
|
container:
|
||||||
|
image: quay.io/airshipit/replacement-transformer:latest
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: NetworkCatalogue
|
||||||
|
name: networking
|
||||||
|
fieldref: spec.ntp
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: KubeadmConfigTemplate
|
||||||
|
name: worker-1
|
||||||
|
fieldrefs: ["spec.template.spec.ntp"]
|
@ -108,11 +108,18 @@ type IronicSpec struct {
|
|||||||
IronicInspectorEndpoint string `json:"ironicInspectorEndpoint,omitempty"`
|
IronicInspectorEndpoint string `json:"ironicInspectorEndpoint,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NtpSpec defines the spec for NTP servers
|
||||||
|
type NtpSpec struct {
|
||||||
|
Enabled bool `json:"enabled,omitempty"`
|
||||||
|
Servers []string `json:"servers,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// NetworkCatalogueSpec defines the default networking catalogs hosted in airshipctl
|
// NetworkCatalogueSpec defines the default networking catalogs hosted in airshipctl
|
||||||
type NetworkCatalogueSpec struct {
|
type NetworkCatalogueSpec struct {
|
||||||
CommonHostNetworking HostNetworkingSpec `json:"commonHostNetworking,omitempty"`
|
CommonHostNetworking HostNetworkingSpec `json:"commonHostNetworking,omitempty"`
|
||||||
Kubernetes KubernetesSpec `json:"kubernetes,omitempty"`
|
Kubernetes KubernetesSpec `json:"kubernetes,omitempty"`
|
||||||
Ironic IronicSpec `json:"ironic,omitempty"`
|
Ironic IronicSpec `json:"ironic,omitempty"`
|
||||||
|
Ntp NtpSpec `json:"ntp,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:object:root=true
|
// +kubebuilder:object:root=true
|
||||||
|
@ -1178,6 +1178,7 @@ func (in *NetworkCatalogueSpec) DeepCopyInto(out *NetworkCatalogueSpec) {
|
|||||||
in.CommonHostNetworking.DeepCopyInto(&out.CommonHostNetworking)
|
in.CommonHostNetworking.DeepCopyInto(&out.CommonHostNetworking)
|
||||||
out.Kubernetes = in.Kubernetes
|
out.Kubernetes = in.Kubernetes
|
||||||
out.Ironic = in.Ironic
|
out.Ironic = in.Ironic
|
||||||
|
in.Ntp.DeepCopyInto(&out.Ntp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkCatalogueSpec.
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkCatalogueSpec.
|
||||||
@ -1222,6 +1223,26 @@ func (in *NetworkCatalogues) DeepCopyObject() runtime.Object {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *NtpSpec) DeepCopyInto(out *NtpSpec) {
|
||||||
|
*out = *in
|
||||||
|
if in.Servers != nil {
|
||||||
|
in, out := &in.Servers, &out.Servers
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NtpSpec.
|
||||||
|
func (in *NtpSpec) DeepCopy() *NtpSpec {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(NtpSpec)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *Phase) DeepCopyInto(out *Phase) {
|
func (in *Phase) DeepCopyInto(out *Phase) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
Loading…
Reference in New Issue
Block a user