ingress on first port
This commit is contained in:
parent
5f6d11b972
commit
c6eb0796ea
|
|
@ -24,4 +24,6 @@ kubectl get secret dev-secret -o yaml
|
|||
helm repo add traefik https://traefik.github.io/charts
|
||||
helm repo update
|
||||
helm install traefik traefik/traefik
|
||||
helm uninstall traefik traefik/traefik
|
||||
helm install traefik traefik/traefik --set expose.dashboard=true
|
||||
```
|
||||
|
|
@ -264,13 +264,10 @@ func (c *K8sClient) IngressExists(name string) bool {
|
|||
|
||||
func (c *K8sClient) UpdateIngress(a *AppModel) {
|
||||
ports := a.GetPorts()
|
||||
var exportPort int32 = 0
|
||||
for _, p := range ports {
|
||||
if p == 80 || p == 8000 || p == 8080 || p == 8888 {
|
||||
exportPort = p
|
||||
break
|
||||
}
|
||||
if len(ports) == 0 {
|
||||
return
|
||||
}
|
||||
exportPort := ports[0]
|
||||
if exportPort == 0 {
|
||||
return
|
||||
}
|
||||
|
|
@ -282,6 +279,9 @@ func (c *K8sClient) UpdateIngress(a *AppModel) {
|
|||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: a.IngressName(),
|
||||
Labels: label,
|
||||
Annotations: map[string]string{
|
||||
//"traefik.ingress.kubernetes.io/router.middlewares": "default-strip-prefix-1@kubernetescrd",
|
||||
},
|
||||
},
|
||||
Spec: netv1.IngressSpec{
|
||||
Rules: []netv1.IngressRule{
|
||||
|
|
|
|||
Loading…
Reference in New Issue