This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Enable IP Forwarding permanently | |
ansible.builtin.copy: | |
content: net.ipv4.ip_forward = 1 | |
dest: /etc/sysctl.d/20-ipforward.conf | |
mode: "0644" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Bootstrap Kubernetes Control plane | |
hosts: node0 | |
become: true | |
gather_facts: true | |
tasks: | |
- name: Initiating configuration | |
debug: | |
msg: "Initiating configuration..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.define "node0" do |node| | |
node.vm.box = "ubuntu/jammy64" | |
# ... truncated ... | |
node.vm.provision "ansible" do |ansible| | |
ansible.verbose = "v" | |
ansible.playbook = "bootstrap-controlplane.yml" | |
ansible.compatibility_mode = "2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box = "ubuntu/jammy64" | |
common_script = <<-SCRIPT | |
export DEBIAN_FRONTEND=noninteractive | |
# To allow fetching logs from journalctl | |
usermod -aG adm vagrant | |
SCRIPT | |
Vagrant.configure("2") do |config| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: wordpress | |
stringData: | |
MARIADB_ROOT_PASSWORD: Wordpre5$ | |
MARIADB_PASSWORD: Wordpre5$ | |
WORDPRESS_DB_PASSWORD: Wordpre5$ | |
--- | |
apiVersion: v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Koa = require('koa') | |
const app = new Koa() | |
const PORT = process.env.PORT || 3000 | |
// logger | |
app.use(async (ctx, next) => { | |
await next() | |
const rt = ctx.response.get('X-Response-Time') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
# ref: https://www.mongodb.com/docs/v6.0/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition | |
sudo apt update | |
sudo apt upgrade -y | |
sudo apt-get install -y gnupg curl | |
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | | |
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
items: | |
- apiVersion: v1 | |
data: | |
nginx-fileserver.conf: | | |
server { | |
listen 80 backlog=1024; | |
location /healthz { | |
access_log off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
items: | |
- apiVersion: v1 | |
data: | |
favorite-color: red | |
names.txt: | | |
Alex | |
Jane | |
Sam | |
kind: ConfigMap |