This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
module.exports = (context, callback) => { | |
const message = { | |
"text": "This is a test!", | |
"attachments": [ | |
{ | |
"text": 'Hello Slack from OpenFaaS!' | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 1.0 | |
provider: | |
name: openfaas | |
gateway: http://127.0.0.1:8080 | |
functions: | |
slack-mail: | |
lang: node | |
handler: ./slack-mail | |
image: slack-mail:latest | |
labels: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create directory for the project | |
mkdir $HOME/mail-of-slack | |
# Change current directory to the project directory | |
cd $HOME/mail-of-slack | |
# Pull OpenFaaS templates | |
faas-cli template pull | |
# Create a function from nodejs language template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <<EOF | kubectl apply -f - | |
apiVersion: networking.istio.io/v1alpha3 | |
kind: Gateway | |
metadata: | |
name: openfaas-gateway-prod | |
namespace: openfaas-prod | |
spec: | |
selector: | |
istio: ingressgateway | |
servers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl -n istio-system describe certificate ingress-cert-openfaas-prod | |
kubectl logs -n istio-system -l app=cert-manager -c cert-manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <<EOF | kubectl apply -f - | |
apiVersion: certmanager.k8s.io/v1alpha1 | |
kind: Certificate | |
metadata: | |
name: ingress-cert-openfaas-prod | |
namespace: istio-system | |
spec: | |
secretName: ingress-cert-openfaas-prod | |
issuerRef: | |
name: letsencrypt-staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INGRESS_DOMAIN_PROD="api.mydoamin.com" | |
dig +short $INGRESS_DOMAIN_PROD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl -n istio-system describe certificate ingress-cert-openfaas-stg | |
kubectl logs -n istio-system -l app=cert-manager -c cert-manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <<EOF | kubectl apply -f - | |
apiVersion: networking.istio.io/v1alpha3 | |
kind: Gateway | |
metadata: | |
name: openfaas-gateway-stg | |
namespace: openfaas-stg | |
spec: | |
selector: | |
istio: ingressgateway | |
servers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helm upgrade openfaas-prod --install openfaas/openfaas \ | |
--namespace openfaas-prod \ | |
--set basic_auth=true \ | |
--set functionNamespace=openfaas-fn-prod \ | |
--set exposeServices=false \ | |
--set operator.create=true \ | |
--set operator.createCRD=false |