-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support path based routing in core packages (#164)
Signed-off-by: Manabu McCloskey <[email protected]>
- Loading branch information
Showing
34 changed files
with
514 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: server | ||
app.kubernetes.io/name: argocd-server | ||
app.kubernetes.io/part-of: argocd | ||
name: argocd-server | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: argocd-server | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: argocd-server | ||
spec: | ||
containers: | ||
- args: | ||
- /usr/local/bin/argocd-server | ||
- "{{if .UsePathRouting}}" | ||
- --insecure | ||
- --basehref | ||
- /argocd | ||
- "{{end}}" | ||
name: argocd-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
#!/bin/bash | ||
|
||
INSTALL_YAML="pkg/controllers/localbuild/resources/argo/install.yaml" | ||
INGRESS_YAML="pkg/controllers/localbuild/resources/argo/ingress.yaml" | ||
|
||
echo "# UCP ARGO INSTALL RESOURCES" > ${INSTALL_YAML} | ||
echo "# This file is auto-generated with 'hack/argo-cd/generate-manifests.sh'" >> ${INSTALL_YAML} | ||
kustomize build ./hack/argo-cd/ >> ${INSTALL_YAML} | ||
|
||
cat ./hack/argo-cd/ingress.yaml.tmpl > ${INGRESS_YAML} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{{- if .UsePathRouting -}} | ||
--- | ||
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 | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: {{ .IngressHost }} | ||
http: | ||
paths: | ||
- path: /argocd(/|$)(.*) | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: argocd-server | ||
port: | ||
name: http | ||
|
||
{{- else -}} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
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" | ||
rules: | ||
- host: argocd.{{ .IngressHost }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: argocd-server | ||
port: | ||
name: https | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
INSTALL_YAML="pkg/controllers/localbuild/resources/gitea/k8s/install.yaml" | ||
GITEA_DIR="./hack/gitea" | ||
CHART_VERSION="9.5.1" | ||
|
||
echo "# GITEA INSTALL RESOURCES" > ${INSTALL_YAML} | ||
echo "# This file is auto-generated with 'hack/gitea/generate-manifests.sh'" >> ${INSTALL_YAML} | ||
|
||
helm repo add gitea-charts --force-update https://dl.gitea.com/charts/ | ||
helm repo update | ||
helm template my-gitea gitea-charts/gitea -f ${GITEA_DIR}/values.yaml --version ${CHART_VERSION} >> ${INSTALL_YAML} | ||
sed -i '3d' ${INSTALL_YAML} | ||
|
||
cat ${GITEA_DIR}/ingress.yaml.tmpl >> ${INSTALL_YAML} | ||
cat ${GITEA_DIR}/gitea-creds.yaml >> ${INSTALL_YAML} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: gitea-admin-secret | ||
type: Opaque | ||
stringData: | ||
username: giteaAdmin | ||
password: giteaPassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{{- if .UsePathRouting }} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: my-gitea-path | ||
namespace: gitea | ||
annotations: | ||
nginx.ingress.kubernetes.io/proxy-body-size: 512m | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
nginx.ingress.kubernetes.io/rewrite-target: /$2 | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: {{ .IngressHost }} | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: my-gitea-http | ||
port: | ||
number: 3000 | ||
path: /gitea(/|$)(.*) | ||
pathType: ImplementationSpecific | ||
{{ else if ( ne .Host "cnoe.localtest.me") }} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: my-gitea-custom | ||
namespace: gitea | ||
annotations: | ||
nginx.ingress.kubernetes.io/proxy-body-size: 512m | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: gitea.{{ .IngressHost }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: my-gitea-http | ||
port: | ||
number: 3000 | ||
{{ end }} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: my-gitea | ||
annotations: | ||
nginx.ingress.kubernetes.io/proxy-body-size: 512m | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: "gitea.cnoe.localtest.me" | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: my-gitea-http | ||
port: | ||
number: 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
#!/bin/bash | ||
|
||
INSTALL_YAML="pkg/controllers/localbuild/resources/nginx/k8s/ingress-nginx.yaml" | ||
NGINX_DIR="./hack/ingress-nginx" | ||
|
||
|
||
echo "# INGRESS-NGINX INSTALL RESOURCES" > ${INSTALL_YAML} | ||
echo "# This file is auto-generated with 'hack/ingress-nginx/generate-manifests.sh'" >> ${INSTALL_YAML} | ||
kustomize build ./hack/ingress-nginx/ >> ${INSTALL_YAML} | ||
kustomize build ${NGINX_DIR} >> ${INSTALL_YAML} | ||
|
||
cat ${NGINX_DIR}/service-ingress-nginx.yaml.tmpl >> ${INSTALL_YAML} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: controller | ||
app.kubernetes.io/instance: ingress-nginx | ||
app.kubernetes.io/name: ingress-nginx | ||
app.kubernetes.io/part-of: ingress-nginx | ||
app.kubernetes.io/version: 1.8.1 | ||
name: ingress-nginx-controller | ||
namespace: ingress-nginx | ||
spec: | ||
ipFamilies: | ||
- IPv4 | ||
ipFamilyPolicy: SingleStack | ||
ports: | ||
- appProtocol: {{ .Protocol }} | ||
name: {{ .Protocol }}-{{ .Port }} | ||
port: {{ .Port }} | ||
protocol: TCP | ||
targetPort: {{ .Protocol }} | ||
- appProtocol: http | ||
name: http | ||
port: 80 | ||
protocol: TCP | ||
targetPort: http | ||
- appProtocol: https | ||
name: https | ||
port: 443 | ||
protocol: TCP | ||
targetPort: https | ||
selector: | ||
app.kubernetes.io/component: controller | ||
app.kubernetes.io/instance: ingress-nginx | ||
app.kubernetes.io/name: ingress-nginx | ||
type: NodePort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.