jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.56k stars 4.02k forks source link

Consul configuration in kubernets not properly setup #11156

Closed smouelhi closed 4 years ago

smouelhi commented 4 years ago
Overview of the issue

When calling the kubernetes subgenerator and having consul as a service registry, the configuration generated is missing some mandatory parameters (selector for the stateful-set).

Motivation for or Use Case

The YAML configuration generated is missing mandatory parameter.

Reproduce the error

Create JHipster project with Consul as Service registry, use the kubernetes subgenerator, run the following command for unit testing "kubectl apply -f registry/", it will fail at the creation of the statefulset

Related issues

N/A

Suggest a Fix

Add the sts missing field, at spec level as mentioned in the hashicorp documentation: https://www.consul.io/docs/platform/k8s/run.html

JHipster Version(s)

V6.6.0

JHipster configuration
JHipster Version(s)
hrm@0.0.0 /Users/seif/Documents/Projects/zand/solutions/hrm-solution/hrm
└── generator-jhipster@6.6.0 
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.zand.bank.services.hr",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.6.0",
    "applicationType": "microservice",
    "baseName": "HRM",
    "packageName": "com.zand.bank.services.hr",
    "packageFolder": "com/zand/bank/services/hr",
    "serverPort": "8081",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "consul",
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
    "embeddableLaunchScript": false,
    "testFrameworks": ["cucumber"],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "clientPackageManager": "npm",
    "nativeLanguage": "en",
    "languages": ["en", "ar-ly"],
    "blueprints": [],
    "skipClient": true,
    "skipUserManagement": true,
    "appsFolders": ["hrm", "hrm-gateway"],
    "directoryPath": "../",
    "dockerRepositoryName": "eradahcr.azure.io",
    "dockerPushCommand": "docker push",
    "kubernetesNamespace": "hrm",
    "ingressDomain": "eradahcapital.com",
    "monitoring": "prometheus",
    "istio": true,
    "creationTimestamp": 1577622173721,
    "kubernetesUseDynamicStorage": true,
    "kubernetesStorageClassName": ""
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
/**
 * A employee for a leave
 */
entity Employee {
  /**
   * The first name of the employee
   */
  firstname String required,
  /**
   * The last name of the employee
   */
  lastname String required,
  /**
   * The email of the employee
   */
  emailid String required,
  /**
   * The employee contact number
   */
  contactnumber String,
  /**
   * Display name of the employee
   */
  displayName String,
  /**
   * The employee designation
   */
  designation String,
  /**
   * The employee department
   */
  department String,
  /**
   * The employee AzureAD ID
   */
  employeeid String required,
  /**
   * The employee Gender
   */
  employeeGender String,
  /**
   * The employee ManagerName
   */
  managerName String,
  /**
   * The employee Manager Azure ID
   */
  managerid String,
  /**
   * Employee Manager Designation
   */
  managerDesignation String,
  /**
   * Manager Mobile/Phone Number
   */
  managerMobile String,
  /**
   * Manager thumbnail/profile picture
   */
  managerThumbnail String,
  /**
   * Employee Thumbnail Profile picture
   */
  profileThumbnail String,
  /**
   * Manager Email
   */
  manageremail String,
  /**
   * The token ID from AAD.
   */
  tokenid Long,
  employeeGroupID Long,
  /**
   * Firebase Token/Device ID
   */
  firebaseToken String,
  deviceID String,
  /**
   * Employee Device Android/iOS
   */
  channel String
}
entity LeaveTakenType {
  /**
   * PK/unique ID for leave Types
   */
  leavetypeiD Integer,
  leavetypename String,
  leavetypeslug String,
  leaveTypeDetails String,
  /**
   * Total Available Balance/Days for this leave type
   */
  leavetypebalance Integer
}
entity EmployeeLeave {
  leaveapplydate LocalDate,
  leavestartdate LocalDate,
  leaveenddate LocalDate,
  leaveLastUpdated LocalDate,
  leaveLastUpdatedBy String,
  /**
   * Number of Days Leave Applied for
   */
  leavebalance Integer,
  leavemessage String,
  leavedescription String,
  /**
   * Pending/Approved/Rejected
   */
  leavestatus String,
  /**
   * By Default leave Will be assigned to Manager ID
   */
  leaveassigned String,
  leaveapprovedby String,
  leavestatuscomments String,
  leaveHasAttachment Boolean,
  attachmentURL String,
  attachmentOption String,
  /**
   * If Employee applied for half day leave.
   */
  isHalfDayLeave Boolean,
  /**
   * Attachment Doc Type
   */
  leaveAttachmentType String,
  leaveExtraField String
}
entity HRGroup {
  displayName String,
  employeeid String,
  mobileNumber String,
  jobTitle String,
  emailID String
}
entity PublicHolidays {
  holidayTitle String,
  holidayID Long,
  holidayDate LocalDate,
  weekendDay1 String,
  weekendDay2 String
}
entity LeaveComment {
  commentDate LocalDate,
  commentAuthorId String,
  commentAuthorName String,
  commentMessage String
}
entity LeaveNotification {
  notificationSubject String,
  notificationStatus Integer,
  notificationDetail String,
  notificationDate LocalDate,
  notificationSenderAzId String,
  notificationReceiverAzId String,
  notificationLeaveId Long,
  leaveStatus String,
  notificationLeaveTypeId Long,
  mSenderId Long,
  mReceiverId Long
}
relationship OneToMany {
  LeaveTakenType{employeeleave} to EmployeeLeave{leavetakentype}
}
relationship ManyToOne {
  EmployeeLeave{employeeid} to Employee,
  LeaveComment{leaveid} to EmployeeLeave
}

paginate Employee, LeaveTakenType, EmployeeLeave, HRGroup, PublicHolidays, LeaveComment, LeaveNotification with pagination
service Employee, LeaveTakenType, EmployeeLeave, HRGroup, PublicHolidays, LeaveComment, LeaveNotification with serviceClass
microservice Employee, LeaveTakenType, EmployeeLeave, HRGroup, PublicHolidays, LeaveComment, LeaveNotification with HRM
filter Employee, LeaveTakenType, EmployeeLeave, HRGroup, PublicHolidays, LeaveComment, LeaveNotification
clientRootFolder Employee, LeaveTakenType, EmployeeLeave, HRGroup, PublicHolidays, LeaveComment, LeaveNotification with HRM

Environment and Tools

openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

git version 2.21.1 (Apple Git-122.3)

node: v13.6.0

npm: 6.13.4

yeoman: 3.1.0

yarn: 1.21.1

Docker version 19.03.5, build 633a0ea

docker-compose version 1.24.1, build 4667896b

Entity configuration(s) entityName.json files generated in the .jhipster directory

N/A

Browsers and Operating System

macos 10.15.3.

smouelhi commented 4 years ago

I am submitting a fix in a PR #11157