Report this

What is the reason for this report?

How to enable TLS for openfaas 1 click app

Posted on September 22, 2021

Hi guys. I installed the OpenFAAS one click app from here: https://marketplace.digitalocean.com/apps/openfaas-kubernetes

I would now like to enable TLS and have followed the linked instructions here:

https://docs.openfaas.com/reference/ssl/kubernetes-with-cert-manager/#20-ssl-and-custom-domains-for-functions

This command fails:

helm upgrade openfaas \
    --namespace openfaas \
    --reuse-values \
    --values tls.yaml \
    openfaas/openfaas

With

Error: UPGRADE FAILED: "openfaas" has no deployed releases

It doesn’t look like the digital ocean one click installer has created a deployment or any releases. Can I modify this command to still use helm values file to create the ingress?

I realise I could make the ingress myself, but would prefer to stick to the official helm chart.

Failing that, how do I uninstall the one click app? And I can start again by using the helm chart instead.

Many thanks,

Gavin



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

The error message “openfaas” has no deployed releases suggests that there may not be an existing Helm release named “openfaas” in the specified namespace. This could be because the DigitalOcean One-Click installation doesn’t create a Helm release in the usual way.

If you want to enable TLS for your OpenFaaS installation and can’t use Helm to upgrade it directly, you can consider creating the Ingress resource manually. Here’s how you can do it:

  1. Check the DigitalOcean One-Click installation for existing Ingress resources. You can list the Ingress resources in your cluster using:
  1. kubectl get ingress -n openfaas
  1. If there’s an existing Ingress resource related to your OpenFaaS installation, you can edit it to include the TLS configuration as described in the OpenFaaS documentation you provided.

  2. If there are no Ingress resources, you can create one manually based on your requirements. Create a new YAML file, let’s call it custom-ingress.yaml, and add the Ingress configuration with TLS:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: openfaas-ingress
  namespace: openfaas
spec:
  rules:
  - host: your-custom-domain.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: gateway
            port:
              number: 8080
  tls:
  - hosts:
    - your-custom-domain.com
    secretName: your-tls-secret-name

Make sure to replace your-custom-domain.com with your actual custom domain and your-tls-secret-name with the name of your TLS secret.

  1. Apply the Ingress configuration:
  1. kubectl apply -f custom-ingress.yaml

This should create an Ingress resource that handles TLS for your custom domain.

If you decide to uninstall the DigitalOcean One-Click OpenFaaS installation and start fresh with the official Helm chart, you can do the following:

  1. Delete the existing resources:
kubectl delete -n openfaas -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
  1. Remove the Helm release:
  1. helm uninstall openfaas -n openfaas
  1. Now you can follow the official OpenFaaS Helm chart documentation to install OpenFaaS using Helm with the desired configurations, including enabling TLS.

Please note that the specific commands and configuration details may vary based on your setup, so ensure that you adapt them to your needs and requirements.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.