【kubernetes】 【k3s】ec2インスタンスでk3sを使う

yum -y install wget
cd /usr/local/bin/
wget https://github.com/rancher/k3s/releases/download/v0.2.0/k3s
chmod 755 ./k3s
k3s server &
# k3s kubectl get node
NAME STATUS ROLES
AGE VERSION
ip-172-31-37-113.ap-northeast-1.compute.internal Ready <none>
99s v1.13.4-k3s.1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.5
ports:
- containerPort: 80
k3s kubectl apply -f nginx-deployment.yaml
k3s kubectl expose deployment/nginx --type="NodePort" --port 80
[root@ip-172-31-37-113 bin]# k3s kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
AGE
kubernetes ClusterIP 10.43.0.1 <none> 443/TCP
12m
nginx NodePort 10.43.18.161 <none> 80:30845/TCP
47s
[root@ip-172-31-37-113 bin]# curl -i http://localhost:30845
HTTP/1.1 200 OK
Server: nginx/1.7.5
Date: Wed, 18 Sep 2019 02:25:19 GMT
Content-Type: text/html
https://tech-lab.sios.jp/archives/13564
https://qiita.com/lughshot/items/5f7165c1fc5b55779746