i have config for kuber: - name: S3PUBLICPATH value:…
- User
i have config for kuber:
- name: S3_PUBLIC_PATH value: vault:secrets/data/platform/shared/CDN#s3_public_pathand i have ingress:
ingresses:
- host: '{{ if ne .Values.Branch "master" }}{{ .Values.Branch }}.{{ end }}affiliates.fe.cpa.dev.lan'
ssl: enabled
class: 'internal'
additionalAnnotations:
nginx.ingress.kubernetes.io/proxy-buffer-size: '32k'
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "X-Frame-Options: SAMEORIGIN";
more_set_headers "Content-Security-Policy: frame-src 'self' https://www.sravni.ru; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' https://s91588.cdn.ngenix.net data:;";
paths:
- /
how i can use S3_PUBLIC_PATH instead of https://s91588.cdn.ngenix.net
- host: '{{ if ne .Values.Branch "master" }}{{ .Values.Branch }}.{{ end }}affiliates.fe.cpa.dev.lan'
ssl: enabled
class: 'internal'
additionalAnnotations:
nginx.ingress.kubernetes.io/proxy-buffer-size: '32k'
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "X-Frame-Options: SAMEORIGIN";
more_set_headers "Content-Security-Policy: frame-src 'self' https://www.sravni.ru; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' https://s91588.cdn.ngenix.net data:;";
paths:
- Assistant
To replace the hardcoded URL
https://s91588.cdn.ngenix.netin your Ingress configuration with the environment variableS3_PUBLIC_PATH, you can use a templating solution, provided by tools like Helm or other templating engines in your Kubernetes manifests.Assuming you're using Helm, you need to set up a template to reference the value of
S3_PUBLIC_PATH. Here is an example showing you how to do this:-
Set up a Values file or directly in the Helm command. Ensure
S3_PUBLIC_PATHis defined in your values.yaml or passed as a parameter in the Helm command:S3_PUBLIC_PATH: "https://s91588.cdn.ngenix.net" # Example value -
Modify your Ingress configuration to use the
S3_PUBLIC_PATHvariable. You can reference the values directly from yourvalues.yamlin your Ingress template. Here’s how you might rewrite the Ingress:ingresses: - host: '{{ if ne .Values.Branch "master" }}{{ .Values.Branch }}.{{ end }}affiliates.fe.cpa.dev.lan' ssl: enabled class: 'internal' additionalAnnotations: nginx.ingress.kubernetes.io/proxy-buffer-size: '32k' nginx.ingress.kubernetes.io/configuration-snippet: | more_set_headers "X-Frame-Options: SAMEORIGIN"; more_set_headers "Content-Security-Policy: frame-src 'self' {{ .Values.S3_PUBLIC_PATH }}; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' {{ .Values.S3_PUBLIC_PATH }} data:;"; paths: - / -
Deploy your Helm chart, ensuring
S3_PUBLIC_PATHis set correctly. You can do this by running:helm install your-release-name your-chart --set S3_PUBLIC_PATH="https://your-s3-url"
Note:
- The above example assumes you're using the Helm templating engine to deploy your Kubernetes resources, where you can pull values from a values file or command line.
- Remember that modifications might need to be adjusted depending on your overall chart structure.
- Ensure that
helmis installed and you are executing these commands in an environment where your Kubernetes context is correctly configured.
-