Istio ServiceEntry for outside db with mutual tls, cannot connect to db service












0














I am using istio 1.0.2 version with istio-demo-auth.yaml, I have a mssql db outside the k8s cluster, I want to connect it form the istio injected services. I try with this Consuming External TCP Services blogs, but the services cannot connect to the outside mssql instance. The service entry as below:



---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: mssql-entry
namespace: multitenancy
spec:
hosts:
- mssql-master
addresses:
- $outside-db-ip/32
ports:
- number: 2433
name: db
protocol: TCP
location: MESH_EXTERNAL
resolution: STATIC
endpoints:
- address: $outside-db-ip
ports:
tcp: 2433

---
apiVersion: v1
kind: Service
metadata:
name: mssql-master
namespace: multitenancy
labels:
app: v1
spec:
ports:
- port: 2433
targetPort: 2433
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
name: mssql-master
namespace: multitenancy
subsets:
- addresses:
- ip: $outside-db-ip
ports:
- port: 2433
protocol: TCP


And the services' log presenting " Prelogin error: host mssql-master port 2433 Error reading prelogin response: Connection reset ClientConnectionId:", seems not reached the mssql at all. How to configure outside cluster db for mutual tls services?










share|improve this question






















  • I add a destinationrule for mssql, to disable the tls for the mssql connection.
    – SmileSees
    Nov 13 '18 at 6:42










  • Does it help you to solve the issue?
    – mk_sta
    Nov 13 '18 at 11:29










  • @mk_sta Yes, after I disabled the tls for mssql destination, I can get the mssql connection in my services.
    – SmileSees
    Nov 14 '18 at 1:57
















0














I am using istio 1.0.2 version with istio-demo-auth.yaml, I have a mssql db outside the k8s cluster, I want to connect it form the istio injected services. I try with this Consuming External TCP Services blogs, but the services cannot connect to the outside mssql instance. The service entry as below:



---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: mssql-entry
namespace: multitenancy
spec:
hosts:
- mssql-master
addresses:
- $outside-db-ip/32
ports:
- number: 2433
name: db
protocol: TCP
location: MESH_EXTERNAL
resolution: STATIC
endpoints:
- address: $outside-db-ip
ports:
tcp: 2433

---
apiVersion: v1
kind: Service
metadata:
name: mssql-master
namespace: multitenancy
labels:
app: v1
spec:
ports:
- port: 2433
targetPort: 2433
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
name: mssql-master
namespace: multitenancy
subsets:
- addresses:
- ip: $outside-db-ip
ports:
- port: 2433
protocol: TCP


And the services' log presenting " Prelogin error: host mssql-master port 2433 Error reading prelogin response: Connection reset ClientConnectionId:", seems not reached the mssql at all. How to configure outside cluster db for mutual tls services?










share|improve this question






















  • I add a destinationrule for mssql, to disable the tls for the mssql connection.
    – SmileSees
    Nov 13 '18 at 6:42










  • Does it help you to solve the issue?
    – mk_sta
    Nov 13 '18 at 11:29










  • @mk_sta Yes, after I disabled the tls for mssql destination, I can get the mssql connection in my services.
    – SmileSees
    Nov 14 '18 at 1:57














0












0








0







I am using istio 1.0.2 version with istio-demo-auth.yaml, I have a mssql db outside the k8s cluster, I want to connect it form the istio injected services. I try with this Consuming External TCP Services blogs, but the services cannot connect to the outside mssql instance. The service entry as below:



---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: mssql-entry
namespace: multitenancy
spec:
hosts:
- mssql-master
addresses:
- $outside-db-ip/32
ports:
- number: 2433
name: db
protocol: TCP
location: MESH_EXTERNAL
resolution: STATIC
endpoints:
- address: $outside-db-ip
ports:
tcp: 2433

---
apiVersion: v1
kind: Service
metadata:
name: mssql-master
namespace: multitenancy
labels:
app: v1
spec:
ports:
- port: 2433
targetPort: 2433
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
name: mssql-master
namespace: multitenancy
subsets:
- addresses:
- ip: $outside-db-ip
ports:
- port: 2433
protocol: TCP


And the services' log presenting " Prelogin error: host mssql-master port 2433 Error reading prelogin response: Connection reset ClientConnectionId:", seems not reached the mssql at all. How to configure outside cluster db for mutual tls services?










share|improve this question













I am using istio 1.0.2 version with istio-demo-auth.yaml, I have a mssql db outside the k8s cluster, I want to connect it form the istio injected services. I try with this Consuming External TCP Services blogs, but the services cannot connect to the outside mssql instance. The service entry as below:



---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: mssql-entry
namespace: multitenancy
spec:
hosts:
- mssql-master
addresses:
- $outside-db-ip/32
ports:
- number: 2433
name: db
protocol: TCP
location: MESH_EXTERNAL
resolution: STATIC
endpoints:
- address: $outside-db-ip
ports:
tcp: 2433

---
apiVersion: v1
kind: Service
metadata:
name: mssql-master
namespace: multitenancy
labels:
app: v1
spec:
ports:
- port: 2433
targetPort: 2433
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
name: mssql-master
namespace: multitenancy
subsets:
- addresses:
- ip: $outside-db-ip
ports:
- port: 2433
protocol: TCP


And the services' log presenting " Prelogin error: host mssql-master port 2433 Error reading prelogin response: Connection reset ClientConnectionId:", seems not reached the mssql at all. How to configure outside cluster db for mutual tls services?







istio






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '18 at 2:13









SmileSees

155




155












  • I add a destinationrule for mssql, to disable the tls for the mssql connection.
    – SmileSees
    Nov 13 '18 at 6:42










  • Does it help you to solve the issue?
    – mk_sta
    Nov 13 '18 at 11:29










  • @mk_sta Yes, after I disabled the tls for mssql destination, I can get the mssql connection in my services.
    – SmileSees
    Nov 14 '18 at 1:57


















  • I add a destinationrule for mssql, to disable the tls for the mssql connection.
    – SmileSees
    Nov 13 '18 at 6:42










  • Does it help you to solve the issue?
    – mk_sta
    Nov 13 '18 at 11:29










  • @mk_sta Yes, after I disabled the tls for mssql destination, I can get the mssql connection in my services.
    – SmileSees
    Nov 14 '18 at 1:57
















I add a destinationrule for mssql, to disable the tls for the mssql connection.
– SmileSees
Nov 13 '18 at 6:42




I add a destinationrule for mssql, to disable the tls for the mssql connection.
– SmileSees
Nov 13 '18 at 6:42












Does it help you to solve the issue?
– mk_sta
Nov 13 '18 at 11:29




Does it help you to solve the issue?
– mk_sta
Nov 13 '18 at 11:29












@mk_sta Yes, after I disabled the tls for mssql destination, I can get the mssql connection in my services.
– SmileSees
Nov 14 '18 at 1:57




@mk_sta Yes, after I disabled the tls for mssql destination, I can get the mssql connection in my services.
– SmileSees
Nov 14 '18 at 1:57












1 Answer
1






active

oldest

votes


















0














As @SmileSees mentioned, the issue has been resolved by disabling mutual TLS authentication for the target mssql instance. Due to the fact that the database instance located outside the Istio mesh and no sidecar Envoy injected for this service, TLS security connection was not established.



You can consider to use SPIFFE framework for securing services across heterogeneous environments.



Referenced links for further research:




  1. Mutual TLS authentication

  2. Authorization policy

  3. Istio security vs SPIFFE






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53255207%2fistio-serviceentry-for-outside-db-with-mutual-tls-cannot-connect-to-db-service%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    As @SmileSees mentioned, the issue has been resolved by disabling mutual TLS authentication for the target mssql instance. Due to the fact that the database instance located outside the Istio mesh and no sidecar Envoy injected for this service, TLS security connection was not established.



    You can consider to use SPIFFE framework for securing services across heterogeneous environments.



    Referenced links for further research:




    1. Mutual TLS authentication

    2. Authorization policy

    3. Istio security vs SPIFFE






    share|improve this answer




























      0














      As @SmileSees mentioned, the issue has been resolved by disabling mutual TLS authentication for the target mssql instance. Due to the fact that the database instance located outside the Istio mesh and no sidecar Envoy injected for this service, TLS security connection was not established.



      You can consider to use SPIFFE framework for securing services across heterogeneous environments.



      Referenced links for further research:




      1. Mutual TLS authentication

      2. Authorization policy

      3. Istio security vs SPIFFE






      share|improve this answer


























        0












        0








        0






        As @SmileSees mentioned, the issue has been resolved by disabling mutual TLS authentication for the target mssql instance. Due to the fact that the database instance located outside the Istio mesh and no sidecar Envoy injected for this service, TLS security connection was not established.



        You can consider to use SPIFFE framework for securing services across heterogeneous environments.



        Referenced links for further research:




        1. Mutual TLS authentication

        2. Authorization policy

        3. Istio security vs SPIFFE






        share|improve this answer














        As @SmileSees mentioned, the issue has been resolved by disabling mutual TLS authentication for the target mssql instance. Due to the fact that the database instance located outside the Istio mesh and no sidecar Envoy injected for this service, TLS security connection was not established.



        You can consider to use SPIFFE framework for securing services across heterogeneous environments.



        Referenced links for further research:




        1. Mutual TLS authentication

        2. Authorization policy

        3. Istio security vs SPIFFE







        share|improve this answer














        share|improve this answer



        share|improve this answer








        answered Nov 14 '18 at 11:22


























        community wiki





        mk_sta































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53255207%2fistio-serviceentry-for-outside-db-with-mutual-tls-cannot-connect-to-db-service%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Full-time equivalent

            Bicuculline

            さくらももこ