Skip to content

Commit

Permalink
Adding in example for GKE-Autopilot, closes #19 (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
rshade authored Dec 23, 2024
1 parent 46b6883 commit 88ade76
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ nuget/

ci-scripts/
*.tar.gz
**/*.out

sdk/dotnet/version.txt
sdk/java/.gradle
Expand Down
3 changes: 3 additions & 0 deletions examples/gke-auto-pilot-cert-manager-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin/
/node_modules/
Pulumi.*.yaml
3 changes: 3 additions & 0 deletions examples/gke-auto-pilot-cert-manager-ts/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: gke-auto-pilot-cert-manager
runtime: nodejs
description: A CertManager installation for GKE AutoPilot
45 changes: 45 additions & 0 deletions examples/gke-auto-pilot-cert-manager-ts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import * as k8s from "@pulumi/kubernetes";
import * as certmanager from "@pulumi/kubernetes-cert-manager";

// Create a sandbox namespace.
const ns = new k8s.core.v1.Namespace("gke-ap-cert-mgr");

// Install a cert manager into our cluster.
const manager = new certmanager.CertManager("cert-manager", {
installCRDs: true,
helmOptions: {
namespace: ns.metadata.name,
version: "v1.15.3"
},
global: {
leaderElection: {
namespace: ns.metadata.name,
}
},
prometheus: {
enabled: false,
}
});

// 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.
const issuer = new k8s.apiextensions.CustomResource(
"issuer",
{
apiVersion: "cert-manager.io/v1",
kind: "Issuer",
metadata: {
name: "selfsigned-issuer",
namespace: ns.metadata.name,
},
spec: {
selfSigned: {},
},
},
{ dependsOn: manager }
);

export const certManagerStatus = manager.status;
11 changes: 11 additions & 0 deletions examples/gke-auto-pilot-cert-manager-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "gke-auto-pilot",
"devDependencies": {
"@types/node": "^10.0.0"
},
"dependencies": {
"@pulumi/kubernetes": "4.19.0",
"@pulumi/pulumi": "3.143.0",
"@pulumi/kubernetes-cert-manager": "latest"
}
}
18 changes: 18 additions & 0 deletions examples/gke-auto-pilot-cert-manager-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.ts"
]
}
2 changes: 1 addition & 1 deletion examples/simple-cert-manager-py/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pulumi>=3.0.0,<4.0.0
pulumi-kubernetes>=3.0.0,<5.0.0
pulumi-kubernetes>=4.0.0,<5.0.0
pulumi-kubernetes-cert-manager
4 changes: 2 additions & 2 deletions examples/simple-cert-manager-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@types/node": "^10.0.0"
},
"dependencies": {
"@pulumi/pulumi": "^3.0.0",
"@pulumi/kubernetes": "^3.0.0",
"@pulumi/kubernetes": "4.19.0",
"@pulumi/pulumi": "3.143.0",
"@pulumi/kubernetes-cert-manager": "latest"
}
}
2 changes: 1 addition & 1 deletion provider/pkg/provider/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type CertManagerGlobalPodSecurityPolicy struct {

type CertManagerGlobalLeaderElection struct {
// Override the namespace used to store the ConfigMap for leader election.
Namespace *string `pulumi:"namespace"`
Namespace pulumi.StringPtrInput `pulumi:"namespace"`
// The duration that non-leader candidates will wait after observing a
// leadership renewal until attempting to acquire leadership of a led but
// unrenewed leader slot. This is effectively the maximum duration that a
Expand Down

0 comments on commit 88ade76

Please sign in to comment.