I’m trying to create an internal ingress for 2 services in GKE (called app/api).
But I’m getting an error that seems incocrrect maybe to the non-expert eye.
The internal ingress error I’m getting is:
Error syncing to GCP: error running load balancer syncing routine: loadbalancer LBNAME does not exist: googleapi: Error 400: Invalid value for field ‘resource.sslPolicy’: ‘global/sslPolicies/regional-ssl-policy’. Unexpected scope ‘global’., invalid
This error message seems to suggest the ssl policy is global, but it’s regional in correct region.
Here is some config:
The frontend config is:
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
name: frontendforingress
spec:
sslPolicy: regional-ssl-policy <===== NOTE: This is a regional ssl policy, in correct region
The ingress config is:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingressname
annotations:
cloud.google.com/backend-config: '{"ports": {"80":"app-backend","8000":"api-backend"}}'
kubernetes.io/ingress.class: "gce-internal" # Add this annotation for internal load balancer
kubernetes.io/ingress.allow-http: "false" # Internal ingress does not support https+http at same time
ingress.gcp.kubernetes.io/pre-shared-cert: ourcertificates
networking.gke.io/v1beta1.FrontendConfig: frontendforingress
spec:
defaultBackend:
service:
name: app
port:
number: 80
rules:
- host: api.company.com
http:
paths:
- pathType: "ImplementationSpecific"
backend:
service:
name: api
port:
number: 8000
- host: app.company.com
http:
paths:
- pathType: "ImplementationSpecific"
backend:
service:
name: app
port:
number: 80
Any suggestions how to proceed?
TMI: More k8s configs:
Service for app:
apiVersion: v1
kind: Service
metadata:
annotations:
cloud.google.com/backend-config: '{"default": "app-backend"}'
cloud.google.com/neg: '{"ingress": true}'
labels:
app: app
name: app
spec:
type: NodePort
ports:
- name: tcp
port: 80
protocol: TCP
targetPort: 80
selector:
app: app
sessionAffinity: None
Service api:
apiVersion: v1
kind: Service
metadata:
annotations:
cloud.google.com/backend-config: '{"default": "api-backend"}'
cloud.google.com/neg: '{"ingress": true}'
labels:
app: api
name: api
spec:
type: NodePort
sessionAffinity: None
ports:
- name: tcp-8000
port: 8000
protocol: TCP
targetPort: 8000
selector:
app: api
Backendconfig for app:
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: app-backend
spec:
logging:
enable: false
Backendconfig for api:
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: api-backend
spec:
logging:
enable: false