Skip to content

Commit

Permalink
Merge pull request #91 from crobby/rhods110branchpicks
Browse files Browse the repository at this point in the history
Picks to 1.0.0 branch for v1.0.10
  • Loading branch information
anishasthana authored Apr 22, 2021
2 parents 6ea9074 + 7fd24bd commit aa5979a
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ COPY opendatahub.yaml $HOME
ADD monitoring $HOME/monitoring
ADD consolelink $HOME/consolelink
ADD groups $HOME/groups
ADD jupyterhub $HOME/jupyterhub
ADD partners $HOME/partners

RUN chmod 755 $HOME/deploy.sh && \
chmod 644 $HOME/opendatahub.yaml && \
chmod 644 -R $HOME/monitoring && \
chmod 644 -R $HOME/groups && \
chmod 644 -R $HOME/jupyterhub && \
chown 1001:0 -R $HOME &&\
chmod ug+rwx -R $HOME

Expand Down
17 changes: 15 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ fi

export jupyterhub_prometheus_api_token=$(openssl rand -hex 32)
sed -i "s/<jupyterhub_prometheus_api_token>/$jupyterhub_prometheus_api_token/g" monitoring/jupyterhub-prometheus-token-secrets.yaml
oc apply -n ${ODH_PROJECT} -f monitoring/jupyterhub-prometheus-token-secrets.yaml
oc create -n ${ODH_PROJECT} -f monitoring/jupyterhub-prometheus-token-secrets.yaml || echo "INFO: Jupyterhub scrape token already exist."

export jupyterhub_postgresql_password=$(openssl rand -hex 32)
sed -i "s/<jupyterhub_postgresql_password>/$jupyterhub_postgresql_password/g" jupyterhub/jupyterhub-database-password.yaml
oc create -n ${ODH_PROJECT} -f jupyterhub/jupyterhub-database-password.yaml || echo "INFO: Jupyterhub Password already exist."

oc apply -n ${ODH_PROJECT} -f opendatahub.yaml
if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -157,7 +161,7 @@ oc apply -n $ODH_MONITORING_PROJECT -f monitoring/grafana/grafana.yaml

oc apply -n $ODH_MONITORING_PROJECT -f monitoring/cluster-monitoring/rhods-rules.yaml

oc apply -n $ODH_MONITORING_PROJECT -f monitoring/jupyterhub-db-probe/jupyterhub-db-probe.yaml
oc apply -n $ODH_PROJECT -f monitoring/jupyterhub-db-probe/jupyterhub-db-probe.yaml

# Add consoleLink CR to provide a link to the odh-dashboard via the Application Launcher in OpenShift
cluster_domain=$(oc get ingresses.config.openshift.io cluster --template {{.spec.domain}})
Expand All @@ -173,3 +177,12 @@ if oc::object::safe::to::apply ${kind} ${resource}; then
else
echo "The groups ConfigMap (${kind}/${resource}) has been modified. Skipping apply."
fi

kind="secret"
resource="anaconda-ce-access"

if oc::object::safe::to::apply ${kind} ${resource}; then
oc apply -n ${ODH_PROJECT} -f partners/anaconda/anaconda-ce-access.yaml
else
echo "The Anaconda base secret (${kind}/${resource}) has been modified. Skipping apply."
fi
10 changes: 10 additions & 0 deletions jupyterhub/jupyterhub-database-password.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: jupyterhub-database-password
label:
app: jupyterhub
stringData:
POSTGRESQL_PASSWORD: <jupyterhub_postgresql_password>
14 changes: 11 additions & 3 deletions monitoring/jupyterhub-db-probe/jupyterhub-db-probe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app: jupyterhub-db-probe
name: jupyterhub-db-probe
namespace: redhat-ods-monitoring
namespace: redhat-ods-applications
spec:
replicas: 1
selector:
Expand All @@ -17,7 +17,15 @@ spec:
deployment: jupyterhub-db-probe
spec:
containers:
- name: db-probe
- env:
- name: JUPYTERHUB_DB_USER
value: jupyterhub
- name: JUPYTERHUB_DB_PASSWORD
valueFrom:
secretKeyRef:
name: jupyterhub-database-password
key: POSTGRESQL_PASSWORD
name: db-probe
image: quay.io/modh/jupyterhub-db-probe:v0.2
imagePullPolicy: Always
ports:
Expand All @@ -41,7 +49,7 @@ metadata:
labels:
app: jupyterhub-db-probe
name: jupyterhub-db-probe
namespace: redhat-ods-monitoring
namespace: redhat-ods-applications
spec:
ports:
- name: metrics
Expand Down
2 changes: 1 addition & 1 deletion monitoring/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ data:
- role: endpoints
namespaces:
names:
- redhat-ods-monitoring
- redhat-ods-applications
relabel_configs:
- source_labels: [__meta_kubernetes_service_name]
regex: ^(jupyterhub-db-probe)$
Expand Down
6 changes: 6 additions & 0 deletions opendatahub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
name: jupyterhub
- kustomizeConfig:
overlays:
- jupyterhub-db-deployment-patch
- jupyterhub-deployment-patch
repoRef:
name: manifests
Expand All @@ -41,6 +42,11 @@ spec:
name: manifests
path: odh-dashboard
name: odh-dashboard
- kustomizeConfig:
repoRef:
name: manifests
path: partners/anaconda
name: anaconda-ce
repos:
- name: manifests
uri: file:///opt/manifests/odh-manifests.tar.gz
Expand Down
8 changes: 8 additions & 0 deletions partners/anaconda/anaconda-ce-access.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: anaconda-ce-access
namespace: redhat-ods-applications
labels:
opendatahub.io/modified: "false"
type: Opaque

0 comments on commit aa5979a

Please sign in to comment.