Skip to content

Commit

Permalink
Add annotations in ingress for API and Oauth
Browse files Browse the repository at this point in the history
In order to deploy Hub and related components on Tekton dogfooding
cluster, we need to add some annotations which can generate tls certs
and dns records. This patch contains those annotations.

Signed-off-by: vinamra28 <vinjain@redhat.com>
  • Loading branch information
vinamra28 authored and tekton-robot committed Feb 2, 2022
1 parent d6846b3 commit 520f1c6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config/02-api/23-api-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- name: api
port: 8000
targetPort: 8000
- name: oauth
- name: auth
port: 4200
targetPort: 4200
type: NodePort
5 changes: 4 additions & 1 deletion config/04-kubernetes/40-api-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ metadata:
annotations:
acme.cert-manager.io/http01-edit-in-place: 'true'
cert-manager.io/cluster-issuer: letsencrypt-prod
dns.gardener.cloud/dnsnames: 'api.hub.tekton.dev'
dns.gardener.cloud/ttl: "3600"
name: api
spec:
rules:
- http:
- host: api.hub.tekton.dev
http:
paths:
- backend:
serviceName: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ metadata:
annotations:
acme.cert-manager.io/http01-edit-in-place: 'true'
cert-manager.io/cluster-issuer: letsencrypt-prod
name: oauth
dns.gardener.cloud/dnsnames: 'auth.hub.tekton.dev'
dns.gardener.cloud/ttl: "3600"
name: auth
spec:
rules:
- http:
- host: auth.hub.tekton.dev
http:
paths:
- backend:
serviceName: api
servicePort: 4200
path: /*
tls:
- hosts:
- oauth.hub.tekton.dev
secretName: oauth-hub-tekton-dev-tls
- auth.hub.tekton.dev
secretName: auth-hub-tekton-dev-tls
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: oauth
name: auth
labels:
app: api
spec:
Expand Down
4 changes: 2 additions & 2 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ db-migration-8vhpd 0/1 Error 0 17s
- If deploying on OpenShift:-

```bash
kubectl apply -f 04-openshift/40-api-route.yaml -f 04-openshift/40-oauth-route.yaml -n tekton-hub
kubectl apply -f 04-openshift/40-api-route.yaml -f 04-openshift/40-auth-route.yaml -n tekton-hub
```

- If deploying on Kubernetes:-
Expand All @@ -154,7 +154,7 @@ db-migration-8vhpd 0/1 Error 0 17s
- Apply the Ingress

```bash
kubectl apply -f 04-kubernetes/40-api-ingress.yaml -f 04-kubernetes/40-oauth-ingress.yaml -n tekton-hub
kubectl apply -f 04-kubernetes/40-api-ingress.yaml -f 04-kubernetes/40-auth-ingress.yaml -n tekton-hub
```

### Create Git Oauth Applications
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ api-k8s(){
api-openshift(){
info Creating API Release Yaml

ko resolve -f 02-api -f 04-openshift/40-api-route.yaml -f 04-openshift/40-oauth-route.yaml > "${RELEASE_DIR}"/api-openshift.yaml || {
ko resolve -f 02-api -f 04-openshift/40-api-route.yaml -f 04-openshift/40-auth-route.yaml > "${RELEASE_DIR}"/api-openshift.yaml || {
err 'api release build failed'
return 1
}
Expand Down

0 comments on commit 520f1c6

Please sign in to comment.