Upgrade to Pro — share decks privately, control downloads, hide ads and more …

入門!ClusterAPI 〜 k8s クラスターも k8s API で管理したい 〜 / k...

入門!ClusterAPI 〜 k8s クラスターも k8s API で管理したい 〜 / k8s_meetup_31

Ryo Takaishi

May 27, 2020
Tweet

More Decks by Ryo Takaishi

Other Decks in Technology

Transcript

  1. @r_takaishi Software Engineer @ GMO Pepabo, Inc. Belgian / Craft

    Beer ☕ Tea Go, Kubernetes https://repl.info/ Cloud Native Meetup Tokyo CloudNative Days Tokyo 2020 5BLBJTIJ3ZP
  2. $MVTUFS"1*ͬͯԿʁ w ,VCFSOFUFTΫϥελʔΛ؅ཧ͢ΔͨΊͷ"1* w ,VCFSOFUFTͷ"1*Ͱ,VCFSOFUFTΛ؅ཧͰ͖Δ w ύϒϦοΫΫϥ΢υɺϓϥΠϕʔτΫϥ΢υɺϕΞϝλϧͳͲ༷ʑͳΠϯϑϥͰར༻Մೳ w $3%ͱ$VTUPN$POUSPMMFSɺ$-*πʔϧͰߏ੒͞Ε͍ͯΔ w

    $3%LTͷ"1*Λ֦ு͠ɺಠࣗͷϦιʔεΛఆٛ͢ΔͨΊͷػೳ w $VTUPN$POUSPMMFSLT্ͷϦιʔεͷ࡞੒΍ߋ৽ɺ࡟আʹ൓Ԡͯ͠Կ͔͠Βͷॲཧ Λߦ͏ϓϩάϥϜɻ$3%ͱҰॹʹ࡞Δ͜ͱ͕͋Δ
  3. $MVTUFS"1*ͷؔ܎ऀͨͪΛ঺հ ͬ͘͟Γ͍͏ͱ͜Μͳײ͡ 8PSLMPBE$MVTUFS .BOBHFNFOU$MVTUFS )VNBO 8PSLMPBE$MVTUFS 8PSLMPBE$MVTUFS "QQMZ8PSLMPBE $MVTUFS`TNBOJGFTUT .BOBHF8PSLMPBE

    $MVTUFST NBOJGFTUT DMVTUFSDUM )BOEMJOHMJGFDZDMFPGB $MVTUFS"1* w )VNBO w ࢲͰ͢ w .BOBHFNFOU$MVTUFS w ΫϥελʔΛ؅ཧ͢Δͨ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SPM1MBOFϊʔυΛ؅ཧ͢ΔͨΊͷ$3%ͱίϯτϩʔϥʔ #PPUTUSBQ1SPWJEFS %BUB1MBOFϊʔυ͕LTΫϥελʔʹࢀՃ͢ΔͨΊͷ$MPVE*OJUεΫϦϓτΛੜ੒͢ΔͨΊͷ$3% ͱίϯτϩʔϥʔ $MVTUFS 8PSLMPBE$MVTUFSͷTQFDΛදݱ .BDIJOF ,VCFSOFUFTͷϊʔυΛϗετ͢Δ7.΍෺ཧϚγϯ DMVTUFSDUM .BOBHFNFOU$MVTUFS্ͷ$MVTUFS"1*΍ϓϩόΠμʔΛ؅ཧ͢Δ$-*πʔϧ
  6. LTͷߏஙɾӡ༻ɺߟ͑ͳ͍ͱ͍͚ͳ͍͜ͱ͕ଟ͍ w FUDEͷΫϥελʔ࡞੒ w ίϯτϩʔϧϓϨʔϯ BQJTFSWFS DPOUSPMMFSNBOBHFS TDIFEVMFS ͷ)" w

    ίϯτϩʔϧϓϨʔϯͷ୆਺૿ݮ w /PEFΛͲ͏ΫϥελʔʹࢀՃͤ͞Δ͔ w /PEFͷ୆਺૿ݮ w LTͷόʔδϣϯΞοϓ ίϯτϩʔϧϓϨʔϯ  w LTͷόʔδϣϯΞοϓ σʔλϓϨʔϯ  w JOQMBDFVQHSBEF͢Δʁ/PEFͷ3PMMJOHVQEBUF͢Δʁ w ো֐࣌ͷΦϖϨʔγϣϯࣗಈԽɺΦʔτώʔϧ
  7. LTʹLTͷ؅ཧΛ೚ͤΔ w LT͕༷࣋ͭʑͳػೳ w એݴతϞσϧʢ%FDMBSBUJWF.PEFMʣ w ௐ੔ϧʔϓʢ3FDPODJMJBUJPO-PPQʣ w ߴ͍֦ுੑʢ&YUFOEBCJMJUZʣ w

    LTͰLTΛ؅ཧ͢Δ͜ͱͰɺߏஙɾߋ৽ɾࣗಈ෮چͳͲΛLTͷϫʔΫϩʔυʹ ࡌͤΔ͜ͱ͕Ͱ͖Δ w ͜ΕΛ໨ࢦ͍ͯ͠Δͷ͕$MVTUFS"1*
  8. .BOBHFNFOU$MTVUFSΛ༻ҙ͢Δ ࠓճ͸LJOEͰ༻ҙ͠·͢ ~/s/g/t/h/cluster-api $ kind create cluster Creating cluster "kind"

    ... ✓ Ensuring node image (kindest/node:v1.17.0) ✓ Preparing nodes ✓ Writing configuration ✓ Starting control-plane ✓ Installing CNI ✓ Installing StorageClass Set kubectl context to "kind-kind" You can now use your cluster with: kubectl cluster-info --context kind-kind Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community
  9. .BOBHFNFOU$MVTUFSʹ֤छ1SPWJEFSΛΠϯετʔϧ͢Δ "84ͷ৔߹ɺ*".3PMF΍1PMJDZͷ࡞੒͕ඞཁ ~/s/g/t/h/cluster-api $ set -x AWS_REGION ap-northeast-1 ~/s/g/t/h/cluster-api $

    set -x AWS_ACCESS_KEY_ID XXXXXXXXXXXXXXXXXX ~/s/g/t/h/cluster-api $ set -x AWS_SECRET_ACCESS_KEY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ~/s/g/t/h/cluster-api $ set -x AWS_B64ENCODED_CREDENTIALS (clusterawsadm alpha bootstrap encode-aws-credentials) ~/s/g/t/h/cluster-api $ clusterawsadm alpha bootstrap create-stack Attempting to create CloudFormation stack cluster-api-provider-aws-sigs-k8s-io Following resources are in the stack: [snip] ~/s/g/t/h/cluster-api $ clusterctl init --infrastructure aws Fetching providers Installing cert-manager Waiting for cert-manager to be available... Installing Provider="cluster-api" Version="v0.3.6" TargetNamespace="capi-system" Installing Provider="bootstrap-kubeadm" Version="v0.3.6" TargetNamespace="capi-kubeadm-bootstrap-system" Installing Provider="control-plane-kubeadm" Version="v0.3.6" TargetNamespace="capi-kubeadm-control-plane-system" Installing Provider="infrastructure-aws" Version="v0.5.3" TargetNamespace="capa-system" Your management cluster has been initialized successfully! You can now create your first workload cluster by running the following: clusterctl config cluster [name] --kubernetes-version [version] | kubectl apply -f -
  10. 8PSLMPBE$MVTUFS༻ͷϚχϑΣετΛ࡞Δ DMVTUFSDUMͰੜ੒Ͱ͖ΔͷͰϚδָ ~/s/g/t/h/cluster-api $ set -x AWS_REGION ap-northeast-1 ~/s/g/t/h/cluster-api $

    set -x AWS_SSH_KEY_NAME r_takaishi ~/s/g/t/h/cluster-api $ set -x AWS_CONTROL_PLANE_MACHINE_TYPE t3.large ~/s/g/t/h/cluster-api $ set -x AWS_NODE_MACHINE_TYPE t3.large ~/s/g/t/h/cluster-api $ ~/s/g/t/h/cluster-api $ clusterctl config cluster capi-quickstart \ --kubernetes-version v1.17.3 \ --control-plane-machine-count=3 \ --worker-machine-count=3 \ > capi-quickstart.yaml
  11. ϚχϑΣετΛ.BOBHFNFOU$MVTUFSʹ"QQMZ͢Δ ~/s/g/t/h/cluster-api $ kubectl apply -f ./capi-quickstart.yaml cluster.cluster.x-k8s.io/capi-quickstart created awscluster.infrastructure.cluster.x-k8s.io/capi-quickstart

    created kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capi-quickstart-control-plane created awsmachinetemplate.infrastructure.cluster.x-k8s.io/capi-quickstart-control-plane created machinedeployment.cluster.x-k8s.io/capi-quickstart-md-0 created awsmachinetemplate.infrastructure.cluster.x-k8s.io/capi-quickstart-md-0 created kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/capi-quickstart-md-0 created
  12. ϚχϑΣετΛ.BOBHFNFOU$MVTUFSʹ"QQMZ͢Δ .BDIJOF͕߹ܭ୆ɺ3VOOJOHʹͳΔͷΛ଴ͭ ~/s/g/t/h/cluster-api $ kubectl get machines NAME PROVIDERID PHASE

    capi-quickstart-control-plane-2m7ck aws:////i-027f6e66f98403f3f Running capi-quickstart-control-plane-b9gxh aws:////i-016b3f1b2cf5a2373 Running capi-quickstart-control-plane-k5xd6 aws:////i-04148f036ef11291e Running capi-quickstart-md-0-75648fff48-4tbvk aws:////i-003c695ef1fb65f3e Running capi-quickstart-md-0-75648fff48-67fkb aws:////i-03e906e8044db1e33 Running capi-quickstart-md-0-75648fff48-wx7wf aws:////i-0b671868de735956b Running
  13. 8PSLMBPE$MVTUFS͕׬੒ ͜ͷ࣌఺Ͱ͸$/*͕Πϯετʔϧ͞Ε͍ͯͳ͍ ~/s/g/t/h/cluster-api $ kubectl --namespace=default get secret/capi-quickstart-kubeconfig -o jsonpath={.data.value}

    \ | base64 --decode \ > ./capi-quickstart.kubeconfig ~/s/g/t/h/cluster-api $ kubectl --kubeconfig ./capi-quickstart.kubeconfig get node NAME STATUS ROLES AGE VERSION ip-10-0-0-123.ap-northeast-1.compute.internal NotReady <none> 5m58s v1.17.3 ip-10-0-0-177.ap-northeast-1.compute.internal NotReady <none> 5m54s v1.17.3 ip-10-0-0-185.ap-northeast-1.compute.internal NotReady master 9m13s v1.17.3 ip-10-0-0-190.ap-northeast-1.compute.internal NotReady master 93s v1.17.3 ip-10-0-0-20.ap-northeast-1.compute.internal NotReady master 4m24s v1.17.3 ip-10-0-0-215.ap-northeast-1.compute.internal NotReady <none> 5m57s v1.17.3
  14. 8PSLMBPE$MVTUFS͕׬੒ DBMJDPΛΠϯετʔϧͯ͠ɺ/PEFΛ3FBEZʹ͢Δ ~/s/g/t/h/cluster-api $ kubectl --kubeconfig=./capi-quickstart.kubeconfig \ apply -f https://docs.projectcalico.org/v3.12/manifests/calico.yaml

    ~/s/g/t/h/cluster-api $ kubectl --kubeconfig ./capi-quickstart.kubeconfig get node NAME STATUS ROLES AGE VERSION ip-10-0-0-123.ap-northeast-1.compute.internal Ready <none> 7m44s v1.17.3 ip-10-0-0-177.ap-northeast-1.compute.internal Ready <none> 7m40s v1.17.3 ip-10-0-0-185.ap-northeast-1.compute.internal Ready master 10m v1.17.3 ip-10-0-0-190.ap-northeast-1.compute.internal Ready master 3m19s v1.17.3 ip-10-0-0-20.ap-northeast-1.compute.internal Ready master 6m10s v1.17.3 ip-10-0-0-215.ap-northeast-1.compute.internal Ready <none> 7m43s v1.17.3
  15. 8PSLMBPE$MVTUFS͕׬੒ Ϋϥελʔ΍ίϯτϩʔϧϓϨʔϯΛݟͯΈΔͱ͜Μͳײ͡ # クラスターはプロビジョニングされたことがわかる ~/s/g/t/h/cluster-api $ kubectl get clusters NAME

    PHASE capi-quickstart Provisioned # コントロールプレーンはレプリカ3台 # なぜかREADY REPLICASが2のまま… ~/s/g/t/h/cluster-api $ kubectl get kubeadmcontrolplane NAME READY INITIALIZED REPLICAS READY REPLICAS UPDATED REPLICAS UNAVAILABLE REPLICAS capi-quickstart-control-plane true true 3 2 3 1 # データプレーンもレプリカ3台 ~/s/g/t/h/cluster-api $ kubectl get machinedeployments NAME PHASE REPLICAS AVAILABLE READY capi-quickstart-md-0 Running 3 3 3
  16. $MVTUFS"1*ͷؔ܎ऀʹ͍ͭͯʢ࠶ܝʣ .BOBHFNFOU$MVTUFS )VNBO 8PSLMPBE$MVTUFS "84 0QFO4UBDL .FUBM DBQBDPOUSPMMFSNBOBHFS DBQPDPOUSPMMFSNBOBHFS DBQNDPOUSPMMFSNBOBHFS

    DMVTUFSBQJDPOUSPMMFSNBOBHFS *OGSBTUSVDUVSF1SPWJEFS #PPUTUSBQ1SPWJEFS LVCFBENCPPUTUSBQDPOUSPMMFS $POUSPM1MBOF1SPWJEFS LVCFBENDPOUSPMQMBOFDPOUSPMMFS )BOEMJOHMJGFDZDMFPGB $MVTUFS"1* NBOJGFTUT DMVTUFSDUM )BOEMJOHMJGFDZDMFPGB 8PSLMPBE$MVTUFS 8PSLMPBE$MVTUFS 8PSLMPBE$MVTUFS 8PSLMPBE$MVTUFS 8PSLMPBE$MVTUFS 8PSLMPBE$MVTUFS
  17. ΧελϜϦιʔεͷؔ܎ Ұ෦ʣ $MVTUFS "84$MVTUFS ,VCFBEN$POUSPM1MBOF "84.BDIJOF5FNQMBUF .BDIJOF "84.BDIJOF ,VCFBEN$POpH .BDIJOF%FQMPZNFOU

    "84.BDIJOF5FNQMBUF ,VCFBEN$POpH5FNQMBUF .BDIJOF4FU .BDIJOF "84.BDIJOF ,VCFBEN$POpH 0CKFDU3FGFSFODF 0X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,VCFBEN$POUSPM1MBOF "84.BDIJOF5FNQMBUF .BDIJOF "84.BDIJOF ,VCFBEN$POpH .BDIJOF%FQMPZNFOU "84.BDIJOF5FNQMBUF

    ,VCFBEN$POpH5FNQMBUF .BDIJOF4FU .BDIJOF "84.BDIJOF ,VCFBEN$POpH 0CKFDU3FGFSFODF 0XOFS3FGFSFODF ⚠0XOFS3FGFSFODF͸෦෼తʹܝࡌ .BDIJOF .BDIJOF .BDIJOF .BDIJOF
  21. $MVTUFSͱ$POUSPM1MBOF LJOE$MVTUFS apiVersion: cluster.x-k8s.io/v1alpha3 kind: Cluster metadata: name: capi-quickstart namespace:

    default spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 controlPlaneRef: apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 kind: KubeadmControlPlane name: capi-quickstart-control-plane infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSCluster name: capi-quickstart w 1PEωοτϫʔΫͷઃఆ w ,VCFBEN$POUSPM1MBOF΁ͷࢀর w ίϯτϩʔϧϓϨʔϯΛ؅ཧ͢ΔͨΊͷΦϒδΣΫτ w "84$MVTUFS΁ͷࢀর
  22. $MVTUFSͱ$POUSPM1MBOF LJOE"84$MVTUFS apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSCluster metadata: name: capi-quickstart namespace:

    default spec: region: ap-northeast-1 sshKeyName: r_takaishi w "84ݻ༗ͷઃఆΛهड़ w Ϧʔδϣϯ΍44)Ωʔ
  23. $MVTUFSͱ$POUSPM1MBOF LJOE,VCFBEN$POUSPM1MBOF apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 kind: KubeadmControlPlane metadata: name: capi-quickstart-control-plane namespace:

    default spec: infrastructureTemplate: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate name: capi-quickstart-control-plane kubeadmConfigSpec: [snip] replicas: 3 version: v1.17.3 w ίϯτϩʔϧϓϨʔϯͷઃఆΛهड़ w ͜Ε͸,VCFBENͰߏங͢ΔͨΊͷϦιʔε w ϊʔυ୆਺ w "84ʹ࡞੒͢ΔϚγϯͷςϯϓϨʔτ΁ͷࢀর w ,VCFBENͷઃఆ
  24. $MVTUFSͱ$POUSPM1MBOF LJOE"84.BDIJOF5FNQMBUF apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate metadata: name: capi-quickstart-control-plane namespace:

    default spec: template: spec: iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io instanceType: t3.large sshKeyName: r_takaishi w ίϯτϩʔϧϓϨʔϯ༻Πϯελϯεͷઃఆ w ΠϯελϯελΠϓ΍44)Ωʔ໊ͳͲΛهड़
  25. *OGSBTUSVDUVSF3FG "84.BDIJOF ,VCFBEN$POpH $MVTUFSͱ$POUSPM1MBOF $MVTUFS "84$MVTUFS ,VCFBEN$POUSPM1MBOF "84.BDIJOF5FNQMBUF *OGSBTUSVDUVSF3FG $POUSPM1MBOF3FG

    *OGSBTUSVDUVSF5FNQMBUF BXTDMVTUFS@DPOUSPMMFS ࡞੒ɾߋ৽Λݕ஌ 71$΍αϒωοτͳͲɺ Ϋϥελʔ͕ඞཁͱ͢Δʮ7.Ҏ֎ͷʯϦιʔεΛ࡞੒ LVCFBEN@DPOUSPM@QMBOF@DPOUSPMMFS .BDIJOF .BDIJOF .BDIJOF ࡞੒ɾߋ৽Λݕ஌ .BDIJOF "84.BDIJOF ,VCFBEN$POpHΛ࡞੒ "84.BDIJOF "84.BDIJOF ,VCFBEN$POpH ,VCFBEN$POpH $POpH3FG BXTNBDIJOF@DPOUSPMMFS ࡞੒ɾߋ৽Λݕ஌ ಡΈࠐΈ ΠϯελϯεΛ࡞੒
  26. %BUB1MBOF .BDIJOF%FQMPZNFOU $MVTUFS "84$MVTUFS ,VCFBEN$POUSPM1MBOF "84.BDIJOF5FNQMBUF .BDIJOF "84.BDIJOF ,VCFBEN$POpH .BDIJOF%FQMPZNFOU

    "84.BDIJOF5FNQMBUF ,VCFBEN$POpH5FNQMBUF .BDIJOF4FU .BDIJOF "84.BDIJOF ,VCFBEN$POpH 0CKFDU3FGFSFODF 0XOFS3FGFSFODF ⚠0XOFS3FGFSFODF͸෦෼తʹܝࡌ .BDIJOF .BDIJOF .BDIJOF .BDIJOF
  27. %BUB1MBOF .BDIJOF%FQMPZNFOU LJOE.BDIJOF%FQMPZNFOU apiVersion: cluster.x-k8s.io/v1alpha3 kind: MachineDeployment metadata: name: capi-quickstart-md-0

    namespace: default spec: clusterName: capi-quickstart replicas: 3 selector: matchLabels: null template: spec: bootstrap: configRef: apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 kind: KubeadmConfigTemplate name: capi-quickstart-md-0 clusterName: capi-quickstart infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate name: capi-quickstart-md-0 version: v1.17.3 w σʔλϓϨʔϯ༻ͷϚγϯΛ؅ཧ͢Δ w ໾ׂͱͯ͠͸%FQMPZNFOUʹࣅ͍ͯΔ w ࡞੒͢ΔΠϯελϯεͷઃఆ΍ىಈ࣌ʹ࣮ߦ͢Δ $MPVE*OJUςϯϓϨʔτ΁ͷࢀরΛอ࣋͢Δ
  28. %BUB1MBOF .BDIJOF%FQMPZNFOU LJOE"84.BDIJOF5FNQMBUF apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate metadata: name: capi-quickstart-md-0

    namespace: default spec: template: spec: iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io instanceType: t3.large sshKeyName: r_takaishi w σʔλϓϨʔϯ༻Πϯελϯεͷઃఆ w ΠϯελϯελΠϓ΍44)Ωʔ໊ͳͲΛهड़
  29. %BUB1MBOF .BDIJOF%FQMPZNFOU ,VCFBEN$POpH5FNQMBUF apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 kind: KubeadmConfigTemplate metadata: name: capi-quickstart-md-0

    namespace: default spec: template: spec: joinConfiguration: nodeRegistration: kubeletExtraArgs: cloud-provider: aws name: '{{ ds.meta_data.local_hostname }}' w σʔλϓϨʔϯ༻ͷΠϯελϯε͕ىಈ͢Δࡍʹ࣮ߦ͢ Δ$MPVE*OJU༻ͷςϯϓϨʔτ
  30. %BUB1MBOF .BDIJOF%FQMPZNFOU .BDIJOF%FQMPZNFOU "84.BDIJOF5FNQMBUF ,VCFBEN$POpH5FNQMBUF .BDIJOF4FU *OGSBTUSVDUVSF3FG $POpH3FG NBDIJOFEFQMPZNFOU@DPOUSPMMFS ࡞੒ɾߋ৽Λݕ஌

    ࡞੒ NBDIJOFTFU@DPOUSPMMFS ࡞੒ɾߋ৽Λݕ஌ *OGSBTUSVDUVSF3FG "84.BDIJOF ,VCFBEN$POpH .BDIJOF .BDIJOF .BDIJOF .BDIJOF "84.BDIJOF ,VCFBEN$POpHΛ࡞੒ "84.BDIJOF "84.BDIJOF ,VCFBEN$POpH ,VCFBEN$POpH $POpH3FG BXTNBDIJOF@DPOUSPMMFS ࡞੒ɾߋ৽Λݕ஌ ಡΈࠐΈ ΠϯελϯεΛ࡞੒
  31. OPEFDPOUSPMMFSͱ͍͏ίϯτϩʔϥʔΛ࣮૷ w $MVTUFS"1*ͷϊʔυ؅ཧػೳ͚ͩΛऔΓग़ͯ͠ར༻ w .BDIJOF%FQMPZNFOU .BDIJOF4FU .BDIJOF w /ZBIʹ7.Λ࡞ΔͨΊͷ"1*ͱ$POUSPMMFSΛ௥Ճ࣮૷ w

    /ZBI.BDIJOFɺ/ZBI.BDIJOF5FNQMBUF w /ZBI.BDIJOF$POUSPMMFS w ࣮૷౰࣌ɺDMVTUFSBQJQSPWJEFSPQFOTUBDL͸WBMQIB͔ΒWBMQIB΁ϚΠ άϨʔγϣϯ్தͩͬͨͷͰࣗ෼Ͱ࡞ͬͨͱ͍͏ܦҢ͕͋Δ
  32. OPEFDPOUSPMMFSͷॲཧͷྲྀΕ จࣈ͕খͯ͘͞ಡΈʹ͔ͬͨ͘Β͝Ί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