Skip to content

Add blog post: Automate OpenFaaS from Python with the new SDK#360

Open
welteki wants to merge 1 commit intoopenfaas:masterfrom
welteki:python-sdk
Open

Add blog post: Automate OpenFaaS from Python with the new SDK#360
welteki wants to merge 1 commit intoopenfaas:masterfrom
welteki:python-sdk

Conversation

@welteki
Copy link
Copy Markdown
Member

@welteki welteki commented Apr 24, 2026

Description

Announce the OpenFaaS Python SDK, a new client library that provides typed access to the full OpenFaaS REST API from Python.

Motivation and Context

The Python SDK has been released and needs an announcement post covering its features and usage.

Have you applied the editorial and style guide to your post?

Yes

How have you tested the instructions for any tutorial steps?

Code examples verified against the SDK source.

Types of changes

  • New blog post
  • Updating an existing blog post
  • Updating part of an existing page
  • Adding a new page

Checklist:

  • I have given attribution for any images I have used and have permission to use them under Copyright law
  • My code follows the writing-style of the publication and I have checked this
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

@reviewfn

This comment has been minimized.

@reviewfn

This comment has been minimized.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
@reviewfn
Copy link
Copy Markdown

reviewfn Bot commented Apr 24, 2026

AI Pull Request Overview

Summary

  • Adds a comprehensive blog post announcing the new OpenFaaS Python SDK
  • Covers installation, authentication, functions lifecycle, invocations, namespaces, secrets, logs, and Function Builder
  • Includes detailed code examples with Pydantic models and error handling
  • Demonstrates both basic auth and IAM-based authentication with token sources
  • Shows practical usage patterns for automation and CI/CD integration
  • Explains zero-trust security model with OpenFaaS IAM
  • Provides examples of synchronous and asynchronous function invocations
  • Includes build context assembly and container image building workflows

Approval rating (1-10)

8 - Well-structured technical content with accurate examples, minor concerns around secret handling in demos.

Summary per file

Summary per file
File path Summary
_posts/2026-04-24-python-sdk.md New blog post introducing OpenFaaS Python SDK with comprehensive examples and API coverage

Overall Assessment

The blog post provides a thorough introduction to the OpenFaaS Python SDK, covering all major API surfaces with practical examples. The content is technically accurate and well-structured for both beginners and experienced users. Code examples demonstrate proper error handling and authentication patterns. Minor improvements could be made to secret handling in examples to avoid potential confusion about production usage.

Detailed Review

Detailed Review

Code Examples Review

Authentication Examples:

  • BasicAuth example correctly demonstrates credential usage and file-based password reading
  • TokenAuth with ClientCredentialsTokenSource properly shows OAuth2 client credentials flow
  • ServiceAccountTokenSource reference is appropriate for Kubernetes workloads
  • Token caching and refresh behavior is correctly described

Function Operations:

  • FunctionDeployment model usage is correct with proper namespace and image specification
  • Autoscaling labels example matches OpenFaaS scaling annotations
  • Polling loop for function readiness is a reasonable pattern, though could benefit from timeout
  • Function invocation examples properly distinguish sync vs async patterns

Secret Management:

  • Secret creation/update examples correctly show write-only nature
  • Namespace-scoped operations are properly demonstrated
  • No exposure of secret values in examples, which is good

Function Builder:

  • Build context assembly follows correct workflow: template + handler → tar → API
  • HMAC secret retrieval via kubectl is accurate for OpenFaaS Pro deployments
  • Build streaming vs blocking approaches are well explained
  • Platform specification and image naming conventions are correct

Security Considerations

Potential Issues:

  • In the basic auth example, password is read from file and stripped, but no mention of trimming whitespace security implications
  • HMAC secret is read from mounted secret file, which is appropriate, but the kubectl command exposes the secret value in shell history
  • While examples don't expose secrets inappropriately, the kubectl command could be improved to avoid logging

Recommendations:

  • Add note about securely handling HMAC secrets without exposing in logs
  • Consider mentioning that password files should be properly secured with appropriate permissions
  • The secret value "s3cr3t" in example is obviously placeholder, but ensure this is clear

Technical Accuracy

API Coverage:

  • All major API endpoints are covered: functions, namespaces, secrets, logs, builder
  • Pydantic v2 usage is correctly described for type safety
  • IAM integration examples are comprehensive and accurate
  • Error handling patterns are properly demonstrated with specific exception types

Kubernetes/OpenFaaS Specifics:

  • Namespace mapping to Kubernetes namespaces is correctly explained
  • Service account token usage for in-cluster auth is appropriate
  • Function Builder API workflow matches documented behavior

Minor Suggestions

  • The polling example for function readiness could include a maximum retry limit to prevent infinite loops
  • Error handling section could mention more specific HTTP status codes that might be returned
  • Build context cleanup (removing temporary directories) could be mentioned for production scripts

Overall, this is a high-quality technical blog post that accurately represents the OpenFaaS Python SDK capabilities and provides valuable guidance for developers.

AI agent details.

Agent processing time: 33.523s
Environment preparation time: 6.12s
Total time from webhook: 54.251s

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.

1 participant