Skip to content
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

chore: bump helm dependency deployment chart v3.2.0 #222

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

bengtfredh
Copy link
Member

@bengtfredh bengtfredh commented Sep 27, 2024

Description

  • bump helm dependencies chart deployment to v3.2.0

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@bengtfredh
Copy link
Member Author

Pipeline code to patch deployment for apps which use old version until they have upgraded to 3.2.0. This only in "Helm Upgrade Test" for now:

@@ -9,20 +9,40 @@ catch {
 helm plugin install https://github.com/helm/helm-mapkubeapis
 # Define the new mapping to append
 $NewItem = @"
+
   - deprecatedAPI: "apiVersion: autoscaling/v2beta2\nkind: HorizontalPodAutoscaler\n"
     newAPI: "apiVersion: autoscaling/v2\nkind: HorizontalPodAutoscaler\n"
     deprecatedInVersion: "v1.23"
     removedInVersion: "v1.26"
+  - deprecatedAPI: "apiVersion: traefik.containo.us/v1alpha1\nkind: IngressRoute\n"
+    newAPI: "apiVersion: traefik.io/v1alpha1\nkind: IngressRoute\n"
+    deprecatedInVersion: "v1.23"
+    removedInVersion: "v1.26"
+  - deprecatedAPI: "apiVersion: traefik.containo.us/v1alpha1\nkind: Middleware\n"
+    newAPI: "apiVersion: traefik.io/v1alpha1\nkind: Middleware\n"
+    deprecatedInVersion: "v1.23"
+    removedInVersion: "v1.26"
+  - deprecatedAPI: "apiVersion: traefik.containo.us/v1alpha1\nkind: TLSOption\n"
+    newAPI: "apiVersion: traefik.io/v1alpha1\nkind: TLSOption\n"
+    deprecatedInVersion: "v1.23"
+    removedInVersion: "v1.26"
+  - deprecatedAPI: "apiVersion: traefik.containo.us/v1alpha1\nkind: TLSStore\n"
+    newAPI: "apiVersion: traefik.io/v1alpha1\nkind: TLSStore\n"
+    deprecatedInVersion: "v1.23"
+    removedInVersion: "v1.26"
 "@

 $MAP_PATH = "/home/vsts/.local/share/helm/plugins/helm-mapkubeapis/config/Map.yaml"
@@ -51,9 +71,21 @@ $ai_instr_key = (Get-AzApplicationInsights -ResourceGroupName $resourceGroupName
 # Run helm mapkubeapis with the modified YAML file
 helm mapkubeapis $(RELEASE_NAME)

+# Content in helm-post-renderer.sh
+$HelmPostRenderer = @"
+#!/bin/bash
+## Read the entire Helm output (rendered templates) from stdin
+## Replace the apiVersion and output the result
+sed 's/apiVersion: traefik.containo.us\/v1alpha1/apiVersion: traefik.io\/v1alpha1/g'
+"@
+# Add content to post-renderer script
+Add-Content -Path helm-post-renderer.sh -Value $HelmPostRenderer
+chmod +x helm-post-renderer.sh
+
 helm upgrade $(RELEASE_NAME) $(APP_COMMIT_ID)/deployment --install `
--f overrides.yaml --atomic
+-f overrides.yaml --set deployment.image.pullSecrets="" --set deployment.ingressRoute.tls="" --post-renderer ./helm-post-renderer.sh --atomic

 if(!$?) {

Copy link
Contributor

@martinothamar martinothamar left a comment

Choose a reason for hiding this comment

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

When should this be merged? Do all clusters have this new CRD version?

@bengtfredh
Copy link
Member Author

Yes, ready to merge - everything is in place. We even patch on deploy apps that use old template.

@martinothamar martinothamar merged commit 15f5fc4 into main Oct 9, 2024
5 of 8 checks passed
@martinothamar martinothamar deleted the chore/bump-helm-deployment-3.2.0 branch October 9, 2024 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants