able-pager-97491
07/19/2021, 8:25 PMbillowy-army-68599
able-pager-97491
07/19/2021, 8:29 PM// Create a Service for the kuard Deployment
const service = new k8s.core.v1.Service(`${name}-ingress`,
{
metadata: {labels: labels, namespace: config.appsNamespaceName},
spec: {ports: [{ port: 8080, targetPort: "http" }], selector: labels},
},
{provider: config.provider}
);
// Export the Service name and public LoadBalancer endpoint
export const serviceName = service.metadata.name;
// Create the kuard Ingress
const ingress = new k8s.extensions.v1beta1.Ingress(`${name}-ingress`,
{
metadata: {
labels: labels,
namespace: config.appsNamespaceName,
annotations: {"<http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>": "nginx"},
},
spec: {
rules: [
{
host: "<http://apps.example.com|apps.example.com>",
http: {
paths: [
{
path: "/",
backend: {
serviceName: serviceName,
servicePort: "http",
}
},
],
},
}
]
}
},
{
provider: config.provider,
customTimeouts: { create: "20m", update: "20m", delete: "20m" }
}
);
kubernetes:extensions/v1beta1:Ingress (kuard-ingress):
warning: extensions/v1beta1/Ingress is deprecated by <http://networking.k8s.io/v1beta1/Ingress|networking.k8s.io/v1beta1/Ingress> and not supported by Kubernetes v1.20+ clusters.
error: 2 errors occurred:
* the Kubernetes API server reported that "apps-ybm4ftrd/kuard-ingress-qw61tuib" failed to fully initialize or become live: 'kuard-ingress-qw61tuib' timed out waiting to be Ready
* Ingress has at least one rule that does not target any Service. Field '.spec.rules[].http.paths[].backend.serviceName' may not match any active Service
billowy-army-68599
// Create the kuard Ingress
const ingress = new k8s.extensions.v1.Ingress(`${name}-ingress`,
{
metadata: {
labels: labels,
namespace: config.appsNamespaceName,
annotations: {"<http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>": "nginx"},
},
spec: {
rules: [
{
host: "<http://apps.example.com|apps.example.com>",
http: {
paths: [
{
path: "/",
backend: {
service: {
name: serviceName,
port: {
name: "http",
}
}
}
}
},
],
},
}
]
}
},
{
provider: config.provider,
customTimeouts: { create: "20m", update: "20m", delete: "20m" }
}
);
able-pager-97491
07/19/2021, 8:53 PMk8s.networking.v1.Ingress
I will try this one…const ingress = new k8s.networking.v1.Ingress(`${name}-ingress`,
{
metadata: {
labels: labels,
namespace: config.appsNamespaceName,
annotations: {"<http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>": "nginx"},
},
spec: {
rules: [
{
host: "<http://pulumi.dev.chatpay.com.br|pulumi.dev.chatpay.com.br>",
http: {
paths: [
{
path: "/",
pathType: "ImplementationSpecific",
backend: {
service: {
name: serviceName,
port: {name: "http"}
}
}
},
],
},
}
]
}
},
{
provider: config.provider,
}
);
I had to add the pathType that is now required and it worked! thank you @billowy-army-68599