Skip to content

Commit

Permalink
Added logic to modify path in ing creation
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilashshetty004 committed Feb 7, 2022
1 parent 26f2b09 commit 8f77fd9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *controller) syncDeployment(ns, name string) error {
}

func createIngress(ctx context.Context, client kubernetes.Interface, svc *corev1.Service) error {
path := "/api/v1/books"
path := "/"
port := "80"
dep, err := client.AppsV1().Deployments(svc.Namespace).Get(ctx, svc.Name, metav1.GetOptions{})
if err != nil {
Expand All @@ -203,6 +203,9 @@ func createIngress(ctx context.Context, client kubernetes.Interface, svc *corev1
port = val
}
}
if port == "8080" {
path = "/api/v1/books"
}
portInt, _ := strconv.Atoi(port)
pathtype := ntw.PathTypeExact
ingress := ntw.Ingress{
Expand Down
Binary file modified ekspose
Binary file not shown.
8 changes: 4 additions & 4 deletions manifests/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ kind: Deployment
metadata:
creationTimestamp: null
labels:
app: nginxd
app: nginx
ingReq: needed
name: nginxd
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginxd
app: nginx
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: nginxd
app: nginx
spec:
containers:
- image: nginx
Expand Down
2 changes: 1 addition & 1 deletion manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
app: ekspose
spec:
containers:
- image: abhilashshetty04/ekspose:0.1.3
- image: abhilashshetty04/ekspose:0.1.4
name: ekspose
resources: {}
serviceAccountName: ekspose-sa
Expand Down

0 comments on commit 8f77fd9

Please sign in to comment.