### Install Dependencies and Start Dev Server Source: https://github.com/canonical/ubuntu.com/blob/main/AGENTS.md Run this command to install Python and Node dependencies and start the local development server. The server will be available at http://127.0.0.1:8001. ```bash task ``` -------------------------------- ### Start using OpenStack Source: https://github.com/canonical/ubuntu.com/blob/main/templates/openstack/install.html Launches a test instance to verify the OpenStack installation. ```bash sunbeam launch ubuntu --name test ``` -------------------------------- ### Install and Run dotrun Snap Source: https://github.com/canonical/ubuntu.com/blob/main/HACKING.md Install the dotrun snap for a streamlined development workflow. Run the command to build dependencies and start the server. ```bash sudo snap install dotrun dotrun # Build dependencies and run the server ``` -------------------------------- ### Successful Helm Installation Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/troubleshooting.md Example output of a successful Helm installation after configuring the correct endpoint. ```bash helm install --debug Created tunnel using local port: '36749' SERVER: "localhost:36749" CHART PATH: /home/ubuntu/.helm/ NAME: ... ... ``` -------------------------------- ### Kubernetes Ingress Output Example Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/operations.md Example output from `kubectl get ingress`, showing the 'microbot-ingress' resource and its configured host. ```text NAME HOSTS ADDRESS PORTS AGE microbot-ingress microbot.52.87.186.136.nip.io 80 5m36s ``` -------------------------------- ### Setup Python Virtual Environment Source: https://github.com/canonical/ubuntu.com/blob/main/HACKING.md Create and activate a Python virtual environment for the project. Install project dependencies using pip. ```bash python3 -m venv env source env/bin/activate pip install -r requirements.txt ./entrypoint 127.0.0.0:8001 ``` -------------------------------- ### Kubernetes Services and Endpoints Output Example Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/operations.md Example output from `kubectl get services,endpoints`, detailing the 'kubernetes' and 'microbot' services and their associated endpoints. ```text NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.152.183.1 443/TCP 112m service/microbot ClusterIP 10.152.183.62 80/TCP 3m50s NAME ENDPOINTS AGE endpoints/kubernetes 10.95.195.54:6443 112m endpoints/microbot 10.1.77.12:80,10.1.77.13:80,10.1.77.14:80 3m50s ``` -------------------------------- ### Kubernetes Pods Output Example Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/operations.md This is an example of the output from `kubectl get pods`, showing the status of the 'microbot' pods. ```text NAME READY STATUS RESTARTS AGE microbot-5b9864df4d-q7b94 1/1 Running 0 2m31s microbot-5b9864df4d-rx9b2 1/1 Running 0 2m31s microbot-5b9864df4d-x7ppr 1/1 Running 0 2m31s ``` -------------------------------- ### Install LXD Client on Linux Source: https://github.com/canonical/ubuntu.com/blob/main/templates/appliance/lxd/_next-steps.html Install the LXD client on a Linux system using snap. ```bash snap install lxd ``` -------------------------------- ### Install server-side snap packages Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/packages.md Install server components such as kube-apiserver using the snap command. ```bash sudo snap install kube-apiserver ``` -------------------------------- ### Install kubectl Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/how-to-addons.md Installs the kubectl command-line tool via snap for cluster interaction. ```bash sudo snap install kubectl --classic ``` -------------------------------- ### Install Workshop Snap Source: https://github.com/canonical/ubuntu.com/blob/main/templates/workshop/index.html Install the Workshop snap using the --classic option. This command requires sudo privileges. ```bash $ sudo snap install --classic workshop ``` -------------------------------- ### Install the openstack snap Source: https://github.com/canonical/ubuntu.com/blob/main/templates/openstack/install.html Installs the OpenStack snap package on the host machine. ```bash sudo snap install openstack ``` -------------------------------- ### Example Constraint Violations Output Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/gatekeeper.md An example output from the 'kubectl get constraints' command, showing the constraint name and the total number of violations detected. This helps in monitoring policy compliance. ```bash NAME ENFORCEMENT-ACTION TOTAL-VIOLATIONS ns-must-have-gk 6 ``` -------------------------------- ### Install LXD Client on Windows Source: https://github.com/canonical/ubuntu.com/blob/main/templates/appliance/lxd/_next-steps.html Install the LXD client on Windows using Chocolatey. ```bash choco install lxc ``` -------------------------------- ### Install KVM package Source: https://github.com/canonical/ubuntu.com/blob/main/templates/appliance/shared/_steps_setup-kvm.html Installs the necessary QEMU KVM package on an Ubuntu system. ```bash sudo apt install qemu-kvm ``` -------------------------------- ### Install and configure LXD Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/install-local.md Commands to install, refresh, and configure user permissions for LXD. ```bash sudo snap install lxd --channel 5.0/stable ``` ```bash sudo snap refresh lxd --channel 5.0/stable ``` ```bash sudo usermod -a -G lxd $USER ``` -------------------------------- ### Install Keystone Client Auth Binary Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/ldap.md Installs the client-keystone-auth snap package required for authenticating with the API server via Keystone tokens. ```bash snap install client-keystone-auth ``` -------------------------------- ### Install Development Tools (Python and Node.js) Source: https://github.com/canonical/ubuntu.com/blob/main/HACKING.md Install necessary development tools including Python 3 pip and Node.js globally using apt. ```bash sudo apt update && sudo apt install python3-pip nodejs ``` -------------------------------- ### Install and Bootstrap K8s Snap Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/install.html Commands to install the K8s snap, initialize the cluster, and verify the status. ```bash sudo snap install k8s --classic ``` ```bash sudo k8s bootstrap ``` ```bash sudo k8s status ``` ```bash sudo k8s kubectl get all --all-namespaces ``` -------------------------------- ### Kube-apiserver Arguments Example Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/auth.md An example output showing the --authorization-mode argument for the kube-apiserver. ```text root 6244 1 22 17:10 ? 00:00:12 /snap/kube-apiserver/1720/kube-apiserver --allow-privileged=false --service-cluster-ip-range=10.152.183.0/24 --min-request-timeout=300 --v=4 --tls-cert-file=/root/cdk/server.crt --tls-private-key-file=/root/cdk/server.key --kubelet-certificate-authority=/root/cdk/ca.crt --kubelet-client-certificate=/root/cdk/client.crt --kubelet-client-key=/root/cdk/client.key --kubelet-https=true --logtostderr=true --storage-backend=etcd3 --insecure-port=0 --profiling=false --anonymous-auth=false --authentication-token-webhook-cache-ttl=1m0s --authentication-token-webhook-config-file=/root/cdk/auth-webhook/auth-webhook-conf.yaml --service-account-key-file=/root/cdk/serviceaccount.key --kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP --encryption-provider-config=/var/snap/kube-apiserver/common/encryption/encryption_config.yaml --advertise-address=172.31.17.53 --etcd-cafile=/root/cdk/etcd/client-ca.pem --etcd-keyfile=/root/cdk/etcd/client-key.pem --etcd-certfile=/root/cdk/etcd/client-cert.pem --etcd-servers=https://172.31.13.233:2379,https://172.31.30.137:2379,https://172.31.9.235:2379 --authorization-mode=Node,RBAC --enable-admission-plugins=PersistentVolumeLabel,PodSecurityPolicy,NodeRestriction --requestheader-client-ca-file=/root/cdk/ca.crt --requestheader-allowed-names=system:kube-apiserver,client --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --proxy-client-cert-file=/root/cdk/client.crt --proxy-client-key-file=/root/cdk/client.key --enable-aggregator-routing=true --client-ca-file=/root/cdk/ca.crt --audit-log-path=/root/cdk/audit/audit.log --audit-log-maxage=30 --audit-log-maxsize=100 --audit-log-maxbackup=10 --audit-policy-file=/root/cdk/audit/audit-policy.yaml ``` -------------------------------- ### Install Rust Toolchain with rustup Snap Source: https://github.com/canonical/ubuntu.com/blob/main/templates/toolchains/rust.html Install the rustup snap to easily manage Rust toolchains, including stable and nightly builds. This command installs rustup and the stable toolchain. ```bash sudo snap install rustup; rustup install stable ``` -------------------------------- ### Install Juju via Snap Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/quickstart.md Installs the Juju CLI tool using the snap package manager. ```bash sudo snap install juju --channel=3.1/stable ``` -------------------------------- ### Install Docker using snap Source: https://github.com/canonical/ubuntu.com/blob/main/templates/embedded/index.html Installs Docker using the snap package manager. Snaps provide a sandboxed and easy-to-install application environment. ```bash snap install docker ``` -------------------------------- ### Grafana Credentials Output Example Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/how-to-cos-lite.md Example output showing the admin password and URL for accessing the Grafana instance. ```text admin-password: b9OhxF5ndUDO url: http://10.246.154.87/cos-lite-grafana ``` -------------------------------- ### Example etcd Upgrade Output Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/upgrade-notes.md This is an example of the output you can expect after running the etcd migration script, indicating the steps taken during the upgrade. ```no-highlight · Waiting for etcd units to be active and idle... · Acquiring configured version of etcd... · Upgrading etcd to version 3.0/stable from 2.3/stable. · Waiting for etcd upgrade to 3.0/stable............................................................ · Waiting for etcd units to be active and idle.................................................... · Waiting for etcd cluster convergence... · Stopping all Kubernetes api servers... · Waiting for etcd cluster convergence... · Stopping etcd... · Migrating etcd/0... · Migrating etcd/1... · Migrating etcd/2... · Starting etcd... · Configuring storage-backend to etcd3... · Waiting for all Kubernetes api servers to restart....... · Done. ``` -------------------------------- ### Install Keystone Client Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/ldap.md Install the Keystone client for LDAP authentication. This is a prerequisite for configuring LDAP via Keystone. ```bash sudo snap install client-keystone-auth ``` -------------------------------- ### Install JavaScript Development Tools Source: https://github.com/canonical/ubuntu.com/blob/main/HACKING.md Install JavaScript formatting and linting tools, prettier and eslint, globally using npm. ```bash sudo npm install -g prettier eslint stylelint ``` -------------------------------- ### Launch an Ubuntu Appliance Source: https://github.com/canonical/ubuntu.com/blob/main/templates/appliance/shared/_steps-multipass-launch.html Use this command to start an appliance instance. Replace the placeholder with the specific appliance alias. ```bash multipass launch appliance:{{ appliance.alias }} ``` -------------------------------- ### Create and Scale Hello World Deployment Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/aws-integration.md Use these commands to create a sample 'hello-world' deployment and scale it to five replicas. Ensure you have kubectl configured to interact with your Kubernetes cluster. ```bash kubectl create deployment hello-world --image=gcr.io/google-samples/node-hello:1.0 kubectl scale deployment hello-world --replicas=5 ``` -------------------------------- ### Install Python and Node Dependencies Only Source: https://github.com/canonical/ubuntu.com/blob/main/AGENTS.md Use this command to install only the Python virtual environment and Node.js dependencies, without starting the development server. ```bash task install ``` -------------------------------- ### Launch virtual machine with KVM Source: https://github.com/canonical/ubuntu.com/blob/main/templates/appliance/shared/_steps_setup-kvm.html Starts a virtual machine with specified CPU, memory, and network port forwarding configurations. ```bash kvm -smp 2 -m 1500 -netdev user,id=mynet0,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -device virtio-net-pci,netdev=mynet0 -vga qxl -drive file=ubuntu-core-16-amd64.img,format=raw ``` -------------------------------- ### Check Ubuntu Pro Security Status Source: https://github.com/canonical/ubuntu.com/blob/main/templates/azure/pro.html Use the `pro security-status` command to get a complete overview of your machine's installed packages and their corresponding security coverage. ```bash pro security-status ``` -------------------------------- ### Deploy Microbot Example Application Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/operations.md Run this command on a worker node to deploy 3 replicas of the 'microbot' web application. This action also creates a service and an ingress resource. ```bash juju run kubernetes-worker/0 microbot replicas=3 ``` -------------------------------- ### View snap configuration arguments Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/packages.md Example content of the arguments file generated by the snap configure hook at /var/snap//current/args. ```text --cert-dir "/root/certs" --etcd-cafile "/root/certs/ca.crt" --etcd-certfile "/root/certs/client.crt" --etcd-keyfile "/root/certs/client.key" --etcd-servers "https://172.31.9.254:2379" --service-cluster-ip-range "10.123.123.0/24" ``` -------------------------------- ### Retrieve Apache2 IP and Graylog Password Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/logging.md Use these commands to get the web server IP address and Graylog admin password for login. Ensure you have Juju installed and configured. ```bash juju status --format yaml apache2/0 | grep public-address public-address: ``` ```bash juju run graylog/0 show-admin-password admin-password: ``` -------------------------------- ### Install HWE Kernel for Ubuntu 22.04 LTS (Desktop/Server) Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kernel/lifecycle.html Install the Hardware Enablement (HWE) kernel for Ubuntu 22.04 LTS. Desktop installations default to tracking the HWE stack, while server installations offer it as optional. ```bash sudo apt-get install --install-recommends linux-generic-hwe-22.04 ``` -------------------------------- ### Install HWE Kernel for Ubuntu 20.04 LTS (Desktop/Server) Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kernel/lifecycle.html Install the Hardware Enablement (HWE) kernel for Ubuntu 20.04 LTS. Desktop installations default to tracking the HWE stack, while server installations offer it as optional. ```bash sudo apt-get install --install-recommends linux-generic-hwe-20.04 ``` -------------------------------- ### Install HWE Kernel for Ubuntu 18.04 LTS (Server) Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kernel/lifecycle.html Install the Hardware Enablement (HWE) kernel for Ubuntu 18.04 LTS Server. Server installations default to the GA kernel and provide the HWE kernel as an optional installation. ```bash sudo apt-get install --install-recommends linux-generic-hwe-18.04 ``` -------------------------------- ### Add Equinix credentials Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/equinix.md Launch the interactive command to input project ID and authentication token. ```bash juju add-credential equinix ``` -------------------------------- ### Install HWE Kernel for Ubuntu 16.04 LTS (Server) Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kernel/lifecycle.html Install the Hardware Enablement (HWE) kernel for Ubuntu 16.04 LTS Server. Server installations default to the GA kernel and provide the HWE kernel as an optional installation. ```bash sudo apt-get install --install-recommends linux-generic-hwe-16.04 ``` -------------------------------- ### Install Docker using apt Source: https://github.com/canonical/ubuntu.com/blob/main/templates/embedded/index.html Installs Docker using the apt package manager. This is a common method for installing Docker on Debian-based systems. ```bash apt install docker.io ``` -------------------------------- ### Initialize LXD Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/install-local.md Initializes the LXD environment with the required storage backend and network settings. ```bash lxd init ``` -------------------------------- ### Install Real-time Kernel Source: https://github.com/canonical/ubuntu.com/blob/main/templates/real-time/index.html Installs the real-time kernel on Ubuntu 26.04 and later releases. ```bash sudo apt install ubuntu-realtime ``` -------------------------------- ### Install and bootstrap Juju Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/install-local.md Sets up the Juju controller and creates a model for Charmed Kubernetes. ```bash mkdir -p ~/.local/share/juju sudo snap install juju --channel 3/stable ``` ```bash juju bootstrap localhost ``` ```bash export MODEL=ck8s juju add-model $MODEL ``` -------------------------------- ### Initialize Helm Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/troubleshooting.md Initializes the Helm client and installs Tiller into the Kubernetes cluster. ```bash helm init $HELM_HOME has been configured at /home/ubuntu/.helm Tiller (the helm server side component) has been installed into your Kubernetes Cluster. Happy Helming! ``` -------------------------------- ### Install MicroCeph Source: https://github.com/canonical/ubuntu.com/blob/main/templates/ceph/shared/_multi-node-deployment.html Install the MicroCeph snap package on every node intended for the cluster. ```bash sudo snap install microceph ``` -------------------------------- ### Install LXD Client on macOS Source: https://github.com/canonical/ubuntu.com/blob/main/templates/appliance/lxd/_next-steps.html Install the LXD client on macOS using Homebrew. ```bash brew install lxc ``` -------------------------------- ### Start Kubernetes dashboard proxy Source: https://github.com/canonical/ubuntu.com/blob/main/templates/kubernetes/charmed-k8s/docs/operations.md Starts a local proxy to access the Kubernetes dashboard. ```bash kubectl proxy ``` -------------------------------- ### Snapcraft Takeover Example Source: https://github.com/canonical/ubuntu.com/blob/main/templates/0_docs/takeovers.html Configure a takeover with the Snapcraft theme. This snippet allows for specifying a header image, button text, and URLs for primary and secondary calls to action. ```html {% with title="A guide to developing Android apps on Ubuntu", subtitle="Learn what makes Ubuntu the perfect platform for Android app development", class="p-takeover--snapcraft", header_image="https://assets.ubuntu.com/v1/c3b8a9dd-Snap_Store_shopping_icon.svg", image_height="175", image_width="200", image_hide_small=true, equal_cols=true, primary_url="https://snapcraft.io", primary_cta="Download the whitepaper", primary_cta_class="p-button", secondary_url="", secondary_cta="" %} {% include "takeovers/_template.html" %} {% endwith %} ```