Desplegando desde un Cluster Kubernetes
Luis Manuel Raya Bernal - IES Gonzalo NazarenoVamos a desplegar un Cluster Kubernetes desde Minikube para ello seguid estos pasos.
Configurando OpenWhisk
kubectl create namespace openwhisk kubectl label nodes --all openwhisk-role=invoker
Vamos a usar un NodePort ingress para acceder a OpenWhisk. Asumiendo que el comando minikube ip nos devuelve 192.168.39.182 y puerto 31001, este sera el acceso hacia el host, creamos un mycluster.yaml para hacer un deploy de OpenWhisk:
git clone https://github.com/apache/incubator-openwhisk-deploy-kube.git cd incubator-openwhisk-deploy-kube/helm minikube ip 192.168.39.182 vim mycluster.yaml whisk: ingress: type: NodePort apiHostName: 192.168.39.182 apiHostPort: 31001 nginx: httpsNodePort: 31001
Deploy con Helm:
sudo apt install snapd sudo snap install helm --classic helm init kubectl get pods -n kube-system kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default helm install openwhisk --namespace=openwhisk --name=owdev -f mycluster.yaml kubectl get pods -n openwhisk
Ahora vamos a iniciar la instancia de OpenWhisk:
Necesitamos instalar el CLI de WSK para continuar
wsk property set --apihost 192.168.39.182:31001 wsk property set --auth 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP wsk -i list Entities in namespace: default packages actions triggers rules
nota: usar todos los comandos del CLI con la opción -i (insecure) para no usar certificados, ya que estamos en un entorno de pruebas.
Administrando OpenWhisk:
kubectl -n <namespace> -ti exec <name>-wskadmin -- wskadmin <parameters>