2016-10-12 4 views
-1

Die Vorlage generiert nicht den Bambus-Benutzer, den ich in der Cloud-Konfiguration eingerichtet habe. Ich ssh in meinen Cluster und sehe cat/etc/passwd, aber ich sehe diesen Benutzer nicht. Was könnte schief gehen?CoreOS Cloud-Konfiguration erstellt keinen Benutzer

 { 
 
      "AWSTemplateFormatVersion": "2010-09-09", 
 
      "Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", 
 
      "Mappings" : { 
 
       "RegionMap" : { 
 
    
 
        "us-west-2" : { 
 
         "AMI" : "ami-06af7f66" 
 
        } 
 
       } 
 
      }, 
 
      "Parameters": { 
 
      "InstanceType" : { 
 
       "Description" : "EC2 HVM instance type (m3.medium, etc).", 
 
       "Type" : "String", 
 
       "Default" : "t2.small", 
 
       "AllowedValues" : [ "t2.micro", "m3.medium", "i2.4xlarge", "i2.8xlarge", "r3.large", "r3.xlarge", "r3.2xlarge","r3.4xlarge", "r3.8xlarge", "t2.micro", "t2.small", "t2.medium" ], 
 
       "ConstraintDescription" : "Must be a valid EC2 HVM instance type." 
 
      }, 
 
      "myVPC": { 
 
       "Type": "AWS::EC2::VPC::Id", 
 
       "Description": "The VPC Id where the instances will be deployed into." 
 
      }, 
 
      "SecurityGroupId":{ 
 
       "Type": "List<AWS::EC2::SecurityGroup::Id>", 
 
       "Description": "Security group to launch instances into." 
 
      }, 
 
      "SubnetId":{ 
 
       "Type": "List<AWS::EC2::Subnet::Id>", 
 
       "Description": "VPC group to launch instances into." 
 
      }, 
 
      "ClusterSize": { 
 
       "Default": "3", 
 
       "MinValue": "3", 
 
       "MaxValue": "12", 
 
       "Description": "Number of nodes in cluster (3-12).", 
 
       "Type": "Number" 
 
      }, 
 
      "DiscoveryURL": { 
 
       "Description": "An unique etcd cluster discovery URL. Grab a new token from https://discovery.etcd.io/new?size=<your cluster size>", 
 
       "Type": "String" 
 
      }, 
 
      "AdvertisedIPAddress": { 
 
       "Description": "Use 'private' if your etcd cluster is within one region or 'public' if it spans regions or cloud providers.", 
 
       "Default": "private", 
 
       "AllowedValues": ["private", "public"], 
 
       "Type": "String" 
 
      }, 
 
      "KeyPair" : { 
 
       "Description" : "The name of an EC2 Key Pair to allow SSH access to the instance.", 
 
       "Type" : "AWS::EC2::KeyPair::KeyName" 
 
      } 
 
      }, 
 
      "Resources": { 
 
      "CoreOSServerAutoScale": { 
 
       "Type": "AWS::AutoScaling::AutoScalingGroup", 
 
       "Properties": { 
 
       "LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"}, 
 
       "VPCZoneIdentifier": {"Ref":"SubnetId"}, 
 
       "MinSize": "3", 
 
       "MaxSize": "12", 
 
       "DesiredCapacity": {"Ref": "ClusterSize"}, 
 
       "Tags": [ 
 
        {"Key": "Name", "Value": { "Ref" : "AWS::StackName" }, "PropagateAtLaunch": true} 
 
       ] 
 
       } 
 
      }, 
 
    
 
      "CoreOSServerLaunchConfig": { 
 
       "Type": "AWS::AutoScaling::LaunchConfiguration", 
 
       "Properties": { 
 
       "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, 
 
       "InstanceType": {"Ref": "InstanceType"}, 
 
       "KeyName": {"Ref": "KeyPair"}, 
 
       "SecurityGroups": {"Ref": "SecurityGroupId"}, 
 
       "UserData" : { "Fn::Base64": 
 
        { "Fn::Join": [ "", [ 
 
        "#cloud-config\n\n", 
 
        " users:\n", 
 
        " - name: bamboo\n", 
 
        "  groups:\n", 
 
        "  - sudo\n", 
 
        "  - docker\n", 
 
        "  - fleet\n", 
 
        "  - systemd\n", 
 
        "  - wheel\n", 
 
        "  - bamboo\n", 
 
        "  ssh-authorized-keys:\n", 
 
        "  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKT3QjGuTD4sdBfKZZm1cOz2gXBH546vGizsDGf3LEQC63QduU1CPQBvTG742H5yVix7y+qvZPTYlvQ1ysK6ezhbGeu+lT0WoI8YT4x2Pqe/F40WGn/SMv3ckELQhKH3gp9HC1z/ITxYVgTksKGGXgNO6G8w8J+XaC1hyYntyOz531GAly9szCxtPQJQCz1fS3fdjSPEM+7TyuwH240S/Aa0R0XGUt24xH4zyifmUjrvGq4AaHIFUyWO3XnEc/3kdA2uUQlV/2o7z9xE0WhYPWm2oReHXNuoOCQutTCYwNKaTI+Y/vGtGxsCmIQWVoY4Afg2nL0MQ1Mnfw3DddQJvB [email protected]_agent_fleetctl \n", 
 
        "coreos:\n", 
 
        " etcd2:\n", 
 
        " discovery: ", { "Ref": "DiscoveryURL" }, "\n", 
 
        " advertise-client-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2379\n", 
 
        " initial-advertise-peer-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2380\n", 
 
        " listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001\n", 
 
        " listen-peer-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2380\n", 
 
        " units:\n", 
 
        " - name: etcd2.service\n", 
 
        "  command: start\n", 
 
        " - name: fleet.service\n", 
 
        "  command: start\n" 
 
         ] ] 
 
        } 
 
       } 
 
       } 
 
      } 
 
      } 
 
     }

Der Cluster erzeugt wird und funktioniert gut, aber ich sehe nicht, dass Benutzer. Gibt es einen Ort, an dem ich Logs sehen kann, warum die Benutzergeneration nicht aufgetreten ist?

Antwort

0

Ihre eigentliche Frage zu beantworten, können Sie die Protokolle sehen können, was mit dem Cloud-Config passiert journalctl --identifier=coreos-cloudinit

Sie können auch mit dem online validator oder durch coreos-cloudinit -validate auf Ihrem CoreOS Maschine läuft mit Ihrer Cloud-config validieren.

Wie auch immer, wenn Sie sich Ihre Konfiguration ansehen, haben Sie den users block über-eingerückt.

Folgendes sollte funktionieren:

#cloud-config 
users: 
    - name: bamboo 
    groups: 
     - sudo 
     - docker 
     - fleet 
     - systemd 
     - wheel 
     - bamboo 
    ssh-authorized-keys: 
     - ssh-rsa <RSA Public Key> [email protected]_agent_fleetctl 
coreos: 
    etcd2: 
    discovery: {Ref":DiscoveryURL" }, 
    advertise-client-urls: http://$ {Ref":AdvertisedIPAddress" },_ipv4:2379 
    initial-advertise-peer-urls: http://$ {Ref":AdvertisedIPAddress" },_ipv4:2380 
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 
    listen-peer-urls: http://$ {Ref":AdvertisedIPAddress" },_ipv4:2380 
    units: 
    - name: etcd2.service 
     command: start 
    - name: fleet.service 
     command: start 
Verwandte Themen