2727 labels :
2828 app : secure-file-storage
2929 spec :
30- # # Uncomment only if you are not deploying to the default namespace, remove ##
30+ # # Uncomment only if you aren't deploying to the default namespace, remove ##
3131# # In this case, make sure to create a Docker registry secret
3232# # imagePullSecrets:
3333# # - name: $IMAGE_PULL_SECRET
@@ -44,26 +44,30 @@ spec:
4444apiVersion : networking.k8s.io/v1
4545kind : Ingress
4646metadata :
47- name : ingress-for-secure-file-storage
47+ name : ingress-for-sfs
4848 namespace : $TARGET_NAMESPACE
4949 annotations :
5050 kubernetes.io/ingress.class : " public-iks-k8s-nginx"
51- nginx.ingress.kubernetes.io/auth-url : https://$host /oauth2-$BASENAME-appid /auth
52- nginx.ingress.kubernetes.io/auth-signin : https://$host/oauth2-$BASENAME-appid /start?rd=$escaped_request_uri
51+ nginx.ingress.kubernetes.io/auth-url : https://oauth2-$APPID_INSTANCE.default.svc.cluster.local /oauth2-$APPID_INSTANCE /auth
52+ nginx.ingress.kubernetes.io/auth-signin : https://$host/oauth2-$APPID_INSTANCE /start?rd=$escaped_request_uri
5353 nginx.ingress.kubernetes.io/configuration-snippet : |
54+ auth_request_set $_oauth2_${APPID_INSTANCE}_upstream_1 $upstream_cookie__oauth2_${APPID_INSTANCE}_1;
5455 auth_request_set $access_token $upstream_http_x_auth_request_access_token;
5556 auth_request_set $id_token $upstream_http_authorization;
5657 access_by_lua_block {
58+ if ngx.var._oauth2_${APPID_INSTANCE}_upstream_1 ~= "" then
59+ ngx.header["Set-Cookie"] = "_oauth2_${APPID_INSTANCE}_1=" .. ngx.var._oauth2_${APPID_INSTANCE}_upstream_1 .. ngx.var.auth_cookie:match("(; .*)")
60+ end
5761 if ngx.var.id_token ~= "" and ngx.var.access_token ~= "" then
5862 ngx.req.set_header("Authorization", "Bearer " .. ngx.var.access_token .. " " .. ngx.var.id_token:match("%s*Bearer%s*(.*)"))
5963 end
60- }
64+ }
6165spec :
6266 tls :
6367 - hosts :
6468 - secure-file-storage.$INGRESS_SUBDOMAIN
6569 secretName : $INGRESS_SECRET
66- # # Uncomment below if you are using a custom domain. Remove '# '
70+ # # Uncomment below if you are using a custom domain. Remove '# '
6771# - hosts:
6872# - secure-file-storage.$MYDOMAIN
6973# secretName: secure-file-storage-certificate
0 commit comments