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

(add) kubeadm install shell script #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
96 changes: 96 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@

# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,visualstudiocode,vagrant
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,visualstudiocode,vagrant

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Vagrant ###
# General
.vagrant/

# Log files (if you are creating logs in debug mode, uncomment this)
# *.log

### Vagrant Patch ###
*.box

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,visualstudiocode,vagrant
34 changes: 24 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,32 @@ Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/bionic64"
# config.vm.network "forwarded_port", guest: 3306, host:22 , protocol: "tcp"
config.disksize.size = "20GB"
config.vm.provider "virtualbox" do |vb|
# ���蓖�Ă郁�����[(MB)
vb.memory = 8192
# CPU�̐�
vb.memory = 8192
vb.cpus = 4
# I/O APIC�̗L����
# vb.customize ["modifyvm", :id, "--ioapic", "on"]
end

config.vm.define "master" do |atomic|
atomic.vm.hostname="master.atomichost"
atomic.vm.network "private_network", ip: "192.168.33.41"
end

config.vm.define "node01" do |atomic|
atomic.vm.hostname="node01.atomichost"
atomic.vm.network "private_network", ip: "192.168.33.42"
end

config.vm.define "node02" do |atomic|
atomic.vm.hostname="node02.atomichost"
atomic.vm.network "private_network", ip: "192.168.33.43"
end

config.vm.provision :shell, path: "./deployments/vm/docker-install.sh"
config.vm.provision :shell, path: "./deployments/vm/permission.sh"
config.vm.provision :shell, path: "./deployments/vm/kubeadm_install.sh"
# config.vm.provision :shell, path: "./deployments/vm/golang-install.sh"
end
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
Expand Down Expand Up @@ -72,7 +89,4 @@ Vagrant.configure("2") do |config|
# Enable provisioning with a shell script. Additional provisioners such as
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision :shell, path: "./deployments/vm/docker-install.sh"
config.vm.provision :shell, path: "./deployments/vm/permission.sh"
# config.vm.provision :shell, path: "./deployments/vm/golang-install.sh"
end

21 changes: 21 additions & 0 deletions demo/deployment/deployment-def.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: mywebsite
tier: frontend
spec:
replicas: 4
template:
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: nginx
image: nginx
selector:
matchLabels:
app: myapp
25 changes: 25 additions & 0 deletions demo/deployment/deployment-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deployment
labels:
app: myapp
type: front-end
spec:
template:
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: nginx-container
image: nginx:1.18

replicas: 6
selector:
matchLabels:
app: myapp



34 changes: 34 additions & 0 deletions demo/deployment/deployment_flask_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: Service
metadata:
name: hello-python-service
spec:
selector:
app: hello-python
ports:
- protocol: "TCP"
port: 6000
targetPort: 5000
type: LoadBalancer

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-python
spec:
selector:
matchLabels:
app: hello-python
replicas: 4
template:
metadata:
labels:
app: hello-python
spec:
containers:
- name: hello-python
image: hamamatcha/flask_app:latest
imagePullPolicy: Never
ports:
- containerPort: 5000
38 changes: 38 additions & 0 deletions demo/deployment/deployment_flask_app_def.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: Service
metadata:
name: hello-python-service
spec:
selector:
app: hello-python
ports:
- protocol: "TCP"
port: 6000
targetPort: 5000
type: LoadBalancer

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deployment
labels:
app: myapp
type: front-end
spec:
replicas: 4
selector:
matchLabels:
app: myapp
template:
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: flask-app-container
image: hamamatcha/flask_app
imagePullPolicy: Never
ports:
- containerPort: 5000
13 changes: 13 additions & 0 deletions demo/pod/pod-definition-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Pod
metadata:
name: postgres
labels:
app: db-tier
spec:
containers:
- name: postgres
image: postgres
env:
- name: POSTGRES_PASSWORD
value: mysecretpassword
11 changes: 11 additions & 0 deletions demo/pod/pod-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp

spec:
containers:
- name: nginx-container
image: nginx
19 changes: 19 additions & 0 deletions demo/pod/rc-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: myapp-rc
labels:
app: myapp
type: front-end
spec:
template:
metadata:
name: myapp-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
image: nginx
replicas: 3
22 changes: 22 additions & 0 deletions demo/pod/replicaset-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: myapp-replicaset
labels:
app: myapp
type: front-end
spec:
template:
metadata:
name: myapp-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
image: nginx
replicas: 2
selector:
matchLabels:
type: front-end
22 changes: 22 additions & 0 deletions demo/replicaset/replicaset-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: myapp-replicaset
labels:
app: myapp
type: front-end
spec:
template:
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: nginx-container
image: nginx

replicas: 5
selector:
matchLabels:
app: myapp
14 changes: 14 additions & 0 deletions demo/service/service-definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: myapp-service


spec:
type: NodePort
ports:
- targetPort: 80
port: 80
nodePort: 30008
selector:
app: myapp
Loading