@ydkn/pulumi-components 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +14 -0
- package/.gitlab-ci.yml +72 -0
- package/.prettierrc +3 -0
- package/{index.d.ts → index.ts} +46 -2
- package/lib/avahi/deployment.ts +171 -0
- package/lib/avahi/{index.d.ts → index.ts} +1 -1
- package/lib/avahi/service.ts +118 -0
- package/lib/aws/accessKey.ts +40 -0
- package/lib/aws/bucket.ts +71 -0
- package/lib/aws/{index.d.ts → index.ts} +1 -1
- package/lib/blocky/assets/dashboard.json +1777 -0
- package/lib/blocky/deployment.ts +134 -0
- package/lib/blocky/{index.d.ts → index.ts} +1 -1
- package/lib/certManager/assets/dashboard.json +1188 -0
- package/lib/certManager/certificate.ts +168 -0
- package/lib/certManager/index.ts +39 -0
- package/lib/certManager/issuer.ts +141 -0
- package/lib/certManager/operator.ts +244 -0
- package/lib/common/componentResource.ts +78 -0
- package/lib/common/{index.d.ts → index.ts} +2 -1
- package/lib/common/types.ts +3 -0
- package/lib/cups/avahiService.ts +66 -0
- package/lib/cups/deployment.ts +199 -0
- package/lib/cups/index.ts +4 -0
- package/lib/devcontainer/assets/init.sh +44 -0
- package/lib/devcontainer/deployment.ts +253 -0
- package/lib/devcontainer/index.ts +3 -0
- package/lib/dhcpd/deployment.ts +164 -0
- package/lib/dhcpd/index.ts +3 -0
- package/lib/externalDns/dnsEndpoint.ts +70 -0
- package/lib/externalDns/index.ts +18 -0
- package/lib/externalDns/operator.ts +165 -0
- package/lib/fcos/assets/rpm-opstree-install.sh +0 -0
- package/lib/fcos/config.ts +237 -0
- package/lib/fcos/host.ts +91 -0
- package/lib/fcos/index.ts +27 -0
- package/lib/freeradius/deployment.ts +244 -0
- package/lib/freeradius/{index.d.ts → index.ts} +1 -1
- package/lib/gitlab/{index.d.ts → index.ts} +13 -2
- package/lib/gitlab/project.ts +148 -0
- package/lib/gitlab/renovate.ts +98 -0
- package/lib/gitlab/runners/cleanup.ts +104 -0
- package/lib/gitlab/runners/{index.d.ts → index.ts} +1 -1
- package/lib/gitlab/runners/runner.ts +122 -0
- package/lib/gitlab/runners/runners.ts +49 -0
- package/lib/grafana/agent.ts +449 -0
- package/lib/grafana/dashboard.ts +38 -0
- package/lib/grafana/datasource.ts +59 -0
- package/lib/grafana/deployment.ts +78 -0
- package/lib/grafana/index.ts +17 -0
- package/lib/hcloud/assets/fcos-install.sh +0 -0
- package/lib/hcloud/cluster.ts +533 -0
- package/lib/hcloud/{index.d.ts → index.ts} +1 -1
- package/lib/hcloud/kubernetes.ts +249 -0
- package/lib/hcloud/wireguard.ts +164 -0
- package/lib/k0s/cluster.ts +264 -0
- package/lib/k0s/{index.d.ts → index.ts} +1 -1
- package/lib/kubeStateMetrics/deployment.ts +60 -0
- package/lib/kubeStateMetrics/{index.d.ts → index.ts} +1 -1
- package/lib/kubernetes/helm/{index.d.ts → index.ts} +1 -1
- package/lib/kubernetes/helm/v3/chart.ts +79 -0
- package/lib/kubernetes/helm/v3/helpers.ts +32 -0
- package/lib/kubernetes/helm/v3/{index.d.ts → index.ts} +1 -1
- package/lib/kubernetes/helm/v3/release.ts +17 -0
- package/lib/kubernetes/{index.d.ts → index.ts} +1 -1
- package/lib/kubernetes/transformations/filter.ts +43 -0
- package/lib/kubernetes/transformations/{index.d.ts → index.ts} +1 -1
- package/lib/kubernetes/transformations/metadataNamespace.ts +25 -0
- package/lib/kubernetes/transformations/removeCrdDescriptions.ts +78 -0
- package/lib/kubernetes/transformations/v1beta1Deprecations.ts +60 -0
- package/lib/kubernetes/v1/{index.d.ts → index.ts} +12 -2
- package/lib/kubernetes/v1/nfsVolume.ts +145 -0
- package/lib/kubernetes/v1/pullSecret.ts +37 -0
- package/lib/kubernetes/v1/service.ts +58 -0
- package/lib/localPathProvisioner/deployment.ts +88 -0
- package/lib/localPathProvisioner/index.ts +3 -0
- package/lib/loki/deployment.ts +122 -0
- package/lib/loki/index.ts +3 -0
- package/lib/metallb/controller.ts +96 -0
- package/lib/metallb/{index.d.ts → index.ts} +11 -2
- package/lib/metallb/ipAddressPool.ts +33 -0
- package/lib/metallb/l2Advertisement.ts +34 -0
- package/lib/node/{index.d.ts → index.ts} +1 -1
- package/lib/node/kubernetes.ts +129 -0
- package/lib/node/node.ts +17 -0
- package/lib/openldap/deployment.ts +226 -0
- package/lib/openldap/{index.d.ts → index.ts} +1 -1
- package/lib/plex/{index.d.ts → index.ts} +1 -1
- package/lib/plex/mediaServer.ts +265 -0
- package/lib/plex/playlists.ts +123 -0
- package/lib/postgresql/cluster.ts +61 -0
- package/lib/postgresql/index.ts +4 -0
- package/lib/postgresql/operator.ts +70 -0
- package/lib/prometheus/index.ts +23 -0
- package/lib/prometheus/monitor.ts +13 -0
- package/lib/prometheus/operator.ts +264 -0
- package/lib/prometheus/podMonitor.ts +32 -0
- package/lib/prometheus/serviceMonitor.ts +43 -0
- package/lib/raspberrypi/cluster.ts +279 -0
- package/lib/raspberrypi/{index.d.ts → index.ts} +1 -1
- package/lib/rethinkdb/deployment.ts +424 -0
- package/lib/rethinkdb/{index.d.ts → index.ts} +1 -1
- package/lib/rook/assets/dashboard.json +4871 -0
- package/lib/rook/blockPool.ts +80 -0
- package/lib/rook/cluster.ts +168 -0
- package/lib/rook/filesystem.ts +140 -0
- package/lib/rook/{index.d.ts → index.ts} +15 -2
- package/lib/rook/operator.ts +175 -0
- package/lib/samba/avahiService.ts +44 -0
- package/lib/samba/deployment.ts +305 -0
- package/lib/samba/index.ts +5 -0
- package/lib/samba/volumes.ts +70 -0
- package/lib/ssh/exec.ts +162 -0
- package/lib/ssh/file.ts +165 -0
- package/lib/ssh/{index.d.ts → index.ts} +1 -1
- package/lib/ssh/types.ts +20 -0
- package/lib/torproxy/deployment.ts +165 -0
- package/lib/torproxy/{index.d.ts → index.ts} +1 -1
- package/lib/traefik/assets/dashboard.json +759 -0
- package/lib/traefik/controller.ts +207 -0
- package/lib/traefik/{index.d.ts → index.ts} +1 -1
- package/lib/traefik/middleware.ts +37 -0
- package/lib/traefik/secureIngress.ts +81 -0
- package/lib/ubuntu/assets/init.sh +0 -0
- package/lib/ubuntu/deployment.ts +275 -0
- package/lib/ubuntu/{index.d.ts → index.ts} +1 -1
- package/lib/unifi/controller.ts +234 -0
- package/lib/unifi/{index.d.ts → index.ts} +1 -1
- package/lib/velero/{index.d.ts → index.ts} +1 -1
- package/lib/velero/operator.ts +182 -0
- package/lib/wireguard/deployment.ts +168 -0
- package/lib/wireguard/{index.d.ts → index.ts} +1 -1
- package/package.json +62 -62
- package/renovate.json +4 -0
- package/tsconfig.json +21 -0
- package/index.d.ts.map +0 -1
- package/index.js +0 -64
- package/index.js.map +0 -1
- package/lib/avahi/deployment.d.ts +0 -36
- package/lib/avahi/deployment.d.ts.map +0 -1
- package/lib/avahi/deployment.js +0 -164
- package/lib/avahi/deployment.js.map +0 -1
- package/lib/avahi/index.d.ts.map +0 -1
- package/lib/avahi/index.js +0 -8
- package/lib/avahi/index.js.map +0 -1
- package/lib/avahi/service.d.ts +0 -51
- package/lib/avahi/service.d.ts.map +0 -1
- package/lib/avahi/service.js +0 -57
- package/lib/avahi/service.js.map +0 -1
- package/lib/aws/accessKey.d.ts +0 -22
- package/lib/aws/accessKey.d.ts.map +0 -1
- package/lib/aws/accessKey.js +0 -27
- package/lib/aws/accessKey.js.map +0 -1
- package/lib/aws/bucket.d.ts +0 -28
- package/lib/aws/bucket.d.ts.map +0 -1
- package/lib/aws/bucket.js +0 -49
- package/lib/aws/bucket.js.map +0 -1
- package/lib/aws/index.d.ts.map +0 -1
- package/lib/aws/index.js +0 -8
- package/lib/aws/index.js.map +0 -1
- package/lib/blocky/deployment.d.ts +0 -39
- package/lib/blocky/deployment.d.ts.map +0 -1
- package/lib/blocky/deployment.js +0 -97
- package/lib/blocky/deployment.js.map +0 -1
- package/lib/blocky/index.d.ts.map +0 -1
- package/lib/blocky/index.js +0 -6
- package/lib/blocky/index.js.map +0 -1
- package/lib/certManager/certificate.d.ts +0 -126
- package/lib/certManager/certificate.d.ts.map +0 -1
- package/lib/certManager/certificate.js +0 -42
- package/lib/certManager/certificate.js.map +0 -1
- package/lib/certManager/index.d.ts +0 -5
- package/lib/certManager/index.d.ts.map +0 -1
- package/lib/certManager/index.js +0 -11
- package/lib/certManager/index.js.map +0 -1
- package/lib/certManager/issuer.d.ts +0 -109
- package/lib/certManager/issuer.d.ts.map +0 -1
- package/lib/certManager/issuer.js +0 -39
- package/lib/certManager/issuer.js.map +0 -1
- package/lib/certManager/operator.d.ts +0 -43
- package/lib/certManager/operator.d.ts.map +0 -1
- package/lib/certManager/operator.js +0 -177
- package/lib/certManager/operator.js.map +0 -1
- package/lib/common/componentResource.d.ts +0 -20
- package/lib/common/componentResource.d.ts.map +0 -1
- package/lib/common/componentResource.js +0 -62
- package/lib/common/componentResource.js.map +0 -1
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -6
- package/lib/common/index.js.map +0 -1
- package/lib/common/types.d.ts +0 -3
- package/lib/common/types.d.ts.map +0 -1
- package/lib/common/types.js +0 -3
- package/lib/common/types.js.map +0 -1
- package/lib/externalDns/dnsEndpoint.d.ts +0 -66
- package/lib/externalDns/dnsEndpoint.d.ts.map +0 -1
- package/lib/externalDns/dnsEndpoint.js +0 -17
- package/lib/externalDns/dnsEndpoint.js.map +0 -1
- package/lib/externalDns/index.d.ts +0 -4
- package/lib/externalDns/index.d.ts.map +0 -1
- package/lib/externalDns/index.js +0 -8
- package/lib/externalDns/index.js.map +0 -1
- package/lib/externalDns/operator.d.ts +0 -45
- package/lib/externalDns/operator.d.ts.map +0 -1
- package/lib/externalDns/operator.js +0 -112
- package/lib/externalDns/operator.js.map +0 -1
- package/lib/fcos/config.d.ts +0 -156
- package/lib/fcos/config.d.ts.map +0 -1
- package/lib/fcos/config.js +0 -168
- package/lib/fcos/config.js.map +0 -1
- package/lib/fcos/host.d.ts +0 -34
- package/lib/fcos/host.d.ts.map +0 -1
- package/lib/fcos/host.js +0 -57
- package/lib/fcos/host.js.map +0 -1
- package/lib/fcos/index.d.ts +0 -4
- package/lib/fcos/index.d.ts.map +0 -1
- package/lib/fcos/index.js +0 -8
- package/lib/fcos/index.js.map +0 -1
- package/lib/freeradius/deployment.d.ts +0 -74
- package/lib/freeradius/deployment.d.ts.map +0 -1
- package/lib/freeradius/deployment.js +0 -216
- package/lib/freeradius/deployment.js.map +0 -1
- package/lib/freeradius/index.d.ts.map +0 -1
- package/lib/freeradius/index.js +0 -6
- package/lib/freeradius/index.js.map +0 -1
- package/lib/gitlab/index.d.ts.map +0 -1
- package/lib/gitlab/index.js +0 -12
- package/lib/gitlab/index.js.map +0 -1
- package/lib/gitlab/project.d.ts +0 -18
- package/lib/gitlab/project.d.ts.map +0 -1
- package/lib/gitlab/project.js +0 -116
- package/lib/gitlab/project.js.map +0 -1
- package/lib/gitlab/renovate.d.ts +0 -23
- package/lib/gitlab/renovate.d.ts.map +0 -1
- package/lib/gitlab/renovate.js +0 -77
- package/lib/gitlab/renovate.js.map +0 -1
- package/lib/gitlab/runners/cleanup.d.ts +0 -20
- package/lib/gitlab/runners/cleanup.d.ts.map +0 -1
- package/lib/gitlab/runners/cleanup.js +0 -86
- package/lib/gitlab/runners/cleanup.js.map +0 -1
- package/lib/gitlab/runners/index.d.ts.map +0 -1
- package/lib/gitlab/runners/index.js +0 -10
- package/lib/gitlab/runners/index.js.map +0 -1
- package/lib/gitlab/runners/runner.d.ts +0 -30
- package/lib/gitlab/runners/runner.d.ts.map +0 -1
- package/lib/gitlab/runners/runner.js +0 -89
- package/lib/gitlab/runners/runner.js.map +0 -1
- package/lib/gitlab/runners/runners.d.ts +0 -21
- package/lib/gitlab/runners/runners.d.ts.map +0 -1
- package/lib/gitlab/runners/runners.js +0 -36
- package/lib/gitlab/runners/runners.js.map +0 -1
- package/lib/grafana/agent.d.ts +0 -43
- package/lib/grafana/agent.d.ts.map +0 -1
- package/lib/grafana/agent.js +0 -417
- package/lib/grafana/agent.js.map +0 -1
- package/lib/grafana/index.d.ts +0 -3
- package/lib/grafana/index.d.ts.map +0 -1
- package/lib/grafana/index.js +0 -6
- package/lib/grafana/index.js.map +0 -1
- package/lib/hcloud/cluster.d.ts +0 -96
- package/lib/hcloud/cluster.d.ts.map +0 -1
- package/lib/hcloud/cluster.js +0 -323
- package/lib/hcloud/cluster.js.map +0 -1
- package/lib/hcloud/index.d.ts.map +0 -1
- package/lib/hcloud/index.js +0 -10
- package/lib/hcloud/index.js.map +0 -1
- package/lib/hcloud/kubernetes.d.ts +0 -39
- package/lib/hcloud/kubernetes.d.ts.map +0 -1
- package/lib/hcloud/kubernetes.js +0 -188
- package/lib/hcloud/kubernetes.js.map +0 -1
- package/lib/hcloud/wireguard.d.ts +0 -33
- package/lib/hcloud/wireguard.d.ts.map +0 -1
- package/lib/hcloud/wireguard.js +0 -103
- package/lib/hcloud/wireguard.js.map +0 -1
- package/lib/k0s/cluster.d.ts +0 -51
- package/lib/k0s/cluster.d.ts.map +0 -1
- package/lib/k0s/cluster.js +0 -183
- package/lib/k0s/cluster.js.map +0 -1
- package/lib/k0s/index.d.ts.map +0 -1
- package/lib/k0s/index.js +0 -6
- package/lib/k0s/index.js.map +0 -1
- package/lib/kubeStateMetrics/deployment.d.ts +0 -20
- package/lib/kubeStateMetrics/deployment.d.ts.map +0 -1
- package/lib/kubeStateMetrics/deployment.js +0 -47
- package/lib/kubeStateMetrics/deployment.js.map +0 -1
- package/lib/kubeStateMetrics/index.d.ts.map +0 -1
- package/lib/kubeStateMetrics/index.js +0 -6
- package/lib/kubeStateMetrics/index.js.map +0 -1
- package/lib/kubernetes/helm/index.d.ts.map +0 -1
- package/lib/kubernetes/helm/index.js +0 -6
- package/lib/kubernetes/helm/index.js.map +0 -1
- package/lib/kubernetes/helm/v3/chart.d.ts +0 -37
- package/lib/kubernetes/helm/v3/chart.d.ts.map +0 -1
- package/lib/kubernetes/helm/v3/chart.js +0 -46
- package/lib/kubernetes/helm/v3/chart.js.map +0 -1
- package/lib/kubernetes/helm/v3/helpers.d.ts +0 -3
- package/lib/kubernetes/helm/v3/helpers.d.ts.map +0 -1
- package/lib/kubernetes/helm/v3/helpers.js +0 -29
- package/lib/kubernetes/helm/v3/helpers.js.map +0 -1
- package/lib/kubernetes/helm/v3/index.d.ts.map +0 -1
- package/lib/kubernetes/helm/v3/index.js +0 -10
- package/lib/kubernetes/helm/v3/index.js.map +0 -1
- package/lib/kubernetes/helm/v3/release.d.ts +0 -15
- package/lib/kubernetes/helm/v3/release.d.ts.map +0 -1
- package/lib/kubernetes/helm/v3/release.js +0 -18
- package/lib/kubernetes/helm/v3/release.js.map +0 -1
- package/lib/kubernetes/index.d.ts.map +0 -1
- package/lib/kubernetes/index.js +0 -10
- package/lib/kubernetes/index.js.map +0 -1
- package/lib/kubernetes/transformations/filter.d.ts +0 -13
- package/lib/kubernetes/transformations/filter.d.ts.map +0 -1
- package/lib/kubernetes/transformations/filter.js +0 -32
- package/lib/kubernetes/transformations/filter.js.map +0 -1
- package/lib/kubernetes/transformations/index.d.ts.map +0 -1
- package/lib/kubernetes/transformations/index.js +0 -12
- package/lib/kubernetes/transformations/index.js.map +0 -1
- package/lib/kubernetes/transformations/metadataNamespace.d.ts +0 -3
- package/lib/kubernetes/transformations/metadataNamespace.d.ts.map +0 -1
- package/lib/kubernetes/transformations/metadataNamespace.js +0 -27
- package/lib/kubernetes/transformations/metadataNamespace.js.map +0 -1
- package/lib/kubernetes/transformations/removeCrdDescriptions.d.ts +0 -3
- package/lib/kubernetes/transformations/removeCrdDescriptions.d.ts.map +0 -1
- package/lib/kubernetes/transformations/removeCrdDescriptions.js +0 -61
- package/lib/kubernetes/transformations/removeCrdDescriptions.js.map +0 -1
- package/lib/kubernetes/transformations/v1beta1Deprecations.d.ts +0 -3
- package/lib/kubernetes/transformations/v1beta1Deprecations.d.ts.map +0 -1
- package/lib/kubernetes/transformations/v1beta1Deprecations.js +0 -55
- package/lib/kubernetes/transformations/v1beta1Deprecations.js.map +0 -1
- package/lib/kubernetes/v1/index.d.ts.map +0 -1
- package/lib/kubernetes/v1/index.js +0 -10
- package/lib/kubernetes/v1/index.js.map +0 -1
- package/lib/kubernetes/v1/nfsVolume.d.ts +0 -92
- package/lib/kubernetes/v1/nfsVolume.d.ts.map +0 -1
- package/lib/kubernetes/v1/nfsVolume.js +0 -97
- package/lib/kubernetes/v1/nfsVolume.js.map +0 -1
- package/lib/kubernetes/v1/pullSecret.d.ts +0 -31
- package/lib/kubernetes/v1/pullSecret.d.ts.map +0 -1
- package/lib/kubernetes/v1/pullSecret.js +0 -27
- package/lib/kubernetes/v1/pullSecret.js.map +0 -1
- package/lib/kubernetes/v1/service.d.ts +0 -31
- package/lib/kubernetes/v1/service.d.ts.map +0 -1
- package/lib/kubernetes/v1/service.js +0 -43
- package/lib/kubernetes/v1/service.js.map +0 -1
- package/lib/metallb/controller.d.ts +0 -17
- package/lib/metallb/controller.d.ts.map +0 -1
- package/lib/metallb/controller.js +0 -87
- package/lib/metallb/controller.js.map +0 -1
- package/lib/metallb/index.d.ts.map +0 -1
- package/lib/metallb/index.js +0 -10
- package/lib/metallb/index.js.map +0 -1
- package/lib/metallb/ipAddressPool.d.ts +0 -20
- package/lib/metallb/ipAddressPool.d.ts.map +0 -1
- package/lib/metallb/ipAddressPool.js +0 -22
- package/lib/metallb/ipAddressPool.js.map +0 -1
- package/lib/metallb/l2Advertisement.d.ts +0 -21
- package/lib/metallb/l2Advertisement.d.ts.map +0 -1
- package/lib/metallb/l2Advertisement.js +0 -22
- package/lib/metallb/l2Advertisement.js.map +0 -1
- package/lib/node/index.d.ts.map +0 -1
- package/lib/node/index.js +0 -6
- package/lib/node/index.js.map +0 -1
- package/lib/node/kubernetes.d.ts +0 -38
- package/lib/node/kubernetes.d.ts.map +0 -1
- package/lib/node/kubernetes.js +0 -89
- package/lib/node/kubernetes.js.map +0 -1
- package/lib/node/node.d.ts +0 -21
- package/lib/node/node.d.ts.map +0 -1
- package/lib/node/node.js +0 -3
- package/lib/node/node.js.map +0 -1
- package/lib/openldap/deployment.d.ts +0 -58
- package/lib/openldap/deployment.d.ts.map +0 -1
- package/lib/openldap/deployment.js +0 -217
- package/lib/openldap/deployment.js.map +0 -1
- package/lib/openldap/index.d.ts.map +0 -1
- package/lib/openldap/index.js +0 -6
- package/lib/openldap/index.js.map +0 -1
- package/lib/plex/index.d.ts.map +0 -1
- package/lib/plex/index.js +0 -8
- package/lib/plex/index.js.map +0 -1
- package/lib/plex/mediaServer.d.ts +0 -46
- package/lib/plex/mediaServer.d.ts.map +0 -1
- package/lib/plex/mediaServer.js +0 -234
- package/lib/plex/mediaServer.js.map +0 -1
- package/lib/plex/playlists.d.ts +0 -62
- package/lib/plex/playlists.d.ts.map +0 -1
- package/lib/plex/playlists.js +0 -129
- package/lib/plex/playlists.js.map +0 -1
- package/lib/prometheus/index.d.ts +0 -4
- package/lib/prometheus/index.d.ts.map +0 -1
- package/lib/prometheus/index.js +0 -8
- package/lib/prometheus/index.js.map +0 -1
- package/lib/prometheus/podMonitor.d.ts +0 -42
- package/lib/prometheus/podMonitor.d.ts.map +0 -1
- package/lib/prometheus/podMonitor.js +0 -17
- package/lib/prometheus/podMonitor.js.map +0 -1
- package/lib/prometheus/serviceMonitor.d.ts +0 -46
- package/lib/prometheus/serviceMonitor.d.ts.map +0 -1
- package/lib/prometheus/serviceMonitor.js +0 -17
- package/lib/prometheus/serviceMonitor.js.map +0 -1
- package/lib/raspberrypi/cluster.d.ts +0 -41
- package/lib/raspberrypi/cluster.d.ts.map +0 -1
- package/lib/raspberrypi/cluster.js +0 -194
- package/lib/raspberrypi/cluster.js.map +0 -1
- package/lib/raspberrypi/index.d.ts.map +0 -1
- package/lib/raspberrypi/index.js +0 -6
- package/lib/raspberrypi/index.js.map +0 -1
- package/lib/rethinkdb/deployment.d.ts +0 -61
- package/lib/rethinkdb/deployment.d.ts.map +0 -1
- package/lib/rethinkdb/deployment.js +0 -350
- package/lib/rethinkdb/deployment.js.map +0 -1
- package/lib/rethinkdb/index.d.ts.map +0 -1
- package/lib/rethinkdb/index.js +0 -6
- package/lib/rethinkdb/index.js.map +0 -1
- package/lib/rook/blockPool.d.ts +0 -28
- package/lib/rook/blockPool.d.ts.map +0 -1
- package/lib/rook/blockPool.js +0 -56
- package/lib/rook/blockPool.js.map +0 -1
- package/lib/rook/cluster.d.ts +0 -54
- package/lib/rook/cluster.d.ts.map +0 -1
- package/lib/rook/cluster.js +0 -100
- package/lib/rook/cluster.js.map +0 -1
- package/lib/rook/filesystem.d.ts +0 -29
- package/lib/rook/filesystem.d.ts.map +0 -1
- package/lib/rook/filesystem.js +0 -110
- package/lib/rook/filesystem.js.map +0 -1
- package/lib/rook/index.d.ts.map +0 -1
- package/lib/rook/index.js +0 -12
- package/lib/rook/index.js.map +0 -1
- package/lib/rook/operator.d.ts +0 -19
- package/lib/rook/operator.d.ts.map +0 -1
- package/lib/rook/operator.js +0 -162
- package/lib/rook/operator.js.map +0 -1
- package/lib/samba/deployment.d.ts +0 -79
- package/lib/samba/deployment.d.ts.map +0 -1
- package/lib/samba/deployment.js +0 -238
- package/lib/samba/deployment.js.map +0 -1
- package/lib/samba/index.d.ts +0 -3
- package/lib/samba/index.d.ts.map +0 -1
- package/lib/samba/index.js +0 -6
- package/lib/samba/index.js.map +0 -1
- package/lib/ssh/exec.d.ts +0 -33
- package/lib/ssh/exec.d.ts.map +0 -1
- package/lib/ssh/exec.js +0 -116
- package/lib/ssh/exec.js.map +0 -1
- package/lib/ssh/file.d.ts +0 -43
- package/lib/ssh/file.d.ts.map +0 -1
- package/lib/ssh/file.js +0 -110
- package/lib/ssh/file.js.map +0 -1
- package/lib/ssh/index.d.ts.map +0 -1
- package/lib/ssh/index.js +0 -8
- package/lib/ssh/index.js.map +0 -1
- package/lib/ssh/types.d.ts +0 -19
- package/lib/ssh/types.d.ts.map +0 -1
- package/lib/ssh/types.js +0 -3
- package/lib/ssh/types.js.map +0 -1
- package/lib/torproxy/deployment.d.ts +0 -31
- package/lib/torproxy/deployment.d.ts.map +0 -1
- package/lib/torproxy/deployment.js +0 -131
- package/lib/torproxy/deployment.js.map +0 -1
- package/lib/torproxy/index.d.ts.map +0 -1
- package/lib/torproxy/index.js +0 -6
- package/lib/torproxy/index.js.map +0 -1
- package/lib/traefik/controller.d.ts +0 -50
- package/lib/traefik/controller.d.ts.map +0 -1
- package/lib/traefik/controller.js +0 -166
- package/lib/traefik/controller.js.map +0 -1
- package/lib/traefik/index.d.ts.map +0 -1
- package/lib/traefik/index.js +0 -10
- package/lib/traefik/index.js.map +0 -1
- package/lib/traefik/middleware.d.ts +0 -27
- package/lib/traefik/middleware.d.ts.map +0 -1
- package/lib/traefik/middleware.js +0 -22
- package/lib/traefik/middleware.js.map +0 -1
- package/lib/traefik/secureIngress.d.ts +0 -32
- package/lib/traefik/secureIngress.d.ts.map +0 -1
- package/lib/traefik/secureIngress.js +0 -58
- package/lib/traefik/secureIngress.js.map +0 -1
- package/lib/ubuntu/deployment.d.ts +0 -67
- package/lib/ubuntu/deployment.d.ts.map +0 -1
- package/lib/ubuntu/deployment.js +0 -230
- package/lib/ubuntu/deployment.js.map +0 -1
- package/lib/ubuntu/index.d.ts.map +0 -1
- package/lib/ubuntu/index.js +0 -6
- package/lib/ubuntu/index.js.map +0 -1
- package/lib/unifi/controller.d.ts +0 -52
- package/lib/unifi/controller.d.ts.map +0 -1
- package/lib/unifi/controller.js +0 -232
- package/lib/unifi/controller.js.map +0 -1
- package/lib/unifi/index.d.ts.map +0 -1
- package/lib/unifi/index.js +0 -6
- package/lib/unifi/index.js.map +0 -1
- package/lib/velero/index.d.ts.map +0 -1
- package/lib/velero/index.js +0 -6
- package/lib/velero/index.js.map +0 -1
- package/lib/velero/operator.d.ts +0 -31
- package/lib/velero/operator.d.ts.map +0 -1
- package/lib/velero/operator.js +0 -148
- package/lib/velero/operator.js.map +0 -1
- package/lib/wireguard/deployment.d.ts +0 -82
- package/lib/wireguard/deployment.d.ts.map +0 -1
- package/lib/wireguard/deployment.js +0 -161
- package/lib/wireguard/deployment.js.map +0 -1
- package/lib/wireguard/index.d.ts.map +0 -1
- package/lib/wireguard/index.js +0 -6
- package/lib/wireguard/index.js.map +0 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as k8s from "@pulumi/kubernetes";
|
|
3
|
+
import * as crypto from "crypto";
|
|
4
|
+
import { ComponentResource } from "../common";
|
|
5
|
+
import * as kubernetes from "../kubernetes";
|
|
6
|
+
import { AvahiService } from "./avahiService";
|
|
7
|
+
|
|
8
|
+
export interface User {
|
|
9
|
+
name: string;
|
|
10
|
+
uid: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SambaArgs {
|
|
14
|
+
namespace?: pulumi.Input<string>;
|
|
15
|
+
serverName: pulumi.Input<string>;
|
|
16
|
+
workgroup: pulumi.Input<string>;
|
|
17
|
+
deviceModel: pulumi.Input<string>;
|
|
18
|
+
hostname: pulumi.Input<string>;
|
|
19
|
+
users: pulumi.Input<pulumi.Input<User>[]>;
|
|
20
|
+
volumes?: { [key: string]: pulumi.Input<string> };
|
|
21
|
+
serviceType?: pulumi.Input<string>;
|
|
22
|
+
avahiLabelName?: pulumi.Input<string>;
|
|
23
|
+
storageClassName?: pulumi.Input<string>;
|
|
24
|
+
protect?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class Samba extends ComponentResource {
|
|
28
|
+
private static readonly vetoFiles = [
|
|
29
|
+
".apdisk",
|
|
30
|
+
".DS_Store",
|
|
31
|
+
"._.DS_Store",
|
|
32
|
+
".TemporaryItems",
|
|
33
|
+
"._.TemporaryItems",
|
|
34
|
+
".Trashes",
|
|
35
|
+
"desktop.ini",
|
|
36
|
+
"ehthumbs.db",
|
|
37
|
+
"Network Trash Folder",
|
|
38
|
+
"Temporary Items",
|
|
39
|
+
"Thumbs.db",
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
private readonly settings: k8s.core.v1.ConfigMap;
|
|
43
|
+
private readonly dataVolumeClaim: k8s.core.v1.PersistentVolumeClaim;
|
|
44
|
+
private readonly deployment: k8s.apps.v1.Deployment;
|
|
45
|
+
private readonly podDisruptionBudget: k8s.policy.v1.PodDisruptionBudget;
|
|
46
|
+
private readonly service: k8s.core.v1.Service;
|
|
47
|
+
private readonly avahiService?: AvahiService;
|
|
48
|
+
public readonly namespace: pulumi.Output<string>;
|
|
49
|
+
public readonly hostname: pulumi.Output<string>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Create a new Samba resource.
|
|
53
|
+
* @param name The name of the Samba resource.
|
|
54
|
+
* @param args A bag of arguments to control the Samba creation.
|
|
55
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
56
|
+
*/
|
|
57
|
+
constructor(name: string, args: SambaArgs, opts?: pulumi.ComponentResourceOptions) {
|
|
58
|
+
super("samba", name, args, opts);
|
|
59
|
+
|
|
60
|
+
if (args.serviceType === undefined) {
|
|
61
|
+
args.serviceType = "LoadBalancer";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
opts = this.opts(k8s.Provider);
|
|
65
|
+
|
|
66
|
+
this.hostname = pulumi.output(args.hostname);
|
|
67
|
+
|
|
68
|
+
this.namespace = args.namespace
|
|
69
|
+
? pulumi.output(args.namespace)
|
|
70
|
+
: new k8s.core.v1.Namespace(name, { metadata: { name } }, opts).metadata.name;
|
|
71
|
+
|
|
72
|
+
const metadata = {
|
|
73
|
+
name,
|
|
74
|
+
namespace: this.namespace,
|
|
75
|
+
labels: {
|
|
76
|
+
"app.kubernetes.io/name": "samba",
|
|
77
|
+
"app.kubernetes.io/component": "samba",
|
|
78
|
+
"app.kubernetes.io/instance": name,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const sambaConfig = [
|
|
83
|
+
"[global]",
|
|
84
|
+
`workgroup = ${args.workgroup}`,
|
|
85
|
+
`server string = ${args.serverName}`,
|
|
86
|
+
`netbios name = ${args.serverName}`,
|
|
87
|
+
"server role = standalone server",
|
|
88
|
+
"log file = /dev/stdout",
|
|
89
|
+
"max log size = 50",
|
|
90
|
+
"dns proxy = no",
|
|
91
|
+
"map to guest = bad user",
|
|
92
|
+
"usershare allow guests = no",
|
|
93
|
+
"client ipc min protocol = SMB2",
|
|
94
|
+
"client ipc max protocol = SMB3",
|
|
95
|
+
"client min protocol = SMB2",
|
|
96
|
+
"client max protocol = SMB3",
|
|
97
|
+
"server min protocol = SMB2",
|
|
98
|
+
"server max protocol = SMB3",
|
|
99
|
+
"follow symlinks = yes",
|
|
100
|
+
"load printers = no",
|
|
101
|
+
"printing = bsd",
|
|
102
|
+
"printcap name = /dev/null",
|
|
103
|
+
"disable spoolss = yes",
|
|
104
|
+
"aio read size = 0",
|
|
105
|
+
"aio write size = 0",
|
|
106
|
+
"posix locking = no",
|
|
107
|
+
"strict locking = no",
|
|
108
|
+
"follow symlinks = yes",
|
|
109
|
+
"unix extensions = yes",
|
|
110
|
+
"wide links = no",
|
|
111
|
+
"mangled names = no",
|
|
112
|
+
"unix charset = UTF-8",
|
|
113
|
+
"acl allow execute always = yes",
|
|
114
|
+
"vfs objects = catia fruit",
|
|
115
|
+
"fruit:aapl = yes",
|
|
116
|
+
"fruit:delete_empty_adfiles = yes",
|
|
117
|
+
"fruit:time machine = yes",
|
|
118
|
+
"fruit:veto_appledouble = yes",
|
|
119
|
+
"fruit:wipe_intentionally_left_blank_rfork = yes",
|
|
120
|
+
`fruit:model = ${args.deviceModel}`,
|
|
121
|
+
"fruit:locking = none",
|
|
122
|
+
"ea support = no",
|
|
123
|
+
"kernel oplocks = no",
|
|
124
|
+
"oplocks = no",
|
|
125
|
+
"level2 oplocks = no",
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
const shareVolumes: any[] = [];
|
|
129
|
+
const shareVolumeMounts: any[] = [];
|
|
130
|
+
|
|
131
|
+
if (args.volumes !== undefined) {
|
|
132
|
+
for (const shareName in args.volumes) {
|
|
133
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
134
|
+
const volume = args.volumes[shareName];
|
|
135
|
+
|
|
136
|
+
const shasum = crypto.createHash("sha1");
|
|
137
|
+
shasum.update(shareName);
|
|
138
|
+
const volumeName = shasum.digest("hex");
|
|
139
|
+
|
|
140
|
+
shareVolumes.push(
|
|
141
|
+
pulumi.all([volume]).apply((o) => {
|
|
142
|
+
return { name: volumeName, persistentVolumeClaim: { claimName: o[0] } };
|
|
143
|
+
})
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const mountPath = `/shares/${volumeName}`;
|
|
147
|
+
|
|
148
|
+
shareVolumeMounts.push({ name: volumeName, mountPath });
|
|
149
|
+
|
|
150
|
+
sambaConfig.push(
|
|
151
|
+
`[${shareName}]`,
|
|
152
|
+
`comment = ${shareName}`,
|
|
153
|
+
`path = ${mountPath}`,
|
|
154
|
+
"browseable = yes",
|
|
155
|
+
"read only = no",
|
|
156
|
+
"guest ok = no",
|
|
157
|
+
`veto files = /${Samba.vetoFiles.join("/")}/`,
|
|
158
|
+
"delete veto files = yes"
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const containerArgs = pulumi.all([args.users]).apply((o) => {
|
|
164
|
+
const cmds = ["mkdir -p /var/lib/samba/private"];
|
|
165
|
+
|
|
166
|
+
for (const user of o[0]) {
|
|
167
|
+
cmds.push(`adduser -s /bin/false -D -u ${user.uid} "${user.name}"`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
cmds.push("/usr/bin/samba.sh -n");
|
|
171
|
+
|
|
172
|
+
return ["-c", cmds.join(" && ")];
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
this.settings = new k8s.core.v1.ConfigMap(
|
|
176
|
+
`${name}-config`,
|
|
177
|
+
{
|
|
178
|
+
metadata: { ...metadata, name: pulumi.interpolate`${name}-config` },
|
|
179
|
+
data: {
|
|
180
|
+
"smb.conf": sambaConfig.join("\n"),
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
opts
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
const dataVolumeClaimName = pulumi.interpolate`${name}-data`;
|
|
187
|
+
|
|
188
|
+
this.dataVolumeClaim = new k8s.core.v1.PersistentVolumeClaim(
|
|
189
|
+
`${name}-data`,
|
|
190
|
+
{
|
|
191
|
+
metadata: { ...metadata, name: dataVolumeClaimName },
|
|
192
|
+
spec: {
|
|
193
|
+
storageClassName: args.storageClassName,
|
|
194
|
+
accessModes: ["ReadWriteOnce"],
|
|
195
|
+
resources: { requests: { storage: "128Mi" } },
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{ ...opts, protect: args.protect }
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
this.deployment = new k8s.apps.v1.Deployment(
|
|
202
|
+
name,
|
|
203
|
+
{
|
|
204
|
+
metadata,
|
|
205
|
+
spec: {
|
|
206
|
+
selector: { matchLabels: metadata.labels },
|
|
207
|
+
strategy: { type: "Recreate" },
|
|
208
|
+
replicas: 1,
|
|
209
|
+
template: {
|
|
210
|
+
metadata: {
|
|
211
|
+
labels: metadata.labels,
|
|
212
|
+
annotations: { "backup.velero.io/backup-volumes": "data" },
|
|
213
|
+
},
|
|
214
|
+
spec: {
|
|
215
|
+
containers: [
|
|
216
|
+
{
|
|
217
|
+
name: "samba",
|
|
218
|
+
image: "dperson/samba:latest",
|
|
219
|
+
imagePullPolicy: "Always",
|
|
220
|
+
command: ["/bin/sh"],
|
|
221
|
+
args: containerArgs,
|
|
222
|
+
ports: [
|
|
223
|
+
{ containerPort: 137, protocol: "UDP", name: "netbios-ns" },
|
|
224
|
+
{ containerPort: 138, protocol: "UDP", name: "netbios-dgm" },
|
|
225
|
+
{ containerPort: 139, protocol: "TCP", name: "netbios-ssn" },
|
|
226
|
+
{ containerPort: 445, protocol: "TCP", name: "microsoft-ds" },
|
|
227
|
+
],
|
|
228
|
+
readinessProbe: {
|
|
229
|
+
exec: { command: ["smbclient", "-L", "\\\\localhost", "-U", "%", "-m", "SMB3"] },
|
|
230
|
+
periodSeconds: 20,
|
|
231
|
+
failureThreshold: 3,
|
|
232
|
+
successThreshold: 1,
|
|
233
|
+
timeoutSeconds: 10,
|
|
234
|
+
},
|
|
235
|
+
livenessProbe: {
|
|
236
|
+
exec: { command: ["smbclient", "-L", "\\\\localhost", "-U", "%", "-m", "SMB3"] },
|
|
237
|
+
periodSeconds: 20,
|
|
238
|
+
failureThreshold: 3,
|
|
239
|
+
successThreshold: 1,
|
|
240
|
+
timeoutSeconds: 10,
|
|
241
|
+
},
|
|
242
|
+
resources: {
|
|
243
|
+
requests: { memory: "256Mi" },
|
|
244
|
+
limits: { memory: "512Mi" },
|
|
245
|
+
},
|
|
246
|
+
volumeMounts: [
|
|
247
|
+
{ name: "config", mountPath: "/etc/samba" },
|
|
248
|
+
{ name: "data", mountPath: "/var/lib/samba" },
|
|
249
|
+
].concat(shareVolumeMounts),
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
volumes: [
|
|
253
|
+
{ name: "config", configMap: { name: this.settings.metadata.name } },
|
|
254
|
+
{ name: "data", persistentVolumeClaim: { claimName: dataVolumeClaimName } },
|
|
255
|
+
].concat(shareVolumes),
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
opts
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
this.podDisruptionBudget = new k8s.policy.v1.PodDisruptionBudget(
|
|
264
|
+
name,
|
|
265
|
+
{
|
|
266
|
+
metadata,
|
|
267
|
+
spec: {
|
|
268
|
+
minAvailable: 1,
|
|
269
|
+
selector: { matchLabels: metadata.labels },
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
opts
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
this.service = new kubernetes.v1.Service(
|
|
276
|
+
name,
|
|
277
|
+
{
|
|
278
|
+
metadata,
|
|
279
|
+
spec: {
|
|
280
|
+
type: args.serviceType,
|
|
281
|
+
selector: metadata.labels,
|
|
282
|
+
ports: [{ name: "microsoft-ds", protocol: "TCP", port: 445, targetPort: "microsoft-ds" }],
|
|
283
|
+
},
|
|
284
|
+
hostnames: [args.hostname],
|
|
285
|
+
},
|
|
286
|
+
{ ...opts, dependsOn: [this.deployment] }
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
if (args.avahiLabelName !== undefined) {
|
|
290
|
+
this.avahiService = new AvahiService(
|
|
291
|
+
name,
|
|
292
|
+
{
|
|
293
|
+
labelName: args.avahiLabelName,
|
|
294
|
+
metadata,
|
|
295
|
+
serverName: args.serverName,
|
|
296
|
+
hostname: args.hostname,
|
|
297
|
+
deviceModel: args.deviceModel,
|
|
298
|
+
},
|
|
299
|
+
opts
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
this.registerOutputs();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { User, SambaArgs, Samba } from "./deployment";
|
|
2
|
+
import { AvahiServiceArgs, AvahiService } from "./avahiService";
|
|
3
|
+
import { localPathVolumesFromConfig, nfsVolumesFromConfig } from "./volumes";
|
|
4
|
+
|
|
5
|
+
export { User, SambaArgs, Samba, AvahiServiceArgs, AvahiService, localPathVolumesFromConfig, nfsVolumesFromConfig };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as k8s from "@pulumi/kubernetes";
|
|
3
|
+
import * as kubernetes from "../kubernetes";
|
|
4
|
+
|
|
5
|
+
export interface Volumes {
|
|
6
|
+
[key: string]: pulumi.Output<string>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface LocalPathVolumesArgs {
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface LocalPathArgs {
|
|
14
|
+
metadata: pulumi.Input<k8s.types.input.meta.v1.ObjectMeta>;
|
|
15
|
+
volumes: { [key: string]: LocalPathVolumesArgs };
|
|
16
|
+
storageClassName?: pulumi.Input<string>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function localPathVolumesFromConfig(args: LocalPathArgs, opts?: pulumi.CustomResourceOptions): Volumes {
|
|
20
|
+
const volumes: Volumes = {};
|
|
21
|
+
|
|
22
|
+
for (const name in args.volumes) {
|
|
23
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
24
|
+
const config = args.volumes[name];
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line no-unused-vars
|
|
27
|
+
const pvc = new k8s.core.v1.PersistentVolumeClaim(
|
|
28
|
+
name,
|
|
29
|
+
{
|
|
30
|
+
metadata: { ...args.metadata, name },
|
|
31
|
+
spec: {
|
|
32
|
+
storageClassName: args.storageClassName ?? "local-path",
|
|
33
|
+
accessModes: ["ReadWriteOnce"],
|
|
34
|
+
resources: { requests: { storage: "1Gi" } },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
opts
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
volumes[config.name] = pulumi.output(name);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return volumes;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface NfsVolumeArgs extends kubernetes.v1.NfsVolumeConfig {
|
|
47
|
+
name: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface NfsArgs {
|
|
51
|
+
metadata: pulumi.Input<k8s.types.input.meta.v1.ObjectMeta>;
|
|
52
|
+
volumes: { [key: string]: NfsVolumeArgs };
|
|
53
|
+
storageClassName?: pulumi.Input<string>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function nfsVolumesFromConfig(args: NfsArgs, opts?: pulumi.CustomResourceOptions): Volumes {
|
|
57
|
+
const volumes: Volumes = {};
|
|
58
|
+
|
|
59
|
+
for (const name in args.volumes) {
|
|
60
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
61
|
+
const config = args.volumes[name];
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line no-unused-vars
|
|
64
|
+
const pvc = kubernetes.v1.NfsVolume.fromConfig(name, { metadata: { ...args.metadata, name }, config }, opts);
|
|
65
|
+
|
|
66
|
+
volumes[config.name] = pulumi.output(name);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return volumes;
|
|
70
|
+
}
|
package/lib/ssh/exec.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as ssh from "ssh2";
|
|
3
|
+
import { ConnectionArgs, ConnectionArgsInternal } from "./types";
|
|
4
|
+
|
|
5
|
+
interface ExecResult {
|
|
6
|
+
exitCode: number;
|
|
7
|
+
stdout: string;
|
|
8
|
+
stderr: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function sshCommand(connection: pulumi.Unwrap<ConnectionArgs>, cmd: string, finishDelay?: number): Promise<ExecResult> {
|
|
12
|
+
const connectionRetryFactor = connection.retryBackoffFactor || 1.2;
|
|
13
|
+
const initialDelay = connection.initialDelay || 0;
|
|
14
|
+
let connectionFailCount = connection.retries || 10;
|
|
15
|
+
let connectionRetryDelay = connection.retryIntialBackoff || 500;
|
|
16
|
+
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
const sshConnection = new ssh.Client();
|
|
19
|
+
|
|
20
|
+
function retryFunc() {
|
|
21
|
+
sshConnection
|
|
22
|
+
.on("ready", () => {
|
|
23
|
+
sshConnection.exec(cmd, (err, stream) => {
|
|
24
|
+
if (err) {
|
|
25
|
+
reject(err);
|
|
26
|
+
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let stdout = "";
|
|
31
|
+
let stderr = "";
|
|
32
|
+
|
|
33
|
+
stream
|
|
34
|
+
.on("close", (exitCode: number, signal: any) => {
|
|
35
|
+
sshConnection.end();
|
|
36
|
+
|
|
37
|
+
if (exitCode) {
|
|
38
|
+
reject(new Error("Command exited with " + exitCode));
|
|
39
|
+
} else {
|
|
40
|
+
setTimeout(function () {
|
|
41
|
+
resolve({ exitCode, stdout, stderr });
|
|
42
|
+
}, finishDelay || 0);
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
.on("data", (data: any) => {
|
|
46
|
+
stdout += data.toString("utf8");
|
|
47
|
+
})
|
|
48
|
+
.stderr.on("data", (data) => {
|
|
49
|
+
stderr += data.toString("utf8");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
})
|
|
53
|
+
.on("error", (err) => {
|
|
54
|
+
connectionFailCount--;
|
|
55
|
+
connectionRetryDelay *= connectionRetryFactor;
|
|
56
|
+
|
|
57
|
+
if (connectionFailCount < 0) {
|
|
58
|
+
reject(err);
|
|
59
|
+
} else {
|
|
60
|
+
setTimeout(retryFunc, Math.round(connectionRetryDelay));
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
.connect({
|
|
64
|
+
host: connection.host,
|
|
65
|
+
port: connection.port ?? 22,
|
|
66
|
+
username: connection.username,
|
|
67
|
+
password: connection.password,
|
|
68
|
+
privateKey: connection.privateKey,
|
|
69
|
+
passphrase: connection.privateKeyPassphrase,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
setTimeout(retryFunc, initialDelay);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface ExecArgs {
|
|
78
|
+
/**
|
|
79
|
+
* SSH connection details
|
|
80
|
+
*/
|
|
81
|
+
connection: pulumi.Input<ConnectionArgs>;
|
|
82
|
+
/**
|
|
83
|
+
* Command to run
|
|
84
|
+
*/
|
|
85
|
+
command: pulumi.Input<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Optional: Change token
|
|
88
|
+
*/
|
|
89
|
+
changeToken?: pulumi.Input<string>;
|
|
90
|
+
/**
|
|
91
|
+
* Optional: Finish delay
|
|
92
|
+
*/
|
|
93
|
+
finishDelay?: pulumi.Input<number>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface ProviderInputs {
|
|
97
|
+
connection: ConnectionArgsInternal;
|
|
98
|
+
command: string;
|
|
99
|
+
changeToken?: string;
|
|
100
|
+
finishDelay?: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export class Exec extends pulumi.dynamic.Resource {
|
|
104
|
+
public readonly exitCode!: pulumi.Output<number>;
|
|
105
|
+
public readonly stdout!: pulumi.Output<string>;
|
|
106
|
+
public readonly stderr!: pulumi.Output<string>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Create a new SSH exec resource.
|
|
110
|
+
* @param name The name of the SSH exec resource.
|
|
111
|
+
* @param args A bag of arguments to control the SSH exec creation.
|
|
112
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
113
|
+
*/
|
|
114
|
+
constructor(name: string, args: ExecArgs, opts?: pulumi.ComponentResourceOptions) {
|
|
115
|
+
const provider: pulumi.dynamic.ResourceProvider = {
|
|
116
|
+
async diff(id: pulumi.ID, olds: ProviderInputs, news: ProviderInputs): Promise<pulumi.dynamic.DiffResult> {
|
|
117
|
+
const replaces = [];
|
|
118
|
+
|
|
119
|
+
for (const [nKey, nValue] of Object.entries(news)) {
|
|
120
|
+
if (nKey === "__provider") {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let keyFound = false;
|
|
125
|
+
|
|
126
|
+
for (const [oKey, oValue] of Object.entries(olds)) {
|
|
127
|
+
if (oKey === "__provider") {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (nKey === oKey) {
|
|
132
|
+
keyFound = true;
|
|
133
|
+
|
|
134
|
+
if (JSON.stringify(nValue) !== JSON.stringify(oValue)) {
|
|
135
|
+
replaces.push(nKey);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (!keyFound) {
|
|
141
|
+
replaces.push(nKey);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return { changes: replaces.length > 0, replaces, deleteBeforeReplace: true };
|
|
146
|
+
},
|
|
147
|
+
async create(inputs: ProviderInputs): Promise<pulumi.dynamic.CreateResult> {
|
|
148
|
+
return sshCommand(inputs.connection, inputs.command, inputs.finishDelay).then((r) => {
|
|
149
|
+
return {
|
|
150
|
+
id: require("uuid").v4(),
|
|
151
|
+
outs:
|
|
152
|
+
r.exitCode === 0
|
|
153
|
+
? { exitCode: r.exitCode, stdout: "", stderr: "", ...inputs }
|
|
154
|
+
: { exitCode: r.exitCode, stdout: r.stdout, stderr: r.stderr, ...inputs },
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
super(provider, name, { exitCode: undefined, stdout: undefined, stderr: undefined, ...args }, opts);
|
|
161
|
+
}
|
|
162
|
+
}
|
package/lib/ssh/file.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as Sftp from "ssh2-sftp-client";
|
|
3
|
+
import * as crypto from "crypto";
|
|
4
|
+
import * as fs from "fs";
|
|
5
|
+
import { ConnectionArgs, ConnectionArgsInternal } from "./types";
|
|
6
|
+
|
|
7
|
+
function sshFileCreate(
|
|
8
|
+
connection: pulumi.Unwrap<ConnectionArgs>,
|
|
9
|
+
dst: string,
|
|
10
|
+
srcFile?: string,
|
|
11
|
+
srcData?: string | Buffer
|
|
12
|
+
): Promise<boolean> {
|
|
13
|
+
const connectionRetryFactor = connection.retryBackoffFactor || 1.2;
|
|
14
|
+
const initialDelay = connection.initialDelay || 0;
|
|
15
|
+
let connectionFailCount = connection.retries || 10;
|
|
16
|
+
let connectionRetryDelay = connection.retryIntialBackoff || 500;
|
|
17
|
+
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
function retryFunc() {
|
|
20
|
+
if (srcFile === undefined && srcData === undefined) {
|
|
21
|
+
reject(new Error("Must provide either srcFile or srcData"));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const client = new Sftp();
|
|
25
|
+
|
|
26
|
+
client
|
|
27
|
+
.connect({
|
|
28
|
+
host: connection.host,
|
|
29
|
+
port: connection.port ?? 22,
|
|
30
|
+
username: connection.username,
|
|
31
|
+
password: connection.password,
|
|
32
|
+
privateKey: connection.privateKey,
|
|
33
|
+
passphrase: connection.privateKeyPassphrase,
|
|
34
|
+
})
|
|
35
|
+
.then(() => {
|
|
36
|
+
if (srcFile !== undefined) {
|
|
37
|
+
return client.put(srcFile, dst);
|
|
38
|
+
} else {
|
|
39
|
+
if (srcData instanceof Buffer) {
|
|
40
|
+
return client.put(srcData, dst);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return client.put(Buffer.from(srcData as string), dst);
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.then(() => {
|
|
47
|
+
client.end();
|
|
48
|
+
|
|
49
|
+
resolve(true);
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
connectionFailCount--;
|
|
53
|
+
connectionRetryDelay *= connectionRetryFactor;
|
|
54
|
+
|
|
55
|
+
if (connectionFailCount < 0) {
|
|
56
|
+
reject(err);
|
|
57
|
+
} else {
|
|
58
|
+
setTimeout(retryFunc, Math.round(connectionRetryDelay));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setTimeout(retryFunc, initialDelay);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface FileSourceArgs {
|
|
68
|
+
/**
|
|
69
|
+
* Source file
|
|
70
|
+
*/
|
|
71
|
+
file?: pulumi.Input<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Source data
|
|
74
|
+
*/
|
|
75
|
+
data?: pulumi.Input<string | Buffer>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface FileArgs {
|
|
79
|
+
/**
|
|
80
|
+
* SSH connection details
|
|
81
|
+
*/
|
|
82
|
+
connection: pulumi.Input<ConnectionArgs>;
|
|
83
|
+
/**
|
|
84
|
+
* Source
|
|
85
|
+
*/
|
|
86
|
+
src: pulumi.Input<FileSourceArgs>;
|
|
87
|
+
/**
|
|
88
|
+
* Destination file
|
|
89
|
+
*/
|
|
90
|
+
dst: pulumi.Input<string>;
|
|
91
|
+
/**
|
|
92
|
+
* Optional: Change token
|
|
93
|
+
*/
|
|
94
|
+
changeToken?: pulumi.Input<string>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface ProviderInputs {
|
|
98
|
+
connection: ConnectionArgsInternal;
|
|
99
|
+
src: { file?: string; data?: string | Buffer };
|
|
100
|
+
dst: string;
|
|
101
|
+
changeToken?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export class File extends pulumi.dynamic.Resource {
|
|
105
|
+
/**
|
|
106
|
+
* Create a new SSH file resource.
|
|
107
|
+
* @param name The name of the SSH file resource.
|
|
108
|
+
* @param args A bag of arguments to control the SSH file creation.
|
|
109
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
110
|
+
*/
|
|
111
|
+
constructor(name: string, args: FileArgs, opts?: pulumi.ComponentResourceOptions) {
|
|
112
|
+
const provider: pulumi.dynamic.ResourceProvider = {
|
|
113
|
+
async diff(id: pulumi.ID, olds: ProviderInputs, news: ProviderInputs): Promise<pulumi.dynamic.DiffResult> {
|
|
114
|
+
const replaces = [];
|
|
115
|
+
|
|
116
|
+
for (const [nKey, nValue] of Object.entries(news)) {
|
|
117
|
+
if (nKey === "__provider") {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let keyFound = false;
|
|
122
|
+
|
|
123
|
+
for (const [oKey, oValue] of Object.entries(olds)) {
|
|
124
|
+
if (oKey === "__provider") {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (nKey === oKey) {
|
|
129
|
+
keyFound = true;
|
|
130
|
+
|
|
131
|
+
if (JSON.stringify(nValue) !== JSON.stringify(oValue)) {
|
|
132
|
+
replaces.push(nKey);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!keyFound) {
|
|
138
|
+
replaces.push(nKey);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return { changes: replaces.length > 0, replaces, deleteBeforeReplace: true };
|
|
143
|
+
},
|
|
144
|
+
async create(inputs: ProviderInputs): Promise<pulumi.dynamic.CreateResult> {
|
|
145
|
+
return sshFileCreate(inputs.connection, inputs.dst, inputs.src.file, inputs.src.data).then((r) => {
|
|
146
|
+
return {
|
|
147
|
+
id: require("uuid").v4(),
|
|
148
|
+
outs: inputs,
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
super(provider, name, args, opts);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public static changeToken(str: string): string {
|
|
158
|
+
return crypto.createHash("sha1").update(str, "utf8").digest("hex");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public static fileChangeToken(filename: string): string {
|
|
162
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
163
|
+
return this.changeToken(fs.readFileSync(filename, "utf-8"));
|
|
164
|
+
}
|
|
165
|
+
}
|