LoginSignup
1
0

More than 3 years have passed since last update.

KubernetesでNginxを複数起動するPodを起動してホスト名が書かれたインデックスファイルを作る

Posted at

Deployment起動

kubectl run aks-nginx-deployment --image=nginx --labels="app=nginx" --replicas=3

ホスト名をこぴる

for PODNAME in `kubectl get pods -l app=nginx \
-o jsonpath='{.items[*].metadata.name}'` ; \
do kubectl exec -it ${PODNAME} -- \
cp /etc/hostname /usr/share/nginx/html/index.html; \
done
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0