$kopscreate-fmycluster.yaml$kopscreatesecret--name ${NAME} sshpublickeyadmin-i~/.ssh/id_rsa.pub$kopsupdatecluster ${NAME} --yes$kopskopsvalidatecluster# validate cluster is check for your cluster state
# this is for Kubernetes Administrator# you must change this the value of 'certificate-authority-data' with your ca.apiVersion:v1clusters:- cluster: certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMwekNDQWJ1Z0F3SUJBZ0lNRmFlcHBua0lEUnRwNkpub01BMEdDU3FHU0liM0RRRUJDd1VBTUJVeEV6QVIKQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13SGhjTk1Ua3dOakV4TURVd05USTRXaGNOTWprd05qRXdNRFV3TlRJNApXakFWTVJNd0VRWURWUVFERXdwcmRXSmxjbTVsZEdWek1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBCk1JSUJDZ0tDQVFFQXpmMzlOOUIvaGpUQnViM0tETEhzM1NJUmhVL2pVcUt2RWhTWnpCQngwR0tXNmtONmRUVkkKK3dwUnRoeU9Yd2ZWRHA4RmxRYUFYbWt0UGtGTG9jU2VSelBUWXRod1VBamhSbVNoZFJtcW1yaXBZTlhFdEZYMAp6SkZFS2NRNDJ0TEhYanZZbVc3SGxYc0FDSDRCKy82SEtwVmxGSVdNTDAwb2tTUmEzZVBvdTdWYzlqTkZhd3R0CmFoMThrNStLcHVoL0FyUEs2dmdhcEhLclB2dUNaZG9FWkNtaE4rSVdZTjN6Uk1Wb1A1TEVoTEx5RFFzUzYvN0sKQ3prQ09Pam1QWW01UmxnOVRvb25ZcStwbS9LMXc4V1NLVnZick9VZXF0dXkxUlJYWUxtc0VNVmx0NDRQSS9YTgpEeUlubmtpVmRwc1A4ejAwRjZ5MGEwYXFpT3RGUVVyd3NRSURBUUFCb3lNd0lUQU9CZ05WSFE4QkFmOEVCQU1DCkFRWXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFqUm5ndnJ6SmRMWm8KRFdlbVFaMi83N0xLTmkzTmpRQU9NZUg3WXVpZnlNbTZNdTB2V3F6UU54SDJ1TGhFd0JRN0VocEpYSnFoMmp0dQpldnR6YUF6N2o5MEVKdlN6WHRtSDRQaHd1NFZFMHJWRGVlbUhrMXRZRjhsQ3hVM2xtZFRGZjJ4M29qVnVKNndpCkd3c3RaU0s5V2J5VW53RjNLUXdkMndmd3VUVVpSRGtuSkI2ZGhOcUxNakN3V1M1ekpDUjcvYXFuM0tqb0xvWEgKWkI1VW1UcGd2Sm9rWm0wcUF0ODRNS0hFb2ZCYXJ0M1BUcnplWGI0N1VHRlMrM0h1anVQUTBreW1DT0crK1ZEMwo0K0M5eVlXaTRhYnd6SE9rTmQvMlFKZVoyQjhjbjhlVU5kUGFSSnkweS9keVpSd0NZdXFKSkxZeTVGUTFiQlUwCm96bThnMG01ZWc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
server:https://api.yourcluster.comname:yourcluster.comcontexts:- context:cluster:yourcluster.comuser:kubernetes-adminname:awscurrent-context:awskind:Configpreferences: {}users:- name:kubernetes-adminuser:exec:apiVersion:client.authentication.k8s.io/v1alpha1args: - token - -i - api.yourcluster.com - -r - arn:aws:iam::<account id>:role/K8sAdmincommand:aws-iam-authenticatorenv:null
~/kube/.config (Developer)
# this is for Kubernetes Developer# you must change this the value of 'certificate-authority-data' with your ca.apiVersion:v1clusters:- cluster: certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMwekNDQWJ1Z0F3SUJBZ0lNRmFlcHBua0lEUnRwNkpub01BMEdDU3FHU0liM0RRRUJDd1VBTUJVeEV6QVIKQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13SGhjTk1Ua3dOakV4TURVd05USTRXaGNOTWprd05qRXdNRFV3TlRJNApXakFWTVJNd0VRWURWUVFERXdwcmRXSmxjbTVsZEdWek1JSUJJakFOQmdrcWhraUc5dzBC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xZeTVGUTFiQlUwCm96bThnMG01ZWc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
server:https://api.yourcluster.comname:yourcluster.comcontexts:- context:cluster:yourcluster.comnamespace:development#you will notiace this. This is means developere default namesapce is development.user:kubernetes-developername:awscurrent-context:awskind:Configpreferences: {}users:- name:kubernetes-developeruser:exec:apiVersion:client.authentication.k8s.io/v1alpha1args: - token - -i - api.yourcluster.com - -r - arn:aws:iam::<account id>:role/K8sDevelopercommand:aws-iam-authenticatorenv:null
Terminal
$ wget https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.4.0/aws-iam-authenticator_0.4.0_linux_amd64
$chmod+xaws-iam-authenticator_0.4.0_linux_amd64$sudomvaws-iam-authenticator_0.4.0_linux_amd64/usr/local/bin/aws-iam-authenticator$aws-iam-authenicatorversion{"Version":"0.4.0","Commit":"9999cd8047782c94c08e2d24b77dc9488947aa03"}$kubectlgetnodes# test what you authorized
# setup with your administrator account.$kubectlcreate-falb-rbac.yaml$kubectlcreate-falb-ingress-controller.yaml$kubectlgetpod-nkube-system
Ingress controller setup လုပ်ပီးနောက် external DNS အတွက် DNS records များကို Ingress create လုပ်လိုက်သည်နှင့် တပြိုင်နက်ထဲ AWS route 53 တွင် automatically update ပြုလုပ်သွားရန် အောက်ဖော်ပြပါ service account, rbac for external dns, deployment များကို ဆက်လက်တည်ဆောက်ရမည်ဖြစ်သည်။
external-dns.yaml
apiVersion:v1kind:ServiceAccountmetadata:name:external-dns---apiVersion:rbac.authorization.k8s.io/v1beta1kind:ClusterRolemetadata:name:external-dnsrules:- apiGroups: [""]resources: ["services"]verbs: ["get","watch","list"]- apiGroups: [""]resources: ["pods"]verbs: ["get","watch","list"]- apiGroups: ["extensions"] resources: ["ingresses"] verbs: ["get","watch","list"]- apiGroups: [""]resources: ["nodes"]verbs: ["list"]---apiVersion:rbac.authorization.k8s.io/v1beta1kind:ClusterRoleBindingmetadata:name:external-dns-viewerroleRef:apiGroup:rbac.authorization.k8s.iokind:ClusterRolename:external-dnssubjects:- kind:ServiceAccountname:external-dnsnamespace:kube-system---apiVersion:extensions/v1beta1kind:Deploymentmetadata:name:external-dnsspec:strategy:type:Recreatetemplate:metadata:labels:app:external-dnsspec:serviceAccountName:external-dnscontainers: - name:external-dnsimage:registry.opensource.zalan.do/teapot/external-dns:v0.5.9args: - --source=service - --source=ingress - --domain-filter=yourcluster.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
- --provider=aws - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
- --aws-zone-type=public # only look at public hosted zones (valid values are public, private or no value for both)
- --registry=txt - --txt-owner-id=my-identifier
Terminal
$kubectlcreate-fexternal-dns.yaml
ယခုအခြေအနေတွင်အားလုံးတည်ဆောက်ပြီး ဖြစ်ပါသည်။
တည်ဆောက်ခဲ့သည့် Cluster, IAM authentication and k8s RBAC, ALB ingress and automatic external DNS service များကို စမ်းသပ်ရန်အတွက် အောက်ဖော်ပြပါ 2048 web application game ဖြင့်စမ်းသပ်နိုင်ပါသည်။