@@ -39,7 +39,15 @@ This repository contains all necessary resources and configurations to deploy an
39
39
40
40
### GitHub variables and GitHub Secrets variables
41
41
3 . ** K3S token variable** ``` K3S_TOKEN ``` is stored in GitHub Secrets. It was created using the following command:
42
- ``` gh secret set K3S_TOKEN --body "<K3S_TOKEN>" --repo lexxnsk/rsschool-devops-course-tasks ```
42
+ ```
43
+ gh secret set SSH_PRIVATE_KEY --body "$(cat aws.pem)" --repo lexxnsk/rsschool-devops-course-tasks
44
+ gh secret set K3S_TOKEN --body "<K3S_TOKEN>" --repo lexxnsk/rsschool-devops-course-tasks
45
+ gh variable set BASTION_HOST --body "bastion.rss.myslivets.ru" --repo lexxnsk/rsschool-devops-course-tasks-application
46
+ gh variable set K3S_SERVER_HOST --body "10.0.2.10" --repo lexxnsk/rsschool-devops-course-tasks-application
47
+ gh variable set BASTION_USER --body "ubuntu" --repo lexxnsk/rsschool-devops-course-tasks-application
48
+ gh variable set EC2_USER --body "ec2-user" --repo lexxnsk/rsschool-devops-course-tasks-application
49
+ gh variable set K3S_CONFIG --body "$(cat /Users/amyslivets/Documents/AWS/k3s.yml)" --repo lexxnsk/rsschool-devops-course-tasks-application
50
+ ```
43
51
44
52
You can list variables and secrets using the following commands:
45
53
``` gh variable list --repo lexxnsk/rsschool-devops-course-tasks ```
@@ -90,21 +98,36 @@ local-path (default) rancher.io/local-path Delete WaitForFir
90
98
```
91
99
- Here is a simple NGINX reverse proxy config to be installed on Bastion Host:
92
100
```
93
- sudo vi /etc/nginx/conf.d/jenkins.conf
101
+ sudo vi /etc/nginx/conf.d/nginx.conf
102
+
103
+ server {
104
+ listen 80;
105
+ server_name jenkins.rss.myslivets.ru;
94
106
107
+ location / {
108
+ proxy_pass http://10.0.2.10:32000; # Forward requests to the Jenkins server
109
+ proxy_http_version 1.1;
110
+ proxy_set_header Upgrade $http_upgrade;
111
+ proxy_set_header Connection 'upgrade';
112
+ proxy_set_header Host $host;
113
+ proxy_set_header X-Real-IP $remote_addr;
114
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
115
+ proxy_set_header X-Forwarded-Proto $scheme;
116
+ }
117
+ }
95
118
server {
96
119
listen 80;
97
- server_name jenkins .myslivets.ru;
120
+ server_name wordpress.rss .myslivets.ru;
98
121
99
122
location / {
100
- proxy_pass http://10.0.2.10:32000 ; # Forward requests to Jenkins
101
- proxy_http_version 1.1; # Use HTTP/1.1 for proxying
102
- proxy_set_header Upgrade $http_upgrade; # Handle WebSocket connections
103
- proxy_set_header Connection 'upgrade'; # Handle WebSocket connections
104
- proxy_set_header Host $host; # Preserve original Host header
105
- proxy_set_header X-Real-IP $remote_addr; # Pass the client IP address
106
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Preserve client IP
107
- proxy_set_header X-Forwarded-Proto $scheme; # Preserve protocol (http or https)
123
+ proxy_pass http://10.0.2.10:32001 ; # Forward requests to the WordPress server
124
+ proxy_http_version 1.1;
125
+ proxy_set_header Upgrade $http_upgrade;
126
+ proxy_set_header Connection 'upgrade';
127
+ proxy_set_header Host $host;
128
+ proxy_set_header X-Real-IP $remote_addr;
129
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
130
+ proxy_set_header X-Forwarded-Proto $scheme;
108
131
}
109
132
}
110
133
0 commit comments