MAGENTO 2-PWA KUBERNETES: How to put your elastic search behind username and password
For this illustration I am using Magernto, Vue Store Front PWA, Elastic Search
and Kubernetes.
First goto console and type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo htpasswd -c /etc/apache2/.htpasswd_elastic username
This will ask you to enter the password. Enter the password which you wish to
set for elastic authentication. After this is done run below command:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/apache2/.htpasswd_elastic
Copy the contents of the file.
Now, In your nginx.yaml file add the following:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:
htpasswd-elastic: |
<<paste the contents of \etc\apache2\.htpasswd-elastic>>
default.conf: |
server {
location /elastic/ {
auth_basic "Authentication Required";
auth_basic_user_file /etc/apache2/.htpasswd-elastic;
}
}
spec:
spec:
containers:
ports:
- mountPath: /etc/apache2/.htpasswd-elastic
name: config
subPath: htpasswd-elastic
volumes:
- name: config
configMap:
- key: htpasswd-elastic
path: htpasswd-elastic
Comments
Post a Comment