Commit c1819194 authored by Konstantinos Tsakalozos's avatar Konstantinos Tsakalozos
Browse files

Clean .orig files

parent 3156594f
name: microk8s
version-script: |
. build-scripts/prepare-env.sh > /dev/null
echo $KUBE_VERSION
version: "latest"
summary: Kubernetes for workstations and appliances
description: |-
MicroK8s is a small, fast, secure, single node Kubernetes that installs on
just about any Linux box. Use it for offline development, prototyping,
testing, or use it on a VM as a small, cheap, reliable k8s for CI/CD. It's
also a great k8s for appliances - develop your IoT apps for k8s and deploy
them to MicroK8s on your boxes.
grade: stable
confinement: classic
apps:
daemon-etcd:
command: run-etcd-with-args
daemon: simple
daemon-docker:
command: run-docker-with-args
daemon: simple
daemon-apiserver:
command: run-with-config-args kube-apiserver
daemon: simple
daemon-apiserver-kicker:
command: apiservice-kicker
daemon: simple
daemon-controller-manager:
command: run-with-config-args kube-controller-manager
daemon: simple
daemon-scheduler:
command: run-with-config-args kube-scheduler
daemon: simple
daemon-kubelet:
command: run-with-config-args kubelet
daemon: simple
daemon-proxy:
command: run-with-config-args kube-proxy
daemon: simple
kubectl:
command: microk8s-kubectl.wrapper
completer: kubectl.bash
docker:
command: microk8s-docker.wrapper
completer: docker.bash
inspect:
command: sudo SNAP_DATA=${SNAP_DATA} ${SNAP}/inspect.sh
enable:
command: microk8s-enable.wrapper
disable:
command: microk8s-disable.wrapper
start:
command: microk8s-start.wrapper
stop:
command: microk8s-stop.wrapper
status:
command: microk8s-status.wrapper
config:
command: microk8s-config.wrapper
reset:
command: microk8s-reset.wrapper
istioctl:
command: microk8s-istioctl.wrapper
completer: istioctl.bash
parts:
libnftnl:
plugin: autotools
source: https://www.netfilter.org/projects/libnftnl/files/libnftnl-1.0.9.tar.bz2
build-packages:
- libjansson-dev
- libmnl-dev
iptables:
after:
- libnftnl
source: https://www.netfilter.org/projects/iptables/files/iptables-1.6.1.tar.bz2
plugin: autotools
build-packages:
- bison
- flex
- libmnl-dev
- libnfnetlink-dev
- libnetfilter-conntrack3
- libnetfilter-conntrack-dev
configflags:
- "--disable-shared"
- "--enable-static"
prime: [ -bin/iptables-xml ]
docker:
after: [iptables]
plugin: dump
stage-packages:
- conntrack
- docker.io
- aufs-tools
- gawk
- sed
source: .
stage:
- -sbin/xtables-multi
- -sbin/iptables*
- -lib/xtables
override-build: "true"
microk8s:
after: [docker]
plugin: dump
build-attributes: [no-patchelf]
build-packages:
- curl
- openssl
- file
stage-packages:
- net-tools
- util-linux
- zfsutils-linux
- socat
- iproute2
- dpkg
source: .
override-build: |
set -eu
. build-scripts/prepare-env.sh
if [ -z "$KUBE_SNAP_BINS" ]; then
echo "Downloading binaries from upstream"
# Also sets KUBE_SNAP_BINS
. build-scripts/fetch-binaries.sh
fi
echo "Setting default daemon configs"
cp -r $KUBE_SNAP_ROOT/microk8s-resources/default-args .
echo "Building certs"
build-scripts/build-certs.sh
cp -r $KUBE_SNAP_ROOT/microk8s-resources/certs-beta .
echo "Preparing cni"
mkdir -p opt/cni/bin/
cp $KUBE_SNAP_BINS/cni/* opt/cni/bin/
echo "Preparing dockerd"
cp $KUBE_SNAP_ROOT/microk8s-resources/docker-profile .
echo "Preparing etcd"
cp $KUBE_SNAP_BINS/etcd/etcd .
cp $KUBE_SNAP_BINS/etcd/etcdctl .
echo "Preparing kube-apiserver"
cp $KUBE_SNAP_BINS/$KUBE_ARCH/kube-apiserver .
cp $KUBE_SNAP_ROOT/microk8s-resources/known_token.csv .
cp $KUBE_SNAP_ROOT/microk8s-resources/basic_auth.csv .
echo "Preparing kube-controller-manager"
cp $KUBE_SNAP_BINS/$KUBE_ARCH/kube-controller-manager .
echo "Preparing kube-scheduler"
cp $KUBE_SNAP_BINS/$KUBE_ARCH/kube-scheduler .
echo "Preparing kubelet"
mkdir -p configs
cp $KUBE_SNAP_BINS/$KUBE_ARCH/kubelet .
cp $KUBE_SNAP_ROOT/microk8s-resources/kubelet.config ./configs/
echo "Preparing kube-proxy"
cp $KUBE_SNAP_BINS/$KUBE_ARCH/kube-proxy .
cp $KUBE_SNAP_ROOT/microk8s-resources/kubeproxy.config .
echo "Preparing kubelet"
cp $KUBE_SNAP_BINS/$KUBE_ARCH/kubectl .
echo "Preparing user config"
cp $KUBE_SNAP_ROOT/microk8s-resources/client.config .
echo "Creating commands and wrappers"
cp $KUBE_SNAP_ROOT/microk8s-resources/wrappers/* .
cp -r $KUBE_SNAP_ROOT/microk8s-resources/actions .
if [ "${ARCH}" = "arm64" ]
then
# Some actions are not available on arm64
# Nvidia support
rm "actions/enable.gpu.sh"
rm "actions/disable.gpu.sh"
rm "actions/gpu.yaml"
# Istio support
rm "actions/enable.istio.sh"
rm "actions/disable.istio.sh"
<<<<<<< HEAD
# added because the completer is still defined
touch istioctl.bash
=======
# Prometheus support
rm "actions/enable.prometheus.sh"
rm "actions/disable.prometheus.sh"
rm -rf "actions/prometheus"
>>>>>>> Add prometheus
else
# Istio addon
echo "Preparing istio"
cp $KUBE_SNAP_BINS/istioctl .
cp -r $KUBE_SNAP_BINS/istio-yaml ./actions/istio
# Add bash completion for istioctl. This is located here to make sure it is only added when istio is added.
./istioctl collateral completion --bash -o .
sed -i "s/complete -o default -F __start_istioctl istioctl/complete -o default -F __start_istioctl microk8s.istioctl/g" istioctl.bash
sed -i "s/complete -o default -F __start_istioctl istioctl/complete -o default -o nospace -F __start_istioctl microk8s.istioctl/g" istioctl.bash
fi
echo "Creating inspect hook"
cp $KUBE_SNAP_ROOT/scripts/inspect.sh .
# Add bash completion for microk8s.docker
cp $SNAPCRAFT_STAGE/usr/share/bash-completion/completions/docker docker.bash
sed -i "s/complete -F _docker docker docker.exe dockerd dockerd.exe/complete -F _docker microk8s.docker/g" docker.bash
# Add bash completion for microk8s.kubectl.
./kubectl completion bash | sed "s/complete -o default -F __start_kubectl kubectl/complete -o default -F __start_kubectl microk8s.kubectl/g" | sed "s/complete -o default -o nospace -F __start_kubectl kubectl/complete -o default -o nospace -F __start_kubectl kubectl/g" > kubectl.bash
snapcraftctl build
# Unfortunately we cannot add package repositories to our snaps
# https://forum.snapcraft.io/t/proposal-additional-package-sources/2199
# We handpick the debs we need.
# To update these debs add the repository
# Follow the instructions in https://github.com/NVIDIA/nvidia-docker and
# install the https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list repo.
# Use apt-cache show <package> to make sure
# a) the dockerd we ship in this snap is supported by nvidia-container-runtime
# b) the version dependencies of each package is met.
nvidia-runtime:
plugin: dump
source: https://nvidia.github.io/nvidia-container-runtime/ubuntu16.04/amd64/nvidia-container-runtime_2.0.0+docker18.06.1-1_amd64.deb
source-type: deb
override-build: |
set -eu
ARCH=$(dpkg --print-architecture)
if ! [ "${ARCH}" = "arm64" ]
then
snapcraftctl build
else
echo "Skipped"
fi
nvidia-runtime-hook:
plugin: dump
source: https://nvidia.github.io/nvidia-container-runtime/ubuntu16.04/amd64/nvidia-container-runtime-hook_1.4.0-1_amd64.deb
source-type: deb
override-build: |
set -eu
ARCH=$(dpkg --print-architecture)
if ! [ "${ARCH}" = "arm64" ]
then
snapcraftctl build
else
echo "Skipped"
fi
libnvidia:
plugin: dump
source: https://nvidia.github.io/libnvidia-container/ubuntu16.04/amd64/libnvidia-container1_1.0.0-1_amd64.deb
source-type: deb
override-build: |
set -eu
ARCH=$(dpkg --print-architecture)
if ! [ "${ARCH}" = "arm64" ]
then
snapcraftctl build
else
echo "Skipped"
fi
libnvidia-tools:
plugin: dump
source: https://nvidia.github.io/libnvidia-container/ubuntu16.04/amd64/libnvidia-container-tools_1.0.0-1_amd64.deb
source-type: deb
override-build: |
set -eu
ARCH=$(dpkg --print-architecture)
if ! [ "${ARCH}" = "arm64" ]
then
snapcraftctl build
else
echo "Skipped"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment