refactor code
Deploy Proxmox Infra / Pulumi Preview (pull_request) Successful in 1m20s
Deploy Proxmox Infra / Pulumi Deploy (pull_request) Has been skipped
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 48s
Deploy k8s Infra / Pulumi Deploy (pull_request) Has been skipped
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 42s
Deploy k8s Apps / Pulumi Deploy (pull_request) Has been skipped
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 49s
Deploy Monitoring / Pulumi Deploy (pull_request) Has been skipped
Deploy Proxmox Infra / Pulumi Preview (pull_request) Successful in 1m20s
Deploy Proxmox Infra / Pulumi Deploy (pull_request) Has been skipped
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 48s
Deploy k8s Infra / Pulumi Deploy (pull_request) Has been skipped
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 42s
Deploy k8s Apps / Pulumi Deploy (pull_request) Has been skipped
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 49s
Deploy Monitoring / Pulumi Deploy (pull_request) Has been skipped
This commit is contained in:
@@ -26,7 +26,7 @@ CI installs the `helm` CLI (`azure/setup-helm`) before running Pulumi.
|
||||
| kube-vip-cloud-provider | Allocates LoadBalancer IPs from a single-address pool (`kubeVipAddress`) — k3s's built-in ServiceLB is not used |
|
||||
| `traefik` ServicePatch | Pins Traefik's LoadBalancer IP to `kubeVipAddress` |
|
||||
|
||||
**Export**: `storageClass = "truenas-nfs"`.
|
||||
**Export**: `nfsStorageClass = "truenas-nfs"`.
|
||||
|
||||
## Required Pulumi config
|
||||
|
||||
|
||||
+13
-5
@@ -8,10 +8,14 @@ const bootstrapRef = new pulumi.StackReference(
|
||||
);
|
||||
|
||||
const kubeconfig = bootstrapRef.requireOutput("kubeconfig");
|
||||
|
||||
export const nfsStorageClass = "truenas-nfs";
|
||||
const truenasHost = config.requireSecret("truenasHost");
|
||||
const truenasNfsPath = config.requireSecret("truenasNfsPath");
|
||||
|
||||
const cloudflareToken = config.requireSecret("cloudflareApiToken");
|
||||
const letsencryptEmail = config.requireSecret("letsencryptEmail");
|
||||
|
||||
const kubeVipAddress = config.requireSecret("kubeVipAddress");
|
||||
const kubeVipInterface = config.require("kubeVipInterface");
|
||||
|
||||
@@ -41,9 +45,9 @@ const nfsCsiDriver = new k8s.helm.v3.Release(
|
||||
);
|
||||
|
||||
new k8s.storage.v1.StorageClass(
|
||||
"truenas-nfs",
|
||||
nfsStorageClass,
|
||||
{
|
||||
metadata: { name: "truenas-nfs" },
|
||||
metadata: { name: nfsStorageClass },
|
||||
provisioner: "nfs.csi.k8s.io",
|
||||
parameters: {
|
||||
server: truenasHost,
|
||||
@@ -321,6 +325,11 @@ const cloudProviderClusterRoleBinding = new k8s.rbac.v1.ClusterRoleBinding(
|
||||
opts(),
|
||||
);
|
||||
|
||||
const kubeVipCloudProviderLabels = {
|
||||
app: "kube-vip",
|
||||
component: "kube-vip-cloud-provider",
|
||||
};
|
||||
|
||||
// IP pool the cloud-provider allocates from — scoped to exactly the one VIP we
|
||||
// want, so it can never hand the address to some other LoadBalancer Service.
|
||||
const kubeVipPool = new k8s.core.v1.ConfigMap(
|
||||
@@ -339,11 +348,11 @@ const kubeVipCloudProvider = new k8s.apps.v1.Deployment(
|
||||
spec: {
|
||||
replicas: 1,
|
||||
selector: {
|
||||
matchLabels: { app: "kube-vip", component: "kube-vip-cloud-provider" },
|
||||
matchLabels: kubeVipCloudProviderLabels,
|
||||
},
|
||||
template: {
|
||||
metadata: {
|
||||
labels: { app: "kube-vip", component: "kube-vip-cloud-provider" },
|
||||
labels: kubeVipCloudProviderLabels,
|
||||
},
|
||||
spec: {
|
||||
serviceAccountName: cloudProviderServiceAccount.metadata.name,
|
||||
@@ -379,4 +388,3 @@ new k8s.core.v1.ServicePatch(
|
||||
opts({ dependsOn: [kubeVip, kubeVipCloudProvider] }),
|
||||
);
|
||||
|
||||
export const storageClass = "truenas-nfs";
|
||||
|
||||
Reference in New Issue
Block a user