kops icon indicating copy to clipboard operation
kops copied to clipboard

Kops : auto custom Labels with new instance groups not working

Open anupam4881 opened this issue 8 years ago • 3 comments

[root@ip-10-226-0-x ~]# kubectl version Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T19:48:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.4", GitCommit:"793658f2d7ca7f064d2bdf606519f9fe1229c381", GitTreeState:"clean", BuildDate:"2017-08-17T08:30:51Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} [root@ip-10-226-0-x ~]# kops version Version 1.7.1 (git-c69b811)

[root@ip-10-226-0-x ~]# kops create ig altworklife --subnet ap-south-1a,ap-south-1b

Hi Team,

kops has the concept of "instance groups", which are a group of similar machines. On AWS, they map to an AutoScalingGroup.

when I created three different new IG using kops , what I want is all new nodes of same IG automatically come up with one type of similar custom labels so that I can schedule container based on new label but I didn’t get any option or syntax.

When I tried to edit IG and add label ( name: altworklife under label tag ).

I tried custom label but nothing works default labels are only coming. My new added label name : altworklife is not coming : [root@ip-10-226-0-X ~]# kubectl get nodes --show-labels ip-172-20-49-X.ap-south-1.compute.internal Ready node 199d v1.7.4 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=t2.large,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=ap-south-1,failure-domain.beta.kubernetes.io/zone=ap-south-1a,kubernetes.io/hostname=ip-172-20-49-61.ap-south-1.compute.internal,kubernetes.io/role=node,node-role.kubernetes.io/node=

This is my IG yaml . which I created via kops create command.
Will appreciate if you also have solution for this via kops without this this is totally manual activity and there is no advantages.

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2018-07-03T08:57:53Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: altworklife spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11 machineType: t2.small maxSize: 1 minSize: 1 role: Node subnets:

  • ap-south-1a
  • ap-south-1b

Regards Anupam Narayan

anupam4881 avatar Jul 03 '18 09:07 anupam4881

Will appreciate if you provide any workaround to fix this.

Regards Anupam Narayan

anupam4881 avatar Jul 04 '18 04:07 anupam4881

@anupam4881 you're looking for the spec.nodeLabels parameter for the instance group. See: https://github.com/kubernetes/kops/blob/master/docs/instance_groups.md#adding-taints-or-labels-to-an-instance-group

cassandracomar avatar Jul 11 '18 17:07 cassandracomar

Yes working after implement like this .

apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2018-07-27T11:51:15Z labels: kops.k8s.io/cluster: altcluster.k8s.local name: altworklife spec: image: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11 machineType: t2.small maxSize: 4 minSize: 1 nodeLabels: name: altworklife role: Node subnets:

  • ap-south-1a
  • ap-south-1b

anupam4881 avatar Aug 30 '18 05:08 anupam4881