Support for VRRP keepalived for Ingress
- Added function/k8scontrol-ha - Updated type/airship-core/controlplane to point to treasuremap function - added networking-ha VariableCatalogue to treasuremap-base-catlg Issue #94 Change-Id: I5a1ea545a01f59cd2213c375e42dcbca34bbad22
This commit is contained in:
parent
5ae31997b2
commit
5ef460d926
13
manifests/function/k8scontrol-ha/kustomization.yaml
Normal file
13
manifests/function/k8scontrol-ha/kustomization.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ../../../../airshipctl/manifests/function/k8scontrol
|
||||||
|
|
||||||
|
patchesJson6902:
|
||||||
|
- target:
|
||||||
|
group: controlplane.cluster.x-k8s.io
|
||||||
|
version: v1alpha3
|
||||||
|
kind: KubeadmControlPlane
|
||||||
|
name: cluster-controlplane
|
||||||
|
path: vrrp_keepalived_patch.yaml
|
@ -0,0 +1,2 @@
|
|||||||
|
resources:
|
||||||
|
- networking-ha.yaml
|
@ -0,0 +1,49 @@
|
|||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: ReplacementTransformer
|
||||||
|
metadata:
|
||||||
|
name: networking-ha-replacements
|
||||||
|
annotations:
|
||||||
|
config.kubernetes.io/function: |-
|
||||||
|
container:
|
||||||
|
image: quay.io/airshipit/replacement-transformer:latest
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VariableCatalogue
|
||||||
|
name: networking-ha
|
||||||
|
fieldref: vrrp.kubernetes.virtual_ipaddress
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: KubeadmControlPlane
|
||||||
|
fieldrefs:
|
||||||
|
- "spec.kubeadmConfigSpec.files[path=/etc/keepalived/keepalived.conf].content%REPLACEMENT_VIP_1%"
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VariableCatalogue
|
||||||
|
name: networking-ha
|
||||||
|
fieldref: vrrp.ingress.virtual_ipaddress
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: KubeadmControlPlane
|
||||||
|
fieldrefs:
|
||||||
|
- "spec.kubeadmConfigSpec.files[path=/etc/keepalived/keepalived.conf].content%REPLACEMENT_VIP_2%"
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VariableCatalogue
|
||||||
|
name: networking-ha
|
||||||
|
fieldref: vrrp.kubernetes.interface
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: KubeadmControlPlane
|
||||||
|
fieldrefs:
|
||||||
|
- "spec.kubeadmConfigSpec.files[path=/etc/keepalived/keepalived.conf].content%REPLACEMENT_INTERFACE_1%"
|
||||||
|
- source:
|
||||||
|
objref:
|
||||||
|
kind: VariableCatalogue
|
||||||
|
name: networking-ha
|
||||||
|
fieldref: vrrp.ingress.interface
|
||||||
|
target:
|
||||||
|
objref:
|
||||||
|
kind: KubeadmControlPlane
|
||||||
|
fieldrefs:
|
||||||
|
- "spec.kubeadmConfigSpec.files[path=/etc/keepalived/keepalived.conf].content%REPLACEMENT_INTERFACE_2%"
|
33
manifests/function/k8scontrol-ha/vrrp_keepalived_patch.yaml
Normal file
33
manifests/function/k8scontrol-ha/vrrp_keepalived_patch.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
- op: add
|
||||||
|
path: "/spec/kubeadmConfigSpec/files/-"
|
||||||
|
value:
|
||||||
|
path: /etc/keepalived/keepalived.conf
|
||||||
|
content: |
|
||||||
|
! Configuration File for keepalived
|
||||||
|
global_defs {
|
||||||
|
}
|
||||||
|
vrrp_instance KUBERNETES {
|
||||||
|
state BACKUP
|
||||||
|
interface REPLACEMENT_INTERFACE_1
|
||||||
|
virtual_router_id 101
|
||||||
|
priority 101
|
||||||
|
advert_int 1
|
||||||
|
virtual_ipaddress {
|
||||||
|
REPLACEMENT_VIP_1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vrrp_instance INGRESS {
|
||||||
|
state BACKUP
|
||||||
|
interface REPLACEMENT_INTERFACE_2
|
||||||
|
virtual_router_id 102
|
||||||
|
priority 102
|
||||||
|
advert_int 1
|
||||||
|
virtual_ipaddress {
|
||||||
|
REPLACEMENT_VIP_2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- op: add
|
||||||
|
path: "/spec/kubeadmConfigSpec/preKubeadmCommands/-"
|
||||||
|
value:
|
||||||
|
apt-get update && apt-get install -y bridge-utils keepalived ipset ipvsadm
|
||||||
|
systemctl enable --now keepalived
|
@ -1,2 +1,3 @@
|
|||||||
resources:
|
resources:
|
||||||
- versions-treasuremap.yaml
|
- versions-treasuremap.yaml
|
||||||
|
- networking-ha.yaml
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
# This catalogue alone needs to be overriden at site level based on the
|
||||||
|
# networkign requirement like HA
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
labels:
|
||||||
|
airshipit.org/deploy-k8s: "false"
|
||||||
|
vrrp:
|
||||||
|
kubernetes:
|
||||||
|
interface: bond.51
|
||||||
|
virtual_ipaddress: 10.23.25.101
|
||||||
|
ingress:
|
||||||
|
interface: bond.51
|
||||||
|
virtual_ipaddress: 10.23.25.102
|
@ -33,3 +33,9 @@ patches: |-
|
|||||||
metadata:
|
metadata:
|
||||||
name: versions-treasuremap
|
name: versions-treasuremap
|
||||||
$patch: delete
|
$patch: delete
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
$patch: delete
|
||||||
|
@ -33,3 +33,9 @@ patches: |-
|
|||||||
metadata:
|
metadata:
|
||||||
name: versions-treasuremap
|
name: versions-treasuremap
|
||||||
$patch: delete
|
$patch: delete
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
$patch: delete
|
||||||
|
@ -9,3 +9,4 @@ resources:
|
|||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
- versions-airshipctl.yaml
|
- versions-airshipctl.yaml
|
||||||
- networking.yaml
|
- networking.yaml
|
||||||
|
- networking-ha.yaml
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
# This catalogue alone needs to be overriden at site level based on the
|
||||||
|
# networkign requirement like HA
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
labels:
|
||||||
|
airshipit.org/deploy-k8s: "false"
|
||||||
|
vrrp:
|
||||||
|
kubernetes:
|
||||||
|
interface: bond.41
|
||||||
|
virtual_ipaddress: 10.23.25.103
|
||||||
|
ingress:
|
||||||
|
interface: bond.41
|
||||||
|
virtual_ipaddress: 10.23.25.104
|
@ -13,7 +13,6 @@ spec:
|
|||||||
controlPlaneEndpoint:
|
controlPlaneEndpoint:
|
||||||
host: "10.23.25.102"
|
host: "10.23.25.102"
|
||||||
apiserverCertSANs: "[10.23.25.102, 10.23.24.102]"
|
apiserverCertSANs: "[10.23.25.102, 10.23.24.102]"
|
||||||
|
|
||||||
ironic:
|
ironic:
|
||||||
provisioningIp: "10.23.24.102"
|
provisioningIp: "10.23.24.102"
|
||||||
dhcpRange: "10.23.24.200,10.23.24.250"
|
dhcpRange: "10.23.24.200,10.23.24.250"
|
||||||
|
@ -33,3 +33,9 @@ patches: |-
|
|||||||
metadata:
|
metadata:
|
||||||
name: versions-treasuremap
|
name: versions-treasuremap
|
||||||
$patch: delete
|
$patch: delete
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
$patch: delete
|
||||||
|
@ -39,3 +39,9 @@ patches: |-
|
|||||||
metadata:
|
metadata:
|
||||||
name: versions-treasuremap
|
name: versions-treasuremap
|
||||||
$patch: delete
|
$patch: delete
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
$patch: delete
|
||||||
|
@ -33,3 +33,9 @@ patches: |-
|
|||||||
metadata:
|
metadata:
|
||||||
name: versions-treasuremap
|
name: versions-treasuremap
|
||||||
$patch: delete
|
$patch: delete
|
||||||
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: VariableCatalogue
|
||||||
|
metadata:
|
||||||
|
name: networking-ha
|
||||||
|
$patch: delete
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../../../../../../airshipctl/manifests/function/k8scontrol
|
- ../../../../function/k8scontrol-ha
|
||||||
- dex-apiserver/apiserver-certs-secret.yaml
|
- dex-apiserver/apiserver-certs-secret.yaml
|
||||||
|
|
||||||
patchesJson6902:
|
patchesJson6902:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
|
- ../../../../../function/k8scontrol-ha/replacements
|
||||||
- ../../../../../../../airshipctl/manifests/function/k8scontrol/replacements
|
- ../../../../../../../airshipctl/manifests/function/k8scontrol/replacements
|
||||||
|
Loading…
Reference in New Issue
Block a user