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

Use sysctl Ansible module #60

Merged
merged 6 commits into from
Jun 5, 2023
Merged
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
7 changes: 5 additions & 2 deletions e2e/provision/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Vagrant.configure('2') do |config|
config.vm.box_check_update = false
config.vm.synced_folder './', '/vagrant'

config.vm.network 'forwarded_port', guest: 7007, guest_ip: '127.0.0.1', host: 7007
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, so in the vagrant case you do not need the -L in your ssh? We should document that. You will still need to do the kubectl port forwarding, unless we expose the UI on a 172.18.0.0/20 address. Which I think in general would be fine for the sandbox, even though there is no authentication on the UI in sandbox mode. I'll create a separate issue to discuss that.

config.vm.network 'forwarded_port', guest: 3000, guest_ip: '172.18.0.200', host: 3000
Copy link
Collaborator

@vjayaramrh vjayaramrh Jun 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, might be a good practice to open a separate PR when adding other functionalities.


# Initial setup
config.vm.provision 'shell', privileged: false, inline: <<-SHELL
if [ -f /etc/netplan/01-netcfg.yaml ] && ! grep -q '1.1.1.1, 8.8.8.8, 8.8.4.4' /etc/netplan/01-netcfg.yaml; then
Expand All @@ -35,15 +38,15 @@ Vagrant.configure('2') do |config|
config.vm.provision 'shell', privileged: false do |sh|
sh.env = {
DEBUG: ENV.fetch('DEBUG', true),
DEPLOYMENT_TYPE: ENV.fetch('DEPLOYMENT_TYPE', 'cluster-api')
DEPLOYMENT_TYPE: ENV.fetch('DEPLOYMENT_TYPE', 'r1')
}
sh.inline = <<-SHELL
set -o errexit
set -o pipefail

cd /vagrant/
cp nephio.yaml ~/nephio.yaml
./gce_run.sh | tee ~/gce_run.log
./gce_install_sandbox.sh | tee ~/gce_install_sandbox.log
SHELL
end

Expand Down
2 changes: 1 addition & 1 deletion e2e/provision/playbooks/roles/bootstrap/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ kubernetes_version: v1.27.1
gitea_postgres_password: c2VjcmV0 # echo -n "secret" | base64
gitea_db_password: c2VjcmV0

gitea_username: admin
gitea_username: nephio
johnbelamaric marked this conversation as resolved.
Show resolved Hide resolved
gitea_password: secret
38 changes: 18 additions & 20 deletions e2e/provision/playbooks/roles/bootstrap/tasks/system-setup.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
## © 2023 Nephio Authors
## Licensed under the Apache License 2.0
## SPDX-License-Identifier: Apache-2.0
---
- name: systctl config
become: true
lineinfile:
path: /etc/sysctl.conf
line: "{{ item }}"
with_items:
- fs.inotify.max_user_watches=524288
- fs.inotify.max_user_instances=512
- kernel.keys.maxkeys=500000
- kernel.keys.maxbytes=1000000
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2023 The Nephio Authors.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

- name: systctl config
- name: Set kernel parameters
become: true
shell: "{{ item }}"
with_items:
- sysctl fs.inotify.max_user_watches=524288
- sysctl fs.inotify.max_user_instances=512
- sysctl kernel.keys.maxkeys=500000
- sysctl kernel.keys.maxbytes=1000000
ansible.posix.sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
loop:
- {name: fs.inotify.max_user_watches, value: 524288}
- {name: fs.inotify.max_user_instances, value: 512}
- {name: kernel.keys.maxkeys, value: 500000 }
- {name: kernel.keys.maxbytes, value: 1000000}
5 changes: 3 additions & 2 deletions e2e/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ resource "google_compute_instance" "vm_instance" {
}
inline = [
"cd provision/",
"chmod +x gce_run.sh",
"DEBUG=true DEPLOYMENT_TYPE=cluster-api ./gce_run.sh"
"chmod +x gce_install_sandbox.sh",
"export DEBUG=true",
"timeout --preserve-status 30m ./gce_install_sandbox.sh"
]
}

Expand Down