Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Microk8s compatibility #45

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.

- Helm installation on OpenShift ([#29]).
- `operator-rs` `0.25.2` -> `0.27.1` ([#34]).
- Shortened the registration socket path for Microk8s compatibility ([#45]).
- After upgrading you will need to
`rmdir /var/lib/kubelet/plugins_registry/listeners.stackable.tech-reg.sock` manually.
This applies to *all* users, not just Microk8s.
- Made kubeletDir configurable ([#45]).
- Microk8s users will need to `--set kubeletDir=/var/snap/microk8s/common/var/lib/kubelet`.


[#29]: https://github.com/stackabletech/listener-operator/pull/29
[#34]: https://github.com/stackabletech/listener-operator/pull/34
[#45]: https://github.com/stackabletech/listener-operator/pull/45
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_registry("docker.stackable.tech/sandbox")

custom_build(
'docker.stackable.tech/sandbox/listener-operator',
'nix run -f . crate2nix generate && nix-build . -A docker --argstr dockerName "${EXPECTED_REGISTRY}/listener-operator" && ./result/load-image | docker load',
'nix shell -f . crate2nix -c crate2nix generate && nix-build . -A docker --argstr dockerName "${EXPECTED_REGISTRY}/listener-operator" && ./result/load-image | docker load',
deps=['rust', 'Cargo.toml', 'Cargo.lock', 'default.nix', "nix", 'build.rs', 'vendor'],
# ignore=['result*', 'Cargo.nix', 'target', *.yaml],
outputs_image_ref_to='result/ref',
Expand Down
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ rec {
}
];

crate2nix = pkgs.crate2nix;
# need to use vendored crate2nix because of https://github.com/kolloch/crate2nix/issues/264
crate2nix = pkgs.callPackage sources.crate2nix {};
tilt = pkgs.tilt;
}
12 changes: 7 additions & 5 deletions deploy/helm/listener-operator/templates/node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ spec:
- name: csi
mountPath: /csi
- name: mountpoint
mountPath: /var/lib/kubelet/pods
mountPath: {{ .Values.kubeletDir }}/pods
mountPropagation: Bidirectional
- name: node-driver-registrar
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.4.0
args:
- --csi-address=/csi/csi.sock
- --kubelet-registration-path=/var/lib/kubelet/plugins/listeners.stackable.tech/csi.sock
- --kubelet-registration-path={{ .Values.kubeletDir }}/plugins/listeners.stackable.tech/csi.sock
volumeMounts:
- name: registration-sock
mountPath: /registration
Expand All @@ -65,13 +65,15 @@ spec:
volumes:
- name: registration-sock
hostPath:
path: /var/lib/kubelet/plugins_registry/listeners.stackable.tech-reg.sock
# node-driver-registrar appends a driver-unique filename to this path to avoid conflicts
# see https://github.com/stackabletech/secret-operator/issues/229 for why this path should not be too long
path: {{ .Values.kubeletDir }}/plugins_registry
- name: csi
hostPath:
path: /var/lib/kubelet/plugins/listeners.stackable.tech/
path: {{ .Values.kubeletDir }}/plugins/listeners.stackable.tech/
- name: mountpoint
hostPath:
path: /var/lib/kubelet/pods/
path: {{ .Values.kubeletDir }}/pods/
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/listener-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ nodeSelector: {}
tolerations: []

affinity: {}

# Kubelet dir may vary in environments such as microk8s, see https://github.com/stackabletech/secret-operator/issues/229
kubeletDir: /var/lib/kubelet
5 changes: 5 additions & 0 deletions docs/modules/ROOT/pages/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ $ helm install listener-operator stackable/listener-operator

Helm will deploy the operator in Kubernetes containers and apply the CRDs. You're now ready to expose services!

=== Microk8s

Microk8s uses a non-standard Kubelet state directory. Installing listener-operator on Microk8s requires the argument
`--set kubeletDir=/var/snap/microk8s/common/var/lib/kubelet` to be added to the `helm install` command.

== Building the operator from source

See xref:building.adoc[] for more information.
18 changes: 15 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"crate2nix": {
"branch": "master",
"description": "nix build file generator for rust crates",
"homepage": "",
"owner": "kolloch",
"repo": "crate2nix",
"rev": "fd2b9cf70ef55529b6793036b648ce2d9e2e7ba1",
"sha256": "0cc15msc0c3asmilr1czsjf4vbzqzj13w3ff33nyq6gxq3md84k3",
"type": "tarball",
"url": "https://github.com/kolloch/crate2nix/archive/fd2b9cf70ef55529b6793036b648ce2d9e2e7ba1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "nixpkgs-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3bbb296d9a0088c314ce83038b896753bbe33acb",
"sha256": "0dlq1zjcki30k2afg749a7c34vyb86sx1irab48l2g214nhj83hw",
"rev": "006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5",
"sha256": "14qnwll8kfx02k259i3rahs2zbiacfzcsswrbjvnjks3fkl90w0g",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/3bbb296d9a0088c314ce83038b896753bbe33acb.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}