-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Python variant of the CertManager example
- Loading branch information
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.pyc | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters