Skip to content

Commit

Permalink
feat: sftpgo workload identity + fix sftpgo ui + add loadbalancer for…
Browse files Browse the repository at this point in the history
… TCP services (#572)

* fix: fix sftpgo gcp depeendency

* fix: fix sftpgo ingress + added optional service to access tcp services through a domain

* feat(wip): add sftpgo workload identity

* feat: add variables to register roles for sftpgo workload identity sa

* fix: fix serviceAccount annotation

* feat: bump sftpgo helm chart version
  • Loading branch information
walkoss authored Mar 24, 2023
1 parent e2850a9 commit 7dd169a
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 50 deletions.
2 changes: 1 addition & 1 deletion sftpgo/helm/sftpgo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sftpgo
description: helm chart for sftpgo
type: application
version: 0.1.0
version: 0.1.1
icon: https://raw.githubusercontent.com/drakkan/sftpgo/main/img/logo.png
appVersion: 2.4.3
dependencies:
Expand Down
6 changes: 6 additions & 0 deletions sftpgo/helm/sftpgo/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ spec:
name: kube
repo: sftpgo
version: '>= 0.1.0'
optional: true
- type: terraform
name: gcp
repo: sftpgo
version: '>= 0.1.0'
optional: true
25 changes: 23 additions & 2 deletions sftpgo/helm/sftpgo/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@ sftpgo:
hosts:
- host: {{ .Values.hostname }}
paths:
- path: '/.*'
- path: '/'
pathType: ImplementationSpecific
tls:
- secretName: sftpgo-tls
hosts:
- {{ .Values.hostname }}
- {{ .Values.hostname }}
{{ if .Values.loadBalancerHostname }}
service:
type: LoadBalancer
annotations:
external-dns.alpha.kubernetes.io/hostname: {{ .Values.loadBalancerHostname }}
{{ if eq .Provider "aws" }}
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
service.beta.kubernetes.io/aws-load-balancer-type: external
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
{{ end }}
{{ end }}
{{ if eq .Provider "google" }}
serviceAccount:
annotations:
iam.gke.io/gcp-service-account: {{ importValue "Terraform" "gcp_sa_workload_identity_email" }}

{{ end }}
24 changes: 14 additions & 10 deletions sftpgo/plural/recipes/sftpgo-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ dependencies:
- repo: ingress-nginx
name: ingress-nginx-aws
sections:
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
- name: loadBalancerHostname
documentation: a dns name to access the enabled services (sftp on port 22, etc.)
type: DOMAIN
optional: true
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
24 changes: 14 additions & 10 deletions sftpgo/plural/recipes/sftpgo-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ dependencies:
- repo: ingress-nginx
name: ingress-nginx-azure
sections:
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
- name: loadBalancerHostname
documentation: a dns name to access the enabled services (sftp on port 22, etc.)
type: DOMAIN
optional: true
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
24 changes: 14 additions & 10 deletions sftpgo/plural/recipes/sftpgo-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ dependencies:
- repo: ingress-nginx
name: ingress-nginx-gcp
sections:
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
- name: loadBalancerHostname
documentation: a dns name to access the enabled services (sftp on port 22, etc.)
type: DOMAIN
optional: true
items:
- type: TERRAFORM
name: gcp
- type: HELM
name: sftpgo
24 changes: 14 additions & 10 deletions sftpgo/plural/recipes/sftpgo-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ dependencies:
- repo: ingress-nginx
name: ingress-nginx-kind
sections:
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
- name: sftpgo
configuration:
- name: hostname
type: DOMAIN
documentation: the fully qualified domain name your sftpgo instance will be available at
- name: loadBalancerHostname
documentation: a dns name to access the enabled services (sftp on port 22, etc.)
type: DOMAIN
optional: true
items:
- type: TERRAFORM
name: kube
- type: HELM
name: sftpgo
15 changes: 15 additions & 0 deletions sftpgo/terraform/gcp/deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
description: sftpgo gcp setup
version: 0.1.0
spec:
dependencies:
- name: gcp-bootstrap
repo: bootstrap
type: terraform
version: ">= 0.1.1"
providers:
- gcp
outputs:
gcp_sa_workload_identity_email: gcp_sa_workload_identity_email
20 changes: 20 additions & 0 deletions sftpgo/terraform/gcp/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "kubernetes_namespace" "sftpgo" {
metadata {
name = var.namespace
labels = {
"app.kubernetes.io/managed-by" = "plural"
"app.plural.sh/name" = "sftpgo"
}
}
}

module "sftpgo-workload-identity" {
source = "terraform-google-modules/kubernetes-engine/google//modules/workload-identity"
name = "${var.cluster_name}-sftpgo-workload"
namespace = var.namespace
project_id = var.project_id
use_existing_k8s_sa = true
annotate_k8s_sa = false
k8s_sa_name = "sftpgo"
roles = var.roles
}
3 changes: 3 additions & 0 deletions sftpgo/terraform/gcp/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "gcp_sa_workload_identity_email" {
value = module.sftpgo-workload-identity.gcp_service_account_email
}
3 changes: 3 additions & 0 deletions sftpgo/terraform/gcp/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace = {{ .Namespace | quote }}
cluster_name = {{ .Cluster | quote }}
project_id = {{ .Project | quote }}
21 changes: 21 additions & 0 deletions sftpgo/terraform/gcp/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
variable "namespace" {
type = string
default = "sftpgo"
}

variable "cluster_name" {
type = string
}

variable "project_id" {
type = string
description = <<EOF
The ID of the project in which the resources belong.
EOF
}

variable "roles" {
type = list(string)
description = "A list of roles to be added to the sftpgo workload identity service account"
default = []
}
8 changes: 1 addition & 7 deletions sftpgo/terraform/kube/deps.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
description: sftpgo aws setup
description: sftpgo kube setup
version: 0.1.0
spec:
dependencies:
Expand All @@ -15,11 +15,6 @@ spec:
type: terraform
version: '>= 0.1.1'
optional: true
- name: gcp-bootstrap
repo: bootstrap
type: terraform
version: '>= 0.1.1'
optional: true
- name: kind-bootstrap
repo: bootstrap
type: terraform
Expand All @@ -28,5 +23,4 @@ spec:
providers:
- aws
- azure
- gcp
- kind

0 comments on commit 7dd169a

Please sign in to comment.