show any files inside /secrets folder
This commit is contained in:
parent
fc2890a665
commit
465edd8740
4
app.rb
4
app.rb
|
@ -5,6 +5,8 @@ class App < Sinatra::Base
|
|||
set :public_folder, File.dirname(__FILE__) + '/public'
|
||||
|
||||
get "/" do
|
||||
erb :index
|
||||
secrets_base_dir = ENV["SECRETS_BASE_DIR"]
|
||||
secrets_base_dir ||= "/tmp/secrets"
|
||||
erb :index, locals: {secrets_base_dir: secrets_base_dir}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,8 +27,22 @@ spec:
|
|||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
{{- if .Values.database.service.class }}
|
||||
volumeMounts:
|
||||
- name: db-credentials
|
||||
mountPath: "/secrets/db-credentials"
|
||||
readOnly: true
|
||||
env:
|
||||
- name: SECRETS_BASE_DIR
|
||||
value: /secrets
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
@ -49,16 +63,6 @@ spec:
|
|||
secretKeyRef:
|
||||
name: {{ template "ruby-with-binding.fullname" . }}-db-secret
|
||||
key: password
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
{{- if .Values.database.service.class }}
|
||||
volumes:
|
||||
- name: db-credentials
|
||||
secret:
|
||||
|
|
|
@ -12,8 +12,13 @@
|
|||
<h1>View environment vars and secret files</h1>
|
||||
<p>This little app will show environment variables and files mounted under <code>/secret</code> folder.</p>
|
||||
<h2>Secrets</h2>
|
||||
<p>List of files and their contents within secrets directory <code><%= secrets_base_dir %></code>:</p>
|
||||
<pre>
|
||||
/secret/database/url - postgres://...
|
||||
<%=
|
||||
Dir["#{secrets_base_dir}/**/*"].map do |path|
|
||||
path + "=" + File.read(path)
|
||||
end.join("\n")
|
||||
%>
|
||||
</pre>
|
||||
<h2>Environment Variables</h2>
|
||||
<pre>
|
||||
|
|
Loading…
Reference in New Issue