Skip to content

Commit c23a6a9

Browse files
committed
fix: issues with mindthegap deplotment (#660)
**What problem does this PR solve?**: This adds trust-manager to allow us to use self hosted helm charts in mindthegap. See: kubernetes-sigs/cluster-api-addon-provider-helm#104 We can think about this in a couple of different parts: 1. Installing trust-manager and CRDs. We need to install trust manager so that we can create a certificate bundle with our self signed cert to caaph-controller-manager. We pull the CRDs separately because we are unable to use them in our templates because they aren't available at that time. See the comment in the script for more details. 2. Modifying CAAPH to use the bundle. This is done through a job it has a corresponding Service Account/Role/Role Binding. 3. Various little fixes. ie changing repository url and versions to using `v` I tested this by creating a docker cluster. The helm chart proxies use this value ```yaml - apiVersion: addons.cluster.x-k8s.io/v1alpha1 kind: HelmChartProxy metadata: creationTimestamp: "2024-05-14T23:41:09Z" finalizers: - helmchartproxy.addons.cluster.x-k8s.io generation: 1 name: node-feature-discovery-docker-cluster-cilium-helm-addon namespace: default ownerReferences: - apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster name: docker-cluster-cilium-helm-addon uid: e0e943e4-6d63-4d85-8d37-f63160ff93e3 resourceVersion: "3282" uid: e04b6b62-5f39-4528-87f7-5928d2afd4dd spec: chartName: node-feature-discovery clusterSelector: matchLabels: cluster.x-k8s.io/cluster-name: docker-cluster-cilium-helm-addon namespace: node-feature-discovery options: enableClientCache: false install: createNamespace: true timeout: 10m0s upgrade: maxHistory: 10 releaseName: node-feature-discovery repoURL: oci://mindthegap.mindthegap.svc/charts ``` **Which issue(s) this PR fixes**: Fixes # **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. --> **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. -->
1 parent 2e1a691 commit c23a6a9

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

charts/cluster-api-runtime-extensions-nutanix/templates/helm-chart-svc.yaml renamed to charts/cluster-api-runtime-extensions-nutanix/templates/mindthegap.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Copyright 2023 D2iQ, Inc. All rights reserved.
1+
# Copyright 2024 Nutanix. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
3+
# This file contains the manifests to run a mindthegap deployment which contains helm charts for our addons.
4+
# The pod is built via goreleaser with configuration from hack/addons.
5+
#
46
apiVersion: cert-manager.io/v1
57
kind: Issuer
68
metadata:
@@ -12,12 +14,12 @@ spec:
1214
apiVersion: cert-manager.io/v1
1315
kind: Certificate
1416
metadata:
15-
name: mindthegap-example-tls
17+
name: mindthegap-tls
1618
namespace: {{ .Release.Namespace }}
1719
spec:
1820
dnsNames:
19-
- mindthegap.default.svc
20-
- mindthegap.default.svc.cluster.local
21+
- mindthegap.{{ .Release.Namespace }}.svc
22+
- mindthegap.{{ .Release.Namespace }}.svc.cluster.local
2123
issuerRef:
2224
name: mindthegap-selfsigned
2325
kind: Issuer

hack/addons/kustomize/nfd/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ helmCharts:
1818
valuesFile: helm-values.yaml
1919
valuesInline:
2020
image:
21-
tag: "${NODE_FEATURE_DISCOVERY_VERSION}-minimal"
21+
tag: "v${NODE_FEATURE_DISCOVERY_VERSION}-minimal"
2222
includeCRDs: true
2323
skipTests: true
2424
namespace: node-feature-discovery

make/dev.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ifndef SKIP_BUILD
2727
endif
2828
kind load docker-image --name $(KIND_CLUSTER_NAME) \
2929
ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
30-
kubectl set image deployment cluster-api-runtime-extensions-nutanix webhook=ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
30+
kubectl set image deployment -n caren-system cluster-api-runtime-extensions-nutanix webhook=ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
3131
kubectl rollout restart deployment cluster-api-runtime-extensions-nutanix
3232
kubectl rollout status deployment cluster-api-runtime-extensions-nutanix
3333

pkg/handlers/generic/lifecycle/nfd/strategy_helmaddon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (s helmAddonStrategy) apply(
6868

6969
values += fmt.Sprintf(`
7070
image:
71-
tag: %s-minimal
71+
tag: v%s-minimal
7272
`, s.helmChart.Version)
7373

7474
hcp := &caaphv1.HelmChartProxy{

0 commit comments

Comments
 (0)