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

cannot use strategicMergePatches feature of helmfiles #8003

Closed
mestuddtc opened this issue Nov 22, 2021 · 0 comments · Fixed by jenkins-x-plugins/jx-gitops#825
Closed

cannot use strategicMergePatches feature of helmfiles #8003

mestuddtc opened this issue Nov 22, 2021 · 0 comments · Fixed by jenkins-x-plugins/jx-gitops#825

Comments

@mestuddtc
Copy link

I followed (documentation from helmfiles)[https://github.com/roboll/helmfile/blob/master/docs/advanced-features.md] to configure resources in a way not supported by the helm chart values. jx admin log shows the boot job failing:

"ingress-nginx" has been added to your repositories

in ./helmfile.yaml: in .helmfiles[3]: in helmfiles/nginx/helmfile.yaml: [exec: "kustomize": executable file not found in $PATH

COMMAND:
  kustomize build /tmp/chartify892838689/nginx-ingress/ingress-nginx --output /tmp/chartify892838689/nginx-ingress/ingress-nginx/all.patched.yaml

OUTPUT:
]
make[1]: *** [versionStream/src/Makefile.mk:117: fetch] Error 1
make[1]: Leaving directory '/workspace/source'
error: failed to regenerate: failed to regenerate phase 1: failed to run 'make regen-phase-1' command in directory '.', output: ''
make: *** [versionStream/src/Makefile.mk:242: regen-check] Error 1

This particular instance, I need to use AWS ACM certificates, so am modifying the nginx ingress to use them and still redirect HTTP to HTTPS. (see kubernetes/ingress-nginx#2724)

# helmfiles/nginx/helmfile.yaml
filepath: ""
environments:
  default:
    values:
    - jx-values.yaml
namespace: nginx
repositories:
- name: stable
  url: https://charts.helm.sh/stable
- name: ingress-nginx
  url: https://kubernetes.github.io/ingress-nginx
releases:
- chart: ingress-nginx/ingress-nginx
  version: 3.12.0
  name: nginx-ingress
  values:
  - ../../versionStream/charts/ingress-nginx/ingress-nginx/values.yaml.gotmpl
  - ../../versionStream/charts/ingress-nginx/ingress-nginx/values.yaml.gotmpl
  - jx-values.yaml
  - my-values.yaml
  strategicMergePatches:
    - apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: ingress-nginx-controller
        namespace: nginx
      spec:
        template:
          spec:
            containers:
              - name: controller
                ports:
                  - containerPort: 8080
                    name: http-redirect
                    protocol: TCP
    - apiVersion: v1
      kind: ConfigMap
      metadata:
        name: ingress-nginx-controller
        namespace: nginx
      data:
        http-snippet: |
          map true $pass_access_scheme {
            default "https";
          }
          map true $pass_port {
            default 443;
          }

          server {
            listen 8080 proxy_protocol;
            return 308 https://$host$request_uri;
              }
templates: {}
renderedvalues: {}
# helmfiles/nginx/my-values.yaml
controller:
  service:
    targetPorts:
      http: http-redirect # redirect http to https
      https: http
    annotations:
      # Enable SSL termination at NLB
      service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:284604561775:certificate/39dac33c-c0a4-4a07-8dc6-a8f6abf36761
      service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
      service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https"
      service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
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 a pull request may close this issue.

1 participant