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

sudo htpasswd -c /etc/apache2/.htpasswd_elastic username
view raw gistfile1.txt hosted with ❤ by GitHub



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:


cat /etc/apache2/.htpasswd_elastic
view raw gistfile1.txt hosted with ❤ by GitHub


Copy the contents of the file.

Now, In your nginx.yaml file add the following:



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
view raw pwa-nginx.yaml hosted with ❤ by GitHub


Comments

Popular posts from this blog

SEO for your Press Releases [Updated 2025 list]

XDebug - PHPStorm - Mac: How to configure Xdebug with PHPStorm on Mac OS and PHP 7.3