Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Migrate to arkade for CLIs and dependent apps
Browse files Browse the repository at this point in the history
* Migrates to arkade for checking environment, installing
CLIs, and for apps (helm charts)
* Some names may change to defaults such as the name used for
Minio, so that will need to be considered before merging.
* Make login flow give feedback
* Update user-guide - no need to build kind from source anymore
* Update kubectl to use dry-run=client
* Get sealed-secrets / kubeseal from arkade
* Get the public key from the name of the newly installed
arkade app.
* Install KinD using arkade during CI
* Set github-status to quiet - when logs are set, it shows the
token obtained for setting a status on the commit.
* Update memory for echo function to lower value, given that
it only echos.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Dec 15, 2020
1 parent c4da635 commit 23cfd3e
Show file tree
Hide file tree
Showing 15 changed files with 390 additions and 398 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
with:
fetch-depth: 1
- name: Make all
run: make all
run: make all
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ init.yaml
main
bin/
config.json
credentials/
/credentials
/github.yml
/github.yaml
/private-key
CUSTOMERS
/install.sh
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2016-2017 Alex Ellis
Copyright (c) 2018 OpenFaaS Author(s)
Copyright (c) 2016-2020 Alex Ellis
Copyright (c) 2018-2020 OpenFaaS Author(s)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
34 changes: 16 additions & 18 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Example with [k3d](https://github.com/rancher/k3d):
k3d create --server-arg "--no-deploy=traefik"
```

Newer k3d versions will require an alternative:

```bash
k3d create --k3s-server-arg "--no-deploy=traefik"
```

> A note on DigitalOcean: if you're planning on using k3s with DigitalOcean, please stop and think why you are doing this instead of using the managed service called DOKS. DOKS is a free, managed control-plane and much less work for you, k3s on Droplets will be more expensive given that you have to run your own "master".
### Credentials and dependent systems
Expand All @@ -46,11 +52,13 @@ OpenFaaS Cloud installs, manages, and bundles software which spans source-contro
### Tools

* Kubernetes - [development options](https://blog.alexellis.io/be-kind-to-yourself/)
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-curl)
* OpenSSL - the `openssl` binary must be available in `PATH`
* Linux or Mac. Windows if `bash` is available

The following are automatically installed for you:
* [helm](https://docs.helm.sh/using_helm/#installing-helm)
* [faas-cli](https://github.com/openfaas/faas-cli) `curl -sL https://cli.openfaas.com | sudo sh`
* OpenSSL - the `openssl` binary must be available in `PATH`
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-curl)

If you are using a cluster with GKE then you must run the following command:

Expand Down Expand Up @@ -87,7 +95,8 @@ Once set up make sure you have set your `KUBECONFIG` and / or `kubectl` tool to
Check this with:

```sh
kubectl config get-contexts
arkade get kubectx
kubectx
```

Do not follow the instructions for B).
Expand All @@ -96,24 +105,14 @@ Do not follow the instructions for B).

For testing you can create a local cluster using `kind`, `minikube` or Docker Desktop. This is how you can install `kind` to setup a local cluster in a Docker container.

First install [Go 1.10 or newer](https://golang.org/dl/)

* Set your `GOPATH` if you don't already have one
Create a cluster with KinD

```bash
export GOPATH=$HOME/go
arkade get kind
kind create cluster
```

* Download and build `kind`

Now use `go get` to install `kind` and point your `KUBECONFIG` variable at the new cluster.

```bash
go get sigs.k8s.io/kind
kind create cluster --name 1

export KUBECONFIG=$(kind get kubeconfig-path --name 1)
```
KinD will automatically switch you into the new context, but feel free to check with `kubectx`.

## Get `ofc-bootstrap`

Expand Down Expand Up @@ -216,7 +215,6 @@ OpenFaaS Cloud also supports Amazon's managed container registry called ECR.
ofc-bootstrap registry-login --ecr --region <your-aws-region> --account-id <your-account-id>
```


At runtime it will use your mounted AWS credentials file from a separate secret to gain an access token for ECR. ECR access tokens need to be refreshed around every 12 hours and this is handled by the `ecr-login` binary built-into the OFC builder container image.

* Set the `registry`
Expand Down
Loading

0 comments on commit 23cfd3e

Please sign in to comment.