Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in example for GKE-Autopilot, closes #19 #270

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with how this project was set up -- do you know if this code is generated or was it written by hand?

If it's generated we probably want to create an issue somewhere (here? https://github.com/pulumi/pulumi-go-helmbase) to address the underlying bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe its hand coded, I think @joeduffy might be the only one that knows the real answer though.

// 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
Loading