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

fix cron connector for no auth #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nitishkumar71
Copy link
Member

Signed-off-by: Nitishkumar Singh [email protected]

Fix cron connector to work without basic auth

Description

Fix cron connector to work without basic auth

Motivation and Context

  • I have raised an issue to propose this change (required)
  • My issue has received approval from the maintainers or lead with the design/approved label

Closes #22

How Has This Been Tested?

Build docker image in local

docker build .
docker tag 7ac5265766e0 ghcr.io/openfaas/cron-connector:local

Test with basic_auth=false

  1. Create Cluster and deploy openfaas
kind create cluster --name faas
arkade install openfaas --basic-auth=false
  1. Load local image and deploy cron-connector
kind load docker-image ghcr.io/openfaas/cron-connector:local --name faas
arkade install cron-connector --set basicAuth=false --set image=ghcr.io/openfaas/cron-connector:local
  1. Deploy function and check logs
faas-cli store deploy sleep --annotation topic=cron-function --annotation schedule="*/1 * * * *"
2022/09/02 15:16:13 Version: 53b0fc79837b153e8b1bb5117b88f311c5d70274    Commit: dev                                                                                                                            
2022/09/02 15:16:13 Gateway URL: http://gateway.openfaas:8080                                                                                                                                                   
2022/09/02 15:16:13 Async Invocation: false                                                                                                                                                                     
2022/09/02 15:16:13 Rebuild interval: 10s    Rebuild timeout: 5s                                                                                                                                                
2022/09/02 15:19:23 Added: sleep.openfaas-fn [*/1 * * * *]
  1. Destroy cluster
kind delete cluster --name faas

Test with basic_auth=true

  1. Create Cluster and deploy openfaas
kind create cluster --name faas
arkade install openfaas
kubectl port-forward -n openfaas svc/gateway 8080:8080 &
PASSWORD=$(kubectl get secret -n openfaas basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 --decode; echo)
echo -n $PASSWORD | faas-cli login --username admin --password-stdin
  1. Load local image and deploy cron-connector
kind load docker-image ghcr.io/openfaas/cron-connector:local --name faas
arkade install cron-connector --set image=ghcr.io/openfaas/cron-connector:local
  1. Deploy function and check logs
faas-cli store deploy sleep --annotation topic=cron-function --annotation schedule="*/1 * * * *"
2022/09/02 15:28:59 Version: 53b0fc79837b153e8b1bb5117b88f311c5d70274    Commit: dev                                                                                                                            
2022/09/02 15:28:59 Gateway URL: http://gateway.openfaas:8080                                                                                                                                                   
2022/09/02 15:28:59 Async Invocation: false                                                                                                                                                                     
2022/09/02 15:28:59 Rebuild interval: 30s    Rebuild timeout: 5s                                                                                                                                                
2022/09/02 15:30:59 Added: sleep.openfaas-fn [*/1 * * * *]                                                                                                                                                      
2022/09/02 15:31:00 Invoking: sleep.openfaas-fn [*/1 * * * *]                                                                                                                                                   
2022/09/02 15:31:02 Response: sleep [200] (2.01s)
  1. Destroy cluster
kind delete cluster --name faas

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Nitishkumar Singh <[email protected]>
@derek derek bot added the new-contributor label Sep 2, 2022
@arnediekmann
Copy link

Is this PR ready to be merged and released - or is something still missing? We are currently with issue #22 and don't want to turn on basic auth in local development environments. Best regards 🙂

@nitishkumar71
Copy link
Member Author

This is ready. @alexellis

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Approved

@alexellis
Copy link
Member

alexellis commented Oct 13, 2022

@arnediekmann why don't you want to turn on basic authentication?

It's a terrible idea to run without it.

Also, who are you and your team? We don't seem to know you?

https://github.com/openfaas/faas/blob/master/ADOPTERS.md

@arnediekmann
Copy link

Thanks, @alexellis and @nitishkumar71!

@alexellis We are solely using OpenFAAS without authentication in local development environments where we just bind to 127.0.0.1 for convenience.

Since I work for a digital agency which provides services for other, larger corporations, it would make most sense to add those and their use cases to the adopters list - I will ask the project representatives if they are fine with that 🙂

@alexellis
Copy link
Member

Since I work for a digital agency which provides services for other, larger corporations, it would make most sense to add those and their use cases to the adopters list - I will ask the project representatives if they are fine with that 🙂

Let's start with getting your agency written up, and we can consider this PR again.

If our work on OpenFaaS is deriving value for your business, can you bring up a GitHub sponsorship with your manager too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cron Connector stuck in crash loop when installing
3 participants