UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Platform One
Big Bang
P
Packages
Developer Tools
Nexus
Commits
5ce0f332
Commit
5ce0f332
authored
Jun 28, 2021
by
Grant Duncklee
Committed by
Kavitha Thulasiraman
Jun 28, 2021
Browse files
chore: remediate password generation on upgrade
purge jobs on completion
parent
0e1d65e6
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
122 additions
and
9 deletions
+122
-9
chart/templates/_helpers.tpl
chart/templates/_helpers.tpl
+7
-0
chart/templates/bigbang/configmap-proxy.yaml
chart/templates/bigbang/configmap-proxy.yaml
+15
-0
chart/templates/bigbang/proxy.yaml
chart/templates/bigbang/proxy.yaml
+52
-0
chart/templates/bigbang/saml.yaml
chart/templates/bigbang/saml.yaml
+2
-1
chart/templates/bigbang/secret.yaml
chart/templates/bigbang/secret.yaml
+10
-4
chart/values.yaml
chart/values.yaml
+31
-2
docs/README.md
docs/README.md
+5
-2
No files found.
chart/templates/_helpers.tpl
View file @
5ce0f332
...
@@ -55,6 +55,13 @@ app.kubernetes.io/instance: {{ .Release.Name }}
...
@@ -55,6 +55,13 @@ app.kubernetes.io/instance: {{ .Release.Name }}
sonatype-license.lic: {{ .Values.license_key }}
sonatype-license.lic: {{ .Values.license_key }}
{{- end -}}
{{- end -}}
{
{
/*
Return
Nexus
default
admin
password
*/
}
}
{{- define "nexus.defaultAdminPassword" -}}
{{ randAlphaNum 12 }}
{{- end -}}
{
{
/*
{
{
/*
Create
the
name
of
the
service
account
to
use
Create
the
name
of
the
service
account
to
use
*/
}
}
*/
}
}
...
...
chart/templates/bigbang/configmap-proxy.yaml
0 → 100644
View file @
5ce0f332
{{
- if .Values.proxy.enabled
}}
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
{{
template "nexus.name" .
}}
-proxy
labels
:
{{
- include "nexus.labels" . | nindent 4
}}
{{
- if .Values.nexus.extraLabels
}}
{{
- with .Values.nexus.extraLabels
}}
{{
toYaml . | indent 4
}}
{{
- end
}}
{{
- end
}}
data
:
proxy
:
{{
.Values.proxy.request | toJson | quote
}}
{{
- end
}}
chart/templates/bigbang/proxy.yaml
0 → 100644
View file @
5ce0f332
{{
- if .Values.proxy.enabled
}}
apiVersion
:
batch/v1
kind
:
Job
metadata
:
annotations
:
"
helm.sh/hook"
:
post-install,post-upgrade
"
helm.sh/hook-delete-policy"
:
before-hook-creation,hook-succeeded,hook-failed
creationTimestamp
:
null
name
:
proxy
spec
:
template
:
metadata
:
creationTimestamp
:
null
spec
:
activeDeadlineSeconds
:
90
{{
- with .Values.nexus.imagePullSecrets
}}
imagePullSecrets
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
containers
:
-
image
:
registry1.dso.mil/ironbank/redhat/ubi/ubi8-minimal:latest
name
:
proxy
command
:
-
sh
args
:
-
-c
-
|
until curl --head localhost:15000; do echo "Waiting for Sidercar"; sleep 10; done; echo "Sidecar available" &&
BASE_URL="http://{{ template "nexus.name" . }}.{{ template "nexus.name" . }}.svc.cluster.local:{{ .Values.nexus.nexusPort }}"
# proxy
curl -X POST \
-u admin:"$API_CREDENTIALS" \
"$BASE_URL/service/extdirect" \
-H "Content-Type: application/json" \
-d "$PROXY" &&
curl -fsI -X POST http://localhost:15020/quitquitquit &&
exit
env
:
-
name
:
API_CREDENTIALS
valueFrom
:
secretKeyRef
:
name
:
{{
template "nexus.name" .
}}
-secret
key
:
admin.password
-
name
:
PROXY
valueFrom
:
configMapKeyRef
:
name
:
{{
template "nexus.name" .
}}
-proxy
key
:
proxy
resources
:
{}
restartPolicy
:
Never
status
:
{}
{{
- end
}}
chart/templates/bigbang/saml.yaml
View file @
5ce0f332
...
@@ -3,7 +3,8 @@ apiVersion: batch/v1
...
@@ -3,7 +3,8 @@ apiVersion: batch/v1
kind
:
Job
kind
:
Job
metadata
:
metadata
:
annotations
:
annotations
:
"
helm.sh/hook"
:
post-install
"
helm.sh/hook"
:
post-install,post-upgrade
"
helm.sh/hook-delete-policy"
:
before-hook-creation,hook-succeeded,hook-failed
creationTimestamp
:
null
creationTimestamp
:
null
name
:
saml
name
:
saml
spec
:
spec
:
...
...
chart/templates/bigbang/secret.yaml
View file @
5ce0f332
{{
- if .Values.secret.enabled -
}}
{{
- if .Values.secret.enabled -
}}
{{
- if not (lookup "v1" "Secret" "" "
{{
template 'nexus.name' .
}}
-secret")
}}
{{
- $nexusAdminPass
:
= (include "nexus.defaultAdminPassword" . | b64enc )
}}
{{
- if .Release.IsUpgrade
}}
{{
- $adminPassSecret
:
= (lookup "v1" "Secret" .Release.Namespace (print (include "nexus.name" .) "-secret"))
}}
{{
- $nexusAdminPass = (index $adminPassSecret.data "admin.password")
}}
{{
- end
}}
apiVersion
:
v1
apiVersion
:
v1
kind
:
Secret
kind
:
Secret
metadata
:
metadata
:
...
@@ -12,7 +19,6 @@ metadata:
...
@@ -12,7 +19,6 @@ metadata:
{{
- end
}}
{{
- end
}}
{{
- end
}}
{{
- end
}}
data
:
data
:
admin.password
:
{{
randAlphaNum 12 | b64enc | quote
}}
admin.password
:
{{
$nexusAdminPass
}}
admin.username
:
YWRtaW4K
admin.username
:
YWRtaW4K
{{
- end
}}
{{
- end
}}
{{
- end
}}
chart/values.yaml
View file @
5ce0f332
...
@@ -43,6 +43,35 @@ sso:
...
@@ -43,6 +43,35 @@ sso:
-
"
nx-all"
-
"
nx-all"
roles
:
roles
:
-
"
nx-admin"
-
"
nx-admin"
proxy
:
enabled
:
false
request
:
tid
:
1
action
:
coreui_HttpSettings
method
:
update
type
:
rpc
data
:
-
userAgentSuffix
:
~
timeout
:
~
retries
:
~
httpEnabled
:
false
httpHost
:
~
httpPort
:
~
httpAuthEnabled
:
~
httpAuthUsername
:
~
httpAuthPassword
:
~
httpAuthNtlmHost
:
~
httpAuthNtlmDomain
:
~
httpsEnabled
:
false
httpsHost
:
~
httpsPort
:
~
httpsAuthEnabled
:
~
httpsAuthUsername
:
~
httpsAuthPassword
:
~
httpsAuthNtlmHost
:
~
httpsAuthNtlmDomain
:
~
nonProxyHosts
:
[]
# -- End of BigBang Additions
# -- End of BigBang Additions
ingress
:
ingress
:
...
...
docs/README.md
View file @
5ce0f332
...
@@ -28,6 +28,9 @@ on the pod. However, we are generating a random password via `randAlphaNum` and
...
@@ -28,6 +28,9 @@ on the pod. However, we are generating a random password via `randAlphaNum` and
method allows us to overwrite the generated file containing the Nexus generated random password with a Kubernetes
method allows us to overwrite the generated file containing the Nexus generated random password with a Kubernetes
secret to enable programmatic ingestion.
secret to enable programmatic ingestion.
If you change the admin user's password via the UI you also must update the secret. Failure to do so will result
in proxy/saml job failures on subsequent upgrades.
Ensure the following is present to enable the randomized Kubernetes password:
Ensure the following is present to enable the randomized Kubernetes password:
```
bash
```
bash
# values.yaml
# values.yaml
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment