• ingress nginx https配置


    3、https配置
    第一步:制作自签证书

    [root@master demo]# openssl genrsa -out tls.key 2048

    [root@master demo]# openssl req -new -x509 -key tls.key -out tls.crt -subj /C=CN/ST=Guangdong/L=Guangzhou/O=devops/CN=feiutest.cn

    生成两个文件:

    [root@master demo]# ls
    tls.crt  tls.key

    第二步:创建secret secret介绍

    [root@master demo]# kubectl create secret tls nginx-test --cert=tls.crt --key=tls.key

    [root@master demo]# kubectl get secret
    NAME                     TYPE                                  DATA      AGE
    nginx-test               kubernetes.io/tls                     2         17s

    第三步:修改ingress

    vi nginx-ingress-yaml

    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
    name: test-ingress
    namespace: default
    annotations:
    kubernetes.io/ingress.class: "nginx"
    spec:
    rules:
    - host: feiutest.cn
    http:
    paths:
    - path:
    backend:
    serviceName: test-ingress
    servicePort: 80
    tls:
    - hosts:
    - feiutest.cn
    secretName: nginx-test
    kubectl apply -f nginx-ingress-yaml

    测试访问

    https://feiutest.cn:30643



  • 相关阅读:
    setsid
    dup
    信号量
    linux标准输入输出
    linux守护进程范例
    c++字符串操作
    浏览器缓存
    bfc
    苹果手机自制铃声
    vue-cli 源码解读
  • 原文地址:https://www.cnblogs.com/gaoyuechen/p/11807152.html
Copyright © 2020-2023  润新知