Name: nsolid-kubernetes
Owner: NodeSource
Description: Using N|Solid, the Enterprise Node Platform from NodeSource with Kubernetes
Created: 2016-03-23 17:32:26.0
Updated: 2018-05-20 11:23:02.0
Pushed: 2018-02-01 15:56:27.0
Size: 912
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repository is for deploying N|Solid with Kubernetes. It assumes that Kubernetes is already setup for your environment.
Existing nsolid-kubernetes
installs can be upgraded running the following command:
ctl apply -f conf/nsolid.quickstart.yml
If deployed to a cloud (AWS, Azure, GCP, Bluemix) please make sure to make the necessary adjustments to conf/nsolid.cloud.yml
ctl apply -f conf/nsolid.cloud.yml
stall
Notes:
kubectl
is pointing to your active cluster.This command will install the N|Solid Console and a secure HTTPS proxy to the nsolid
namespace.
It can take a little while for Kubernetes to download the N|Solid Docker images. You can verify that they are active by running:
ctl --namespace=nsolid get pods
When all three pods (console and nginx-secure-proxy) have a status of 'Running', you may continue to access the N|Solid Console.
nsolid
demo
minikube
tf "\nhttps://$(minikube ip):$(kubectl get svc nginx-secure-proxy --namespace=nsolid --output='jsonpath={.spec.ports[1].nodePort}')\n"
or
ctl get svc nginx-secure-proxy --namespace=nsolid
Open EXTERNAL-IP
. If using Bluemix Lite cluster, get EXTERNAL-IP this way.
NOTE: You will need to ignore the security warning on the self signed certificate to proceed.
ctl delete ns nsolid --cascade
ample-app
er build -t sample-app:v1 .
ctl create -f sample-app.service.yml
ctl create -f sample-app.deployment.yml
NOTE: the container image in sample-app.deployment.yml
must be set to match your docker image name. E.g. if you are using minikube
and ran eval $(minikube docker-env)
, set the image to:
spec:
containers:
- name: sample-app
image: sample-app:v1
If you are working in a cloud environment, you will need to push the sample-app to a public Docker registry like Docker Hub, Quay.io, the Azure Container Registry, or the IBM Bluemix Container Registry, and update the sample-app Deployment file.
NOTE: Assumes kubectl is configured and pointed at your Kubernetes cluster properly.
nsolid
to help isolate and manage the N|Solid components.ctl create -f conf/nsolid.namespace.yml
ssl req -x509 -nodes -newkey rsa:2048 -keyout conf/certs/nsolid-nginx.key -out conf/certs/nsolid-nginx.crt
/conf/nginx/htpasswd
sswd -cb ./conf/nginx/htpasswd {username} {password}
secret
for certs to mount in nginxctl create secret generic nginx-tls --from-file=conf/certs --namespace=nsolid
configmap
for nginx settingsctl create configmap nginx-config --from-file=conf/nginx --namespace=nsolid
ctl create -f conf/nsolid.services.yml
Note: If your cluster is a Bluemix Lite cluster, make this adjustment to conf/nsolid.services.yml before running kubectl create
.
N|Solid components require persistent storage. Kubernetes does not (yet!) automatically handle provisioning of disks consistently across all cloud providers. As such, you will need to manually create the persistent volumes.
Make sure the zone matches the zone you brought up your cluster in!
ud compute disks create --size 10GB nsolid-console
We need to create our disks and then update the volumeIds in conf/nsolid.persistent.aws.yml.
Make sure the zone matches the zone you brought up your cluster in!
ec2 create-volume --availability-zone eu-west-1a --size 10 --volume-type gp2
There's no need to explicitly create a persistent disk, since the Azure Container Service provides a default StorageClass
, which will dynamically create them as needed (e.g. when a Pod
includes a PersistentVolumeClaim
).
There's no need to explicitly create a persistent disk, since the Bluemix Container Service provides a default StorageClass
, which will dynamically create them as needed (e.g. when a Pod
includes a PersistentVolumeClaim
).
ctl create -f conf/nsolid.persistent.gce.yml
ctl create -f conf/nsolid.persistent.aws.yml
There's no need to explicitly create a PersistentVolume
object, since they will be dynamically provisioned by the default StorageClass
.
There's no need to explicitly create a PersistentVolume
object, since they will be dynamically provisioned by the default StorageClass
.
ctl create -f conf/nsolid.cloud.yml
Make sure your docker image is build on top of nodesource/nsolid:carbon-latest
.
nodesource/nsolid:carbon-latest
When defining your application make sure the following ENV
are set.
v:
- name: NSOLID_APPNAME
value: sample-app
- name: NSOLID_COMMAND
value: "console.nsolid:9001"
- name: NSOLID_DATA
value: "console.nsolid:9002"
- name: NSOLID_BULK
value: "console.nsolid:9003"
Optional flags:
v:
- name: NSOLID_TAGS
value: "nsolid-carbon,staging"
A comma separate list of tags that can be used to filter processes in the N|Solid Console.
ctl get svc {service-name}
The EXTERNAL-IP
will access the application.
Open EXTERNAL-IP
. If using Bluemix Lite cluster, get EXTERNAL-IP this way.
Make sure you use the --namespace=nsolid
flag on all kubectl
commands.
nsolid
as the default namespacectl config current-context // outputs current context
ctl config set-context {$context} --namespace=nsolid // make 'nsolid' the default namespace
ctl config set-context {$context} --namespace=default // revert to default
nsolid-cli
Verify CLI:
ctl exec {pod-name} -- nsolid-cli --remote=http://console.nsolid:6753 ping
See N|Solid cli docs for more info.
Minikube is a bit different then a normal Kubernetes install. The DNS service isn't running so discovering is a bit more involved. IP addresses are not dynamically assigned, instead we must use the host ports the service is mapped to.
If your doing a lot of work with docker and minikube it is recommended that you run the following:
$(minikube docker-env)
Get the kubernetes cluster ip address:
kube ip
To get the service port:
ctl get svc {$service-name} --output='jsonpath={.spec.ports[0].nodePort}'
Note: If your service exposes multiple ports you may want to examine with --output='json'
instead.
If you get the following message when trying to run docker build
or communicating with the Kubernetes API.
r response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)
Export the DOCKER_API_VERSION
to match the server API version.
rt DOCKER_API_VERSION=1.23
nsolid-kubernetes is Copyright (c) 2018 NodeSource and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.