Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
faas-netes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
faas-netes
Commits
d45bc4d2
Commit
d45bc4d2
authored
2 years ago
by
Alex Ellis (OpenFaaS Ltd)
Browse files
Options
Downloads
Patches
Plain Diff
Fix build by using generated password
Signed-off-by:
Alex Ellis (OpenFaaS Ltd)
<
alexellis2@gmail.com
>
parent
bd29b939
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
contrib/create_dev.sh
+5
-2
5 additions, 2 deletions
contrib/create_dev.sh
contrib/deploy.sh
+1
-38
1 addition, 38 deletions
contrib/deploy.sh
contrib/run_function.sh
+5
-0
5 additions, 0 deletions
contrib/run_function.sh
with
12 additions
and
40 deletions
.gitignore
+
1
−
0
View file @
d45bc4d2
...
...
@@ -33,3 +33,4 @@ of_kind_portforward.pid
jwt_key
jwt_key.pub
/*.pid
This diff is collapsed.
Click to expand it.
contrib/create_dev.sh
+
5
−
2
View file @
d45bc4d2
...
...
@@ -7,11 +7,14 @@ contrib/create_cluster.sh || exit 0;
contrib/deploy.sh
contrib/run_function.sh
PASSWORD
=
$(
kubectl get secret
-n
openfaas basic-auth
-o
=
go-template
=
'{{index .data "basic-auth-password"}}'
|
base64
--decode
)
cd
"
$(
git rev-parse
--show-toplevel
)
"
echo
""
echo
""
echo
"Local dev cluster details:"
printf
'%-10s:\t %s\n'
'Web UI'
'http://localhost:8080/ui'
printf
'%-10s:\t %s\n'
'User'
'admin'
printf
'%-10s:\t %s\n'
'Password'
"
$(
cat
password.txt
)
"
printf
'%-10s:\t %s\n'
'CLI Login'
"faas-cli login --username admin --password
$(
cat
password.txt
)
"
\ No newline at end of file
printf
'%-10s:\t %s\n'
'Password'
'$PASSWORD'
printf
'%-10s:\t %s\n'
'CLI Login'
"faas-cli login --username admin --password
$PASSWORD
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
contrib/deploy.sh
+
1
−
38
View file @
d45bc4d2
...
...
@@ -3,39 +3,11 @@
set
-e
DEVENV
=
${
OF_DEV_ENV
:-
kind
}
OPERATOR
=
${
OPERATOR
:-
0
}
echo
""
echo
"Applying namespaces"
kubectl
--context
"kind-
$DEVENV
"
apply
-f
./namespaces.yml
sha_cmd
=
"sha256sum"
if
[
!
-x
"
$(
command
-v
$sha_cmd
)
"
]
;
then
sha_cmd
=
"shasum -a 256"
fi
if
[
-x
"
$(
command
-v
$sha_cmd
)
"
]
;
then
sha_cmd
=
"shasum"
fi
PASSWORD_EXISTS
=
$(
kubectl get secret
-n
openfaas basic-auth |
wc
-c
)
if
[
$PASSWORD_EXISTS
-eq
0
]
;
then
PASSWORD
=
$(
head
-c
16 /dev/urandom|
$sha_cmd
|
cut
-d
" "
-f
1
)
echo
-n
$PASSWORD
>
password.txt
kubectl
--context
"kind-
$DEVENV
"
-n
openfaas create secret generic basic-auth
\
--from-literal
=
basic-auth-user
=
admin
\
--from-literal
=
basic-auth-password
=
"
$PASSWORD
"
else
PASSWORD
=
$(
kubectl get secret
-n
openfaas basic-auth
-o
=
go-template
=
'{{index .data "basic-auth-password"}}'
|
base64
--decode
)
echo
-n
$PASSWORD
>
password.txt
fi
CREATE_OPERATOR
=
false
if
[
"
${
OPERATOR
}
"
==
"1"
]
;
then
CREATE_OPERATOR
=
"true"
fi
echo
""
echo
"Waiting for helm install to complete."
...
...
@@ -44,16 +16,7 @@ helm upgrade \
--install
\
openfaas
\
./chart/openfaas
\
--namespace
openfaas
\
--set
basic_auth
=
true
\
--set
functionNamespace
=
openfaas-fn
\
--set
operator.create
=
$CREATE_OPERATOR
if
[
"
${
OPERATOR
}
"
==
"1"
]
;
then
kubectl
--context
"kind-
$DEVENV
"
patch
-n
openfaas deploy/gateway
\
-p
=
'[{"op": "add", "path": "/spec/template/spec/containers/1/command", "value": ["./faas-netes", "-operator=true"]} ]'
--type
=
json
fi
--namespace
openfaas
kubectl
--context
"kind-
$DEVENV
"
rollout status deploy/prometheus
-n
openfaas
kubectl
--context
"kind-
$DEVENV
"
rollout status deploy/gateway
-n
openfaas
This diff is collapsed.
Click to expand it.
contrib/run_function.sh
+
5
−
0
View file @
d45bc4d2
...
...
@@ -24,6 +24,11 @@ kubectl --context "kind-$DEVENV" port-forward deploy/gateway -n openfaas 8080:80
# port-forward needs some time to start
sleep
10
echo
"Using existing password for OpenFaaS gateway retrieved from Kubernetes."
PASSWORD
=
$(
kubectl get secret
-n
openfaas basic-auth
-o
=
go-template
=
'{{index .data "basic-auth-password"}}'
|
base64
--decode
)
echo
-n
$PASSWORD
>
password.txt
export
OPENFAAS_URL
=
http://127.0.0.1:8080
# Login into the gateway
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment