Skip to content

feat: adds a mindthegap container and deployment #637

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

Merged
merged 24 commits into from
Jun 17, 2024

Conversation

faiq
Copy link
Contributor

@faiq faiq commented May 8, 2024

What problem does this PR solve?:

This mindthegap container is going to serve the helm charts for any helm addons we have.

Which issue(s) this PR fixes:
https://jira.nutanix.com/browse/NCN-100596
https://jira.nutanix.com/browse/NCN-100597

How Has This Been Tested?:

Special notes for your reviewer:

@faiq faiq marked this pull request as ready for review May 10, 2024 15:09
@faiq faiq changed the title feat: adds a mindthegap container feat: adds a mindthegap container and deployment May 10, 2024
@github-actions github-actions bot added feature and removed feature labels May 10, 2024
@faiq
Copy link
Contributor Author

faiq commented May 10, 2024

01:23 PM  faiqus @ archlinux  ~/go/src/github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix  ⏎ 130  faiq/adds-mindthegap-container⚡?+ 
$ kubectl get po
NAME                                                      READY   STATUS    RESTARTS   AGE
cluster-api-runtime-extensions-nutanix-68f76fb8cf-6zngc   1/1     Running   0          5m51s
mindthegap-6ff84f74cc-68x6d                               1/1     Running   0          21m

01:23 PM  faiqus @ archlinux  ~/go/src/github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix  faiq/adds-mindthegap-container⚡?+ 
$ kubectl get cm ^C

01:23 PM  faiqus @ archlinux  ~/go/src/github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix  ⏎ 130  faiq/adds-mindthegap-container⚡?+ 
$ kubectl get cm default-helm-addons-config -o yaml
apiVersion: v1
data:
  cilium: |
    ChartName: cilium
    ChartVersion: 1.15.0
    RepositoryURL: registry.default.svc
  cluster-autoscaler: |
    ChartName: cluster-autoscaler
    ChartVersion: 9.35.0
    RepositoryURL: registry.default.svc
  metallb: |
    ChartName: metallb
    ChartVersion: v0.14.5
    RepositoryURL: registry.default.svc
  nfd: |
    ChartName: node-feature-discovery
    ChartVersion: v0.15.2
    RepositoryURL: registry.default.svc
  nutanix-ccm: |
    ChartName: nutanix-cloud-provider
    ChartVersion: 0.3.3
    RepositoryURL: registry.default.svc
  nutanix-snapshot-csi: |
    ChartName: nutanix-csi-snapshot
    ChartVersion: 6.3.2
    RepositoryURL: registry.default.svc
  nutanix-storage-csi: |
    ChartName: nutanix-csi-storage
    ChartVersion: v3.0.0-beta.1912
    RepositoryURL: registry.default.svc
  tigera-operator: |
    ChartName: tigera-operator
    ChartVersion: v3.26.4
    RepositoryURL: registry.default.svc
kind: ConfigMap

@github-actions github-actions bot added feature and removed feature labels May 10, 2024
@deepakm-ntnx
Copy link
Contributor

Could you please document in the description, general workflow with and without mindthegap from customer perspective. need a writeup to undestand from newbie perspective

@faiq
Copy link
Contributor Author

faiq commented May 13, 2024

the workflow should be transparent to the user. this is an internal implementation detail of how helm charts are served

@faiq faiq force-pushed the faiq/adds-mindthegap-container branch 4 times, most recently from 51a9eda to fd3f11e Compare May 17, 2024 14:59
@faiq faiq force-pushed the faiq/adds-mindthegap-container branch 3 times, most recently from b1d624c to 97b28b2 Compare May 30, 2024 16:55
@faiq faiq force-pushed the faiq/adds-mindthegap-container branch from c8ee816 to d2e83d3 Compare June 4, 2024 15:06
@faiq faiq force-pushed the faiq/adds-mindthegap-container branch 2 times, most recently from 5d13a51 to 4767043 Compare June 12, 2024 18:37
@faiq faiq force-pushed the faiq/adds-mindthegap-container branch from e702565 to e0ac578 Compare June 13, 2024 15:52
@faiq faiq enabled auto-merge (squash) June 13, 2024 17:36
@faiq faiq force-pushed the faiq/adds-mindthegap-container branch from de9a942 to 1db89b4 Compare June 17, 2024 19:12
@faiq faiq force-pushed the faiq/adds-mindthegap-container branch from 1db89b4 to 2c3e4f3 Compare June 17, 2024 19:13
Copy link
Contributor

@supershal supershal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thanks for solving very hard problem with airgap usecase.

Copy link
Contributor

@dkoshkin dkoshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job getting this across the line. and thanks for taking in my previous suggestions!

@faiq faiq force-pushed the faiq/adds-mindthegap-container branch from ac650c4 to a1a926b Compare June 17, 2024 20:53
@faiq faiq merged commit b72b113 into main Jun 17, 2024
17 checks passed
@faiq faiq deleted the faiq/adds-mindthegap-container branch June 17, 2024 21:28
@github-actions github-actions bot mentioned this pull request Jun 17, 2024
@@ -84,6 +84,9 @@ hooks:

helmAddonsConfigMap: default-helm-addons-config

selfHostedRegistry: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we combine this with helmRegistryImage please? So the config looks like:

inClusterHelmOCIRegistry:
  enabled: true
  image:
    repository: repository: ghcr.io/nutanix-cloud-native/caren-helm-reg
    tag: ""
    pullPolicy: IfNotPresent

Comment on lines +102 to +110
f, err = os.OpenFile(fullOutputfilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o666)
if err != nil {
log.Error(err, "failed to create file")
}
defer f.Close()
_, err = bytes.NewBuffer(b).WriteTo(f)
if err != nil {
log.Error(err, "failed to write to file")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler to just use os.WriteFile

Suggested change
f, err = os.OpenFile(fullOutputfilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o666)
if err != nil {
log.Error(err, "failed to create file")
}
defer f.Close()
_, err = bytes.NewBuffer(b).WriteTo(f)
if err != nil {
log.Error(err, "failed to write to file")
}
if err := os.WriteFile(fullOutputfilePath, b, 0o644); err != nil {
log.Error(err, "failed to write mindthegap config file")
}

secretName: helm-repository-tls
---
apiVersion: apps/v1
kind: Deployment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add tolerations and node affinity (preferredDuringSchedulingIgnoredDuringExecution) to allow running on CP nodes but prefer to run on non-CP nodes.

faiq pushed a commit that referenced this pull request Jun 24, 2024
🤖 I have created a release *beep* *boop*
---


## 0.10.0 (2024-06-24)

<!-- Release notes generated using configuration in .github/release.yaml
at main -->

## What's Changed
### Exciting New Features 🎉
* feat: Upgrade to Cilium v1.15.5 by @jimmidyson in
#689
* feat: Upgrade to Calico v3.28.0 by @jimmidyson in
#688
* feat: bumps caaph to v0.2.3 by @faiq in
#691
* feat: Add local-path-provisioner CSI by @jimmidyson in
#693
* feat: cluster-api v1.7.3 by @jimmidyson in
#714
* feat: bumps caaph to 0.2.4 by @faiq in
#718
* feat: Controller that copies ClusterClasses to namespaces by
@dlipovetsky in
#715
* feat: adds a mindthegap container and deployment by @faiq in
#637
* feat: implements BeforeClusterUpgrade hook by @faiq in
#682
### Fixes 🔧
* fix: use external Nutanix API types directly by @dkoshkin in
#698
* fix: Post-process clusterconfig CRDs for supported CSI providers by
@jimmidyson in
#695
* fix: nutanix credentials Secrets owner refs by @dkoshkin in
#711
* fix: credential provider response secret ownership by @dkoshkin in
#709
* fix: static credentials Secret generation by @dkoshkin in
#717
* fix: set ownerReference on imageRegistry and globalMirror Secrets by
@dkoshkin in
#720
* fix: Allow Nutanix CSI snapshot controller & webhook to run on CP
nodes by @dlipovetsky in
#723
* refactor: Use maps for CSI providers and storage classes by
@jimmidyson in
#696
* fix: CredentialProviderConfig matchImages to support registries with
port by @dkoshkin in
#724
* fix: Allow Node Feature Discovery garbage collector to run on
control-plane nodes by @dlipovetsky in
#722
* fix: RBAC role for namespace-sync controller to watch,list namespaces
by @dkoshkin in
#738
* fix: image registries not handling CA certificates by @dkoshkin in
#729
* fix: adds a docker buildx step before release-snapshot by @faiq in
#741
### Other Changes
* docs: Add released version to helm and clusterctl install by
@jimmidyson in
#683
* revert: Temporary lint config fix until next golangci-lint release
(#629) by @jimmidyson in
#686
* refactor: Delete unused code by @jimmidyson in
#687
* refactor: Reduce log verbosity for skipped handlers by @jimmidyson in
#692
* build: update Go to 1.22.4 by @dkoshkin in
#700
* build(deps): Upgrade CAPX version to v1.4.0 by @thunderboltsid in
#707
* build: Move CSI supported provider logic to script by @jimmidyson in
#703
* build: Add testifylint linter by @jimmidyson in
#706
* build: Update all tools by @jimmidyson in
#704
* refactor: rename credential provider response secret by @dkoshkin in
#710
* refactor: Simplify code by using slices.Clone by @jimmidyson in
#712
* refactor: consistently use the same SetOwnerReference function by
@dkoshkin in
#713
* refactor: kube-vip commands by @dkoshkin in
#699
* build: Fix an incorrect make variable passed to goreleaser by
@dlipovetsky in
#716
* build: Add 'chart-docs' make target by @dlipovetsky in
#727
* build: Make CAREN mindthegap reg multiarch by @jimmidyson in
#730
* Add helm values schema plugin by @dlipovetsky in
#728
* test(e2e): Use mesosphere fork with CRSBinding fix by @jimmidyson in
#736

## New Contributors
* @thunderboltsid made their first contribution in
#707

**Full Changelog**:
v0.9.0...v0.10.0

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants