.. _dev-faq: Frequently Asked Questions ========================== I want to.. -------------------------- Add a new project to SKA organisation ````````````````````````````````````` * :doc:`/projects/create-new-project` Develop a Tango device `````````````````````` * A sample PyTango device project that can be forked can be found at ``_ * Documentation for it can be found at ``_ Containerise my solution ```````````````````````` A summary of our containerisation standards can be found in the :ref:`container-cheat-sheet`. * Verify Docker installation * `Docker installation instructions `_: .. code:: bash $ docker -v Docker version 1.7.0, build 0baf609 .. _verify-k8s: Incorporate my project into the integration environment `````````````````````````````````````````````````````````` We use Kubernetes as an orchestration layer - refer to our :doc:`Orchestration Guidelines `. Once a project is ready to form part of the integrated solution, we need to verify that all prerequisites are installed and working properly. * Verify kubectl installation * `kubectl installation instructions `_. .. code:: bash $ kubectl version Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:18:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"} The connection to the server localhost:8080 was refused - did you specify the right host or port? * Verify Minikube installation * `Minikube installation instructions `_. .. code:: bash $ minikube Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows... * Launch Kubernetes. * Look out for `kubectl is now configured to use "minikube"` near the end: .. code:: bash $ sudo -E minikube start --vm-driver=none --extra-config=kubelet.resolv-conf=/var/run/systemd/resolve/resolv.conf ๐Ÿ˜„ minikube v0.34.1 on linux (amd64) ๐Ÿคน Configuring local host environment ... โš ๏ธ The 'none' driver provides limited isolation and may reduce system security and reliability. โš  ๏ธ For more information, see: ๐Ÿ‘‰ https://gitlab.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md โš ๏ธ kubectl and minikube configuration will be stored in /home/ubuntu โš ๏ธ To use kubectl or minikube commands as your own user, you may โš ๏ธ need to relocate them. For example, to overwrite your own settings: โ–ช sudo mv /home/ubuntu/.kube /home/ubuntu/.minikube $HOME โ–ช sudo chown -R $USER /home/ubuntu/.kube /home/ubuntu/.minikube ๐Ÿ’ก This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true ๐Ÿ”ฅ Creating none VM (CPUs=2, Memory=2048MB, Disk=20000MB) ... ๐Ÿ“ถ "minikube" IP address is 192.168.86.29 ๐Ÿณ Configuring Docker as the container runtime ... โœจ Preparing Kubernetes environment ... โ–ช kubelet.resolv-conf=/var/run/systemd/resolve/resolv.conf ๐Ÿšœ Pulling images required by Kubernetes v1.13.3 ... ๐Ÿš€ Launching Kubernetes v1.13.3 using kubeadm ... ๐Ÿ”‘ Configuring cluster permissions ... ๐Ÿค” Verifying component health ..... ๐Ÿ’— kubectl is now configured to use "minikube" ๐Ÿ„ Done! Thank you for using minikube Test that the connectivity in the cluster works .. code:: bash $ kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE coredns-86c58d9df4-5ztg8 1/1 Running 0 3m24s ... * Verify Helm installation * `Helm installation instructions `_ .. code:: bash $ helm version version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"} ... .. note:: Until recently, we have been using Helm 2 in all our Ansible Playbooks for provisioning machines and development environments. Helm 2 used Tiller as a deployment service, and would be started in your environment by running the ``helm init`` command. **This is no longer the case with Helm 3.** `More info here `_ . Use this `ansible playbook `_ to upgrade your existing Helm 2 to Helm 3. Once Helm is installed, develop a helm chart for the project. Refer to :ref:`Helm instructions ` for guidelines. .. _Helm Chart Repository: https://artefact.skao.int/#browse/browse:helm-internal .. _SKAMPI: https://gitlab.com/ska-telescope/ska-skampi Install Helm charts from our own repository ``````````````````````````````````````````` The SKAMPI_ repository is in essence a configuration management repository, which basically just consists of a number of Helm charts and instructions for installing them on a kubernetes cluster. Installing Helm charts from our own `Helm Chart Repository`_ is another option, specifically that enables installing different charts during run-time. To add the SKA Helm chart repo to your local Helm, simply run .. code:: bash $ helm repo add skao https://artefact.skao.int/repository/helm-internal Working with the Helm chart repository, including how to package and upload charts to our repository, is described :ref:`here in detail `. Deploy the TMC prototype and Webjive in kubernetes ``````````````````````````````````````````````````` The integration gitlab repository can be found at ``_. Documentation on deployment can be found at ``_ Add the helm chart to the skampi repository: :ref:`integrating-a-chart-into-the-skampi-repo`. * Verify k8s integration * Launch the integration environment .. code:: bash $ make deploy_all KUBE_NAMESPACE=integration and verify that the pods are able to startup without any errors .. code:: bash $ watch kubectl get all,pv,pvc,ingress -n integration Every 2.0s: kubectl get all,pv,pvc -n integration osboxes: Fri Mar 29 09:25:05 2019 NAME READY STATUS RESTARTS AGE pod/databaseds-integration-tmc-webui-test-0 1/1 Running 3 117s pod/rsyslog-integration-tmc-webui-test-0 1/1 Running 0 117s podtangodb-integration-tmc-webui-test-0 1/1 Running 0 117s pod/tangotest-integration-tmc-webui-test 1/1 Running 2 117s pod/tmcprototype-integration-tmc-webui-test 4/5 CrashLoopBackOff 2 117s pod/webjive-integration-tmc-webui-test-0 4/4 Running 0 117s ...