-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kube-vip static Pod in a Nutanix handler (#558)
**What problem does this PR solve?**: Stacked on #554 This PR moves the responsibility of adding the control-plan kube-vip to CAREN away from infra providers. This has a big benefit of being able to keep this implementation and the image version consistent across the different providers. ~Because CAPX is always requires kube-vip to be installed there are no API changes, but in the future we can add support to disable or change the provider.~ Added an empty `virtualIP{}` struct to Nutanix `controlPlaneEndpoint`. ``` spec: topology: variables: - name: clusterConfig value: nutanix: controlPlaneEndpoint: host: x.x.x.x port: 6443 virtualIP: {} ``` **Which issue(s) this PR fixes**: Fixes https://jira.nutanix.com/browse/D2IQ-100364 **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> New unit tests, and tested manually too: ``` clusterctl describe cluster $CLUSTER_NAME NAME READY SEVERITY REASON SINCE MESSAGE Cluster/dkkonvoy-042324-nutanix-03 True 76m ├─ClusterInfrastructure - NutanixCluster/dkkonvoy-042324-nutanix-03-wvv6d ├─ControlPlane - KubeadmControlPlane/dkkonvoy-042324-nutanix-03-sv2zb True 76m │ └─Machine/dkkonvoy-042324-nutanix-03-sv2zb-ds5mv True 76m │ └─MachineInfrastructure - NutanixMachine/dkkonvoy-042324-nutanix-03-sv2zb-ds5mv └─Workers └─MachineDeployment/dkkonvoy-042324-nutanix-03-md-0-w6mls True 74m └─Machine/dkkonvoy-042324-nutanix-03-md-0-w6mls-979mw-c582s True 74m └─MachineInfrastructure - NutanixMachine/dkkonvoy-042324-nutanix-03-md-0-w6mls-979mw-c582s ``` **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. --> --------- Co-authored-by: Jimmi Dyson <jimmidyson@gmail.com>
- Loading branch information
1 parent
cd3b732
commit cbd401f
Showing
26 changed files
with
1,163 additions
and
121 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
75 changes: 75 additions & 0 deletions
75
...untime-extensions-nutanix/templates/virtual-ip/kube-vip/manifests/kube-vip-configmap.yaml
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,75 @@ | ||
# Copyright 2023 D2iQ, Inc. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
#================================================================= | ||
# DO NOT EDIT THIS FILE | ||
# IT HAS BEEN GENERATED BY /hack/addons/update-kube-vip-manifests.sh | ||
#================================================================= | ||
{{- if .Values.hooks.virtualIP.kubeVip.defaultTemplateConfigMap.create }} | ||
apiVersion: v1 | ||
data: | ||
kube-vip.yaml: | | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kube-vip | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- args: | ||
- manager | ||
env: | ||
- name: vip_arp | ||
value: "true" | ||
- name: port | ||
value: '{{ `{{ .ControlPlaneEndpoint.Port }}` }}' | ||
- name: vip_nodename | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: vip_cidr | ||
value: "32" | ||
- name: dns_mode | ||
value: first | ||
- name: cp_enable | ||
value: "true" | ||
- name: cp_namespace | ||
value: kube-system | ||
- name: vip_leaderelection | ||
value: "true" | ||
- name: vip_leasename | ||
value: plndr-cp-lock | ||
- name: vip_leaseduration | ||
value: "15" | ||
- name: vip_renewdeadline | ||
value: "10" | ||
- name: vip_retryperiod | ||
value: "2" | ||
- name: address | ||
value: '{{ `{{ .ControlPlaneEndpoint.Host }}` }}' | ||
image: ghcr.io/kube-vip/kube-vip:v0.8.0 | ||
imagePullPolicy: IfNotPresent | ||
name: kube-vip | ||
resources: {} | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
- NET_RAW | ||
volumeMounts: | ||
- mountPath: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
hostAliases: | ||
- hostnames: | ||
- kubernetes | ||
ip: 127.0.0.1 | ||
hostNetwork: true | ||
volumes: | ||
- hostPath: | ||
path: /etc/kubernetes/admin.conf | ||
name: kubeconfig | ||
kind: ConfigMap | ||
metadata: | ||
creationTimestamp: null | ||
name: '{{ .Values.hooks.virtualIP.kubeVip.defaultTemplateConfigMap.name }}' | ||
{{- end -}} |
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
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
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
Oops, something went wrong.