Skip to content

Commit

Permalink
Adding in example for GKE-Autopilot, closes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
rshade committed Dec 20, 2024
1 parent 3a4979e commit 4ff4356
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 3 deletions.
3 changes: 3 additions & 0 deletions examples/gke-auto-pilot-cert-manager/.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/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/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/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/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"
}
}

0 comments on commit 4ff4356

Please sign in to comment.