Skip to content

Commit

Permalink
Add a Python variant of the CertManager example
Browse files Browse the repository at this point in the history
  • Loading branch information
joeduffy committed Oct 17, 2021
1 parent 43d1577 commit bee5c3c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/simple-cert-manager-py/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
venv/
6 changes: 6 additions & 0 deletions examples/simple-cert-manager-py/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: simple-cert-manager-py
runtime:
name: python
options:
virtualenv: venv
description: A simple Kubernetes CertManager installation
35 changes: 35 additions & 0 deletions examples/simple-cert-manager-py/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import pulumi
from pulumi_kubernetes.apiextensions import CustomResource
from pulumi_kubernetes.core.v1 import Namespace, NamespaceArgs
from pulumi_kubernetes_cert_manager import CertManager, ReleaseArgs

# Create a sandbox namespace.
ns_name = 'sandbox'
ns = Namespace('sandbox-ns', metadata={ 'name': ns_name })

# Install a cert manager into our cluster.
manager = CertManager('cert-manager',
install_crds=True,
helm_options=ReleaseArgs(
namespace=ns_name,
),
)

# Create a cluster issuer that uses self-signed certificates.
# This is not very secure, but has the least amount of external
# dependencies, so is simple. Please refer to
# https://cert-manager.io/docs/configuration/selfsigned/
# for additional details on other signing providers.
issuer = CustomResource('issuer',
api_version='cert-manager.io/v1',
kind='Issuer',
metadata={
'name': 'selfsigned-issuer',
'namespace': ns_name,
},
spec={
'selfSigned': {},
},
)

pulumi.export('cert_manager_status', manager.status)
2 changes: 2 additions & 0 deletions examples/simple-cert-manager-py/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pulumi>=3.0.0,<4.0.0
pulumi-kubernetes>=3.0.0,<4.0.0
2 changes: 1 addition & 1 deletion examples/simple-cert-manager-ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ns = new k8s.core.v1.Namespace("sandbox-ns", {
metadata: { name: nsName },
});

// Set up a cert manager namespace and deploy into it.
// Install a cert manager into our cluster.
const manager = new certmanager.CertManager("cert-manager", {
installCRDs: true,
helmOptions: {
Expand Down

0 comments on commit bee5c3c

Please sign in to comment.