Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

How to use NSX-T https Ingress Controller for Kubernetes in VMware Enterprise PKS (71308)

Last Updated: 9/1/2023Categories: How toTotal Views: 16308Language:
English

4 like this article

Subscribe to get an email
newsletter with new updates

4 people found this helpful Please provide article feedback:

Purpose

This article contains detailed steps on how to use https ingress in VMware Enterprise PKS environment.

Resolution

In order to create an HTTPS ingress:

Create a server certificate and key by using openssl or any third party CA.

Create a TLS secret by using the above cert and key.

Create the Ingress resource by using the TLS secret.

Create a server certificate and key by using openssl :

Generate CA private key by running the command:
openssl genrsa -aes256 -out ca.key 4096

Example:
root@PKS-client-vm# openssl genrsa -aes256 -out ca.key 4096
Generating RSA private key, 4096 bit long modulus
..........................................++
...............................................................................................................................++e is 65537 (0x10001)
Enter pass phrase for ca.key: <Enter passphrase>
Verifying - Enter pass phrase for ca.key: <Enter passphrase>

Generate the CA certificate by running the command:
openssl req -key ca.key -new -x509 -days 365 -sha256 -extensions v3_ca -out ca.crt

Example:
root@PKS-client-vm# openssl req -key ca.key -new -x509 -days 365 -sha256 -extensions v3_ca -out ca.crt
Enter pass phrase for ca.key: <Enter the passphrase>
You are about to be asked to enter information that will be incorporated into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Generate server certificate request and private key:
openssl req -out server.csr -new -newkey rsa:2048 -nodes -keyout server.key

Example:
root@PKS-client-vm# openssl req -out server.csr -new -newkey rsa:2048 -nodes -keyout server.key
Generating a 2048 bit RSA private key
..................................................................+++.........+++
writing new private key to 'server.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes to be sent with your certificate request
A challenge password []: [optional]
An optional company name []: [optional]

Sign the CSR with CA certificate:
openssl x509 -req -days 360 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial  -out server.crt -sha256

Example:
root@PKS-client-vm# openssl x509 -req -days 360 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -sha256
Signature ok
subject=/C=XX/ST=XX/L=XXX XXX/O=XXXX/OU=XXXX
Getting CA Private Key
Enter pass phrase for ca.key: <Enter the pass phrase!>

Create a TLS secret by using cert and key:

You need to create the TLS secret by using the cert and key generated by openssl or custom CA.
kubectl create secret tls cafe-secret --key server.key --cert server.crt

Example:
root@PKS-client-vm# kubectl create secret tls cafe-secret --key server.key --cert server.crt
secret/cafe-secret created

Verifiy the secret by running the command:
root@PKS-client-vm # kubectl describe secret cafe-secret
Name:         cafe-secret
Namespace:    default
Labels:       <none>
Annotations:  <none>

Type:  kubernetes.io/tls
Data
====
tls.crt:  1655 bytes
tls.key:  1704 bytes

Create the Ingress resource by using the TLS secret:

Create the ingress resource by running the command:
kubectl create -f cafe-ingress-https.yml

Sample configuration file with TLS secret:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cafe-ingress
spec:
tls:
- hosts:
- cafe.example.com
secretName: cafe-secret
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
backend:
serviceName: tea-svc
servicePort: 80
- path: /coffee
backend:
serviceName: coffee-svc
servicePort: 80

Verify that ingress resource has been created:
root@PKS-client-vm# kubectl get ingress
NAME           HOSTS              ADDRESS                     PORTS     AGE
cafe-ingress   cafe.example.com   10.40.14.96,100.64.112.35   80, 443   1m

Navigate to NSX-T Manager  > PKS Cluster Load Balancer > HTTPS ingress controller > LB Profiles and verify that you see the certificate under Client Side SSL section.

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

KB
•
如何从 vRealize Automation 7.3+ 内容包迁移到 7.5+ 内容包 (71284)

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Usage Meter 无法完成 vROPS 配置 (71305)

KB
•
将磁盘添加到 vCloud Director for Service Providers 中的虚拟机时出现错误“未设置 StoragePlacementSpec 所需属性 podSelectionSpec” (71365)

Results 1-4 of 4

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware PKS

Related Versions:

VMware PKS 1.x

Take Our Survey

Support Assistant