Skip to content
Open
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
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ This script runs kustomize to modify the basic installation manifests provided b
Gitea manifests are generated using a bash script available [here](./hack/gitea/generate-manifests.sh).
This script runs helm template to generate most files. See the values file for more information.

#### Ingress-nginx
#### Traefik

ingress-nginx manifests are generated using a bash script available [here](./hack/ingress-nginx/generate-manifests.sh).
This script runs kustomize to modify the basic installation manifests provided by ingress-nginx.
Traefik manifests are generated using a bash script available [here](./hack/traefik/generate-manifests.sh).
This script runs helm template to generate the Traefik installation manifests.

## Architecture

Expand Down Expand Up @@ -152,7 +152,7 @@ During this phase, controllers act on CRs created by the CLI phase. Resources su
`LocalbuildReconciler` bootstraps the cluster using embedded manifests. Embedded manifests are yaml files that are baked into the binary at compile time.
1. Install core packages. They are essential services that are needed for the user experiences we want to enable:
* Gitea. This is the in-cluster Git server that hosts Git repositories.
* Ingress-nginx. This is necessary to expose services inside the cluster to the users.
* Traefik. This is necessary to expose services inside the cluster to the users.
* ArgoCD. This is used as the packaging mechanism. Its primary purpose is to deploy manifests from gitea repositories.
2. Once they are installed, it creates `GitRepository` CRs for core packages. This CR represents the git repository on the Gitea server.
3. Create ArgoCD applications for the apps. Point them to the Gitea repositories. From here on, ArgoCD manages the core packages.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/gitrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type GitRepositorySpec struct {
}

type GitRepositorySource struct {
// +kubebuilder:validation:Enum:=argocd;gitea;nginx
// +kubebuilder:validation:Enum:=argocd;gitea;traefik
// +kubebuilder:validation:Optional
EmbeddedAppName string `json:"embeddedAppName,omitempty"`
// Path is the absolute path to directory that contains Kustomize structure or raw manifests.
Expand Down
16 changes: 8 additions & 8 deletions api/v1alpha1/localbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const (
PackageTypeLabelCore = "core"
PackageTypeLabelCustom = "custom"

ArgoCDPackageName = "argocd"
GiteaPackageName = "gitea"
IngressNginxPackageName = "nginx"
ArgoCDPackageName = "argocd"
GiteaPackageName = "gitea"
TraefikPackageName = "traefik"
)

// ArgoPackageConfigSpec Allows for configuration of the ArgoCD Installation.
Expand Down Expand Up @@ -90,10 +90,10 @@ type PackageCustomization struct {
type LocalbuildStatus struct {
// ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
ArgoCD ArgoCDStatus `json:"ArgoCD,omitempty"`
Nginx NginxStatus `json:"nginx,omitempty"`
Gitea GiteaStatus `json:"gitea,omitempty"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
ArgoCD ArgoCDStatus `json:"ArgoCD,omitempty"`
Gitea GiteaStatus `json:"gitea,omitempty"`
Traefik TraefikStatus `json:"traefik,omitempty"`
}

type GiteaStatus struct {
Expand All @@ -109,7 +109,7 @@ type ArgoCDStatus struct {
AppsCreated bool `json:"appsCreated,omitempty"`
}

type NginxStatus struct {
type TraefikStatus struct {
Available bool `json:"available,omitempty"`
}

Expand Down
32 changes: 16 additions & 16 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions docs/images/source/idpbuilder.excalidraw
Original file line number Diff line number Diff line change
Expand Up @@ -2211,11 +2211,11 @@
"locked": false,
"fontSize": 20,
"fontFamily": 1,
"text": "Git Repositories:\n- ArgoCD\n- Ingress-nginx\n- Gitea\n- Backstage\n- Crossplane",
"text": "Git Repositories:\n- ArgoCD\n- Traefik\n- Gitea\n- Backstage\n- Crossplane",
"textAlign": "left",
"verticalAlign": "top",
"containerId": null,
"originalText": "Git Repositories:\n- ArgoCD\n- Ingress-nginx\n- Gitea\n- Backstage\n- Crossplane",
"originalText": "Git Repositories:\n- ArgoCD\n- Traefik\n- Gitea\n- Backstage\n- Crossplane",
"lineHeight": 1.25,
"baseline": 143
},
Expand Down Expand Up @@ -2247,11 +2247,11 @@
"locked": false,
"fontSize": 20,
"fontFamily": 1,
"text": "ArgoCD Apps:\n- ArgoCD\n- Ingress-nginx\n- Gitea\n- Backstage\n- Crossplane",
"text": "ArgoCD Apps:\n- ArgoCD\n- Traefik\n- Gitea\n- Backstage\n- Crossplane",
"textAlign": "left",
"verticalAlign": "top",
"containerId": null,
"originalText": "ArgoCD Apps:\n- ArgoCD\n- Ingress-nginx\n- Gitea\n- Backstage\n- Crossplane",
"originalText": "ArgoCD Apps:\n- ArgoCD\n- Traefik\n- Gitea\n- Backstage\n- Crossplane",
"lineHeight": 1.25,
"baseline": 143
},
Expand Down Expand Up @@ -2474,11 +2474,11 @@
"locked": false,
"fontSize": 20,
"fontFamily": 1,
"text": "Core Packages:\n- ArgoCD\n- Gitea\n- Ingress-nginx",
"text": "Core Packages:\n- ArgoCD\n- Gitea\n- Traefik",
"textAlign": "left",
"verticalAlign": "top",
"containerId": null,
"originalText": "Core Packages:\n- ArgoCD\n- Gitea\n- Ingress-nginx",
"originalText": "Core Packages:\n- ArgoCD\n- Gitea\n- Traefik",
"lineHeight": 1.25,
"baseline": 93
},
Expand Down Expand Up @@ -2790,4 +2790,4 @@
"viewBackgroundColor": "#ffffff"
},
"files": {}
}
}
4 changes: 2 additions & 2 deletions globals/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "fmt"
const (
ProjectName string = "idpbuilder"

NginxNamespace string = "ingress-nginx"
ArgoCDNamespace string = "argocd"
ArgoCDNamespace string = "argocd"
TraefikNamespace string = "traefik"

SelfSignedCertSecretName = "idpbuilder-cert"
SelfSignedCertCMName = "idpbuilder-cert"
Expand Down
2 changes: 1 addition & 1 deletion hack/argo-cd/argocd-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-server
- "{{if .UsePathRouting}}"
- --insecure
- "{{if .UsePathRouting}}"
- --basehref
- /argocd
- "{{end}}"
Expand Down
33 changes: 19 additions & 14 deletions hack/argo-cd/ingress.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{{- if .UsePathRouting -}}
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: strip-prefix
namespace: argocd
spec:
stripPrefix:
prefixes:
- /argocd
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-server-ingress-http
namespace: argocd
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
traefik.ingress.kubernetes.io/router.middlewares: argocd-strip-prefix@kubernetescrd
spec:
ingressClassName: nginx
ingressClassName: traefik
rules:
- host: {{ .IngressHost }}
http:
paths:
- path: /argocd(/|$)(.*)
pathType: ImplementationSpecific
- path: /argocd
pathType: Prefix
backend:
service:
name: argocd-server
Expand All @@ -26,8 +34,8 @@ spec:
- host: {{ .Host }}
http:
paths:
- path: /argocd(/|$)(.*)
pathType: ImplementationSpecific
- path: /argocd
pathType: Prefix
backend:
service:
name: argocd-server
Expand All @@ -41,11 +49,8 @@ kind: Ingress
metadata:
name: argocd-server-ingress
namespace: argocd
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
ingressClassName: "nginx"
ingressClassName: traefik
rules:
- host: argocd.{{ .IngressHost }}
http:
Expand All @@ -56,7 +61,7 @@ spec:
service:
name: argocd-server
port:
name: https
name: http
{{- if ne .IngressHost .Host }}
- host: argocd.{{ .Host }}
http:
Expand All @@ -67,6 +72,6 @@ spec:
service:
name: argocd-server
port:
name: https
name: http
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions hack/embedded-resources.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

DIRECTORIES='argo-cd gitea ingress-nginx'
DIRECTORIES='argo-cd gitea traefik'

for dir in $DIRECTORIES; do
./hack/$dir/generate-manifests.sh;
if [[ $? -ne 0 ]]; then
echo "error running script: ./hack/$dir/generate-manifests.sh"
exit 1
fi
done
done
Loading
Loading