Grails 3.3.0 M1 and 3.3.0 M2 Combining MongoDB and Hibernate fail - mongodb

Step1: use command create app
grails create-app test
Step2: create domain
grails create-domain-class test
Step3: configue build.gradle
compile 'org.grails.plugins:mongodb'
Step4: configue application.yml
grails:
mongodb:
host: "localhost"
port: 27017
username: ""
password: ""
databaseName: "test"
environments:
development:
dataSource:
dbCreate: none
url:jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
logSql: true
Step5: use mapWith in Test.groovy
static mapWith="mongo"
Step6: query test in bootstrap
println Test.findAll()
Stop7: run grails app
grails run-app
the error is :
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not prepare statement; bad SQL grammar [select this_.id as id1_0_0_, this_.version as version2_0_0_ from test this_]; nested exception is org.h2.jdbc.JdbcSQLException: Table "TEST" not found; SQL statement:
select this_.id as id1_0_0_, this_.version as version2_0_0_ from test this_ [42102-194]
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.grails.orm.hibernate.GrailsHibernateTemplate.convertJdbcAccessException(GrailsHibernateTemplate.java:723)
at org.grails.orm.hibernate.GrailsHibernateTemplate.convertHibernateAccessException(GrailsHibernateTemplate.java:711)
at org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:302)
at org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:242)
at org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:116)
at org.grails.orm.hibernate.HibernateGormStaticApi.list(HibernateGormStaticApi.groovy:74)
at org.grails.datastore.gorm.GormStaticApi.findAll(GormStaticApi.groovy:579)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.findAll(GormEntity.groovy:671)
at org.grails.datastore.gorm.GormEntity$Trait$Helper$findAll$0.call(Unknown Source)
use other version :
3.2.3 is OK
3.2.5 is OK
3.2.9 is Ok
My code is :
the demo in github
what change in 3.3.0.M1 and 3.3.0.M2 ?

grails:
mongodb:
host: "localhost"
port: 27017
username: ""
password: ""
databaseName: "test"
environments:
development:
dataSource:
dbCreate: none
url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
logSql: true
test:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
dbCreate: none
url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
Replace your these lines to this
environments:
development:
grails:
mongodb:
host: "localhost"
port: 27017
username: ""
password: ""
databaseName: "test"
test:
mongodb:
host: "localhost"
port: 27017
username: ""
password: ""
databaseName: "test"
production:
grails:
mongodb:
host: "localhost"
port: 27017
username: ""
password: ""
databaseName: "test"
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED

Related

Spring cloud Eureka client not registering

I have recently updated my micro-services project from Spring boot 2.0.5 to 2.7.4.
Also, updated Spring cloud dependencies to 2021.0.4.
Miragrate from Netflix Zuul to Spring cloud Gateway.
My Eureka Server is running on PORT 8000, which I can access on browser and see the Eureka Dashboard.
Gateway is running on port 8001, which registers successfully with Eureka, and I can see it's status "UP" in the Dashboard.
But no other service are registered on Eureka. The application.yml file of all other services are almost similar to the gateway-service. Below are some code snippets of one of the services :
Problem 1 - Application name UNKNOWN
DiscoveryClient_UNKNOWN/192.168.1.3: registering service...
Problem 2
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}, exception=java.net.ConnectException: Connection refused (Connection refused) stacktrace=com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
Eureka-server config
spring:
application:
name: eureka-service
cloud:
config:
uri: ${eureka.instance.hostname}:${server.port}
server:
port: 8000
eureka:
instance:
hostname: localhost
client:
registerWithEureka: false
fetchRegistry: false
service-url:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka
server:
enableSelfPreservation: false
logging:
level:
org.springframework: ERROR
com.debugfactory.trypz: ERROR
file:
name: logs/eureka-service.log
Gateway-service Application.yml - This registers with proper name with Eureka
spring:
main:
web-application-type: reactive
allow-bean-definition-overriding: true
application:
name: zuul-service
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
cloud:
gateway:
discovery:
locator:
enabled: true
routes:
- id: sms-service
uri: http://sms-service/
predicates:
- Path=/sms/**
server:
port: 8001
max-thread: 100
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_URI:http://localhost:8000/eureka/}
instance:
preferIpAddress: true
logging:
file:
name: logs/zuul-service.log
pattern:
file: "%d %-5level [%thread] %logger{0} : %msg%n"
level:
org.springframework: INFO
com.bayview: DEBUG
org.netflix: INFO
SMS-Service <- This tries to look for Eureka port on 8761 with name UNKNOWN
Application.yml
spring:
application:
name: sms-service
data:
mongodb:
authentication-database: admin
database: sms
host: localhost
port: 27017
main:
allow-bean-definition-overriding: true
config:
activate:
on-profile: local
server:
port: 8022
servlet:
context-path: /sms
tomcat:
max-threads: 10
logging:
level:
org.springframework.web: ERROR
org.hibernate: ERROR
com.cryptified.exchange: DEBUG
org.springframework.data: ERROR
org.springframework.security: ERROR
org.springframework.web.client: DEBUG
file:
name: logs/sms-service.log
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_URI:http://localhost:8000/eureka/}
instance:
preferIpAddress: true
gradle
plugins {
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'java'
}
repositories {
mavenCentral()
}
ext {
set('springCloudVersion', "2021.0.4")
set('testcontainersVersion', "1.17.4")
mapStructVersion = '1.5.3.Final'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.flywaydb:flyway-core'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation "org.mapstruct:mapstruct:${mapStructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.testcontainers:junit-jupiter'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
.....
application.yml in your project
URI_TO_SERVER_CONFIG: http://localhost:8888
spring:
application:
name: name_project_your
cloud:
config:
uri: ${URI_TO_SERVER_CONFIG}
config:
import: configserver:${URI_TO_SERVER_CONFIG}
profiles:
active: microservice, discoveries, name_project_your
Application configs on git-repository
application-discoveries.yml
SERVER_PORT_SERVICE_DISCOVERY: 8761
IP_ADDRESS_SERVICE_DISCOVERY: http://localhost
eureka:
instance:
instance-id: ${spring.application.name}:${random.uuid}
# https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#changing-the-eureka-instance-id
client:
service-url:
defaultZone: ${IP_ADDRESS_SERVICE_DISCOVERY}:${SERVER_PORT_SERVICE_DISCOVERY}/eureka
lease-renewal-interval-in-seconds: 5
name-project-your.yml
DB_IP: 127.0.0.1
DB_PORT: 5432
DB_DATABASE_NAME: name_db
DB_URL: jdbc:postgresql://${DB_IP}:${DB_PORT}/${DB_DATABASE_NAME}
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_SCHEMA: your_schema
spring:
application:
name: name-project-your
cloud:
config:
enabled: true
discovery:
enabled: true
datasource:
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
flyway:
baseline-on-migrate: true
locations: classpath:db/migration
create-schemas: true
default-schema: ${DB_SCHEMA}
application-microservice.yml
eureka:
client:
fetch-registry: true
register-with-eureka: true
logging:
level:
com:
netflix:
eureka: debug
discovery: debug
server:
port: 0

How to use variables instead of plain secrets in data.metadataConnection airflow helm chart

How to use (env) variables instead of plain secrets in data.metadataConnection in values.yaml
VAR_USER = "username"
VAR_PASS = "password"
data:
metadataConnection:
user: VAR_USER
pass: VAR_PASS
protocol: postgresql
host: ~
port: 5432
db: VAR_DB
sslmode: disable
instead of
data:
metadataConnection:
user: postgres
pass: postgres
protocol: postgresql
host: ~
port: 5432
db: postgres
sslmode: disable

User and Database does not create automatically when docker starts

I have Spring Boot App with Postgres which I want to run with Docker and user and database should create automatically with environmental variables.
docker-compose.yml
version: '3'
services:
microservice:
build: ./
image: someimage
ports:
- "8080:8080"
environment:
MEMORY_OPTS: "-Xmx512M"
PG_DB_HOST: postgres
PG_DB_PORT: 5432
PG_DB_PASSWORD: postgres
depends_on:
- postgres
postgres:
image: postgres:10.4-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=db
ports:
- 5432:5432
application.yml
spring:
config:
activate:
on-profile: local
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
hibernate:
ddl-auto: update
show-sql: true
datasource:
url: jdbc:postgresql://postgres:5432/db
username: postgres
password: postgres
liquibase:
change-log: classpath:/db/changelog/db.changelog-master.yaml
db/changelog/db.changelog-master.yaml
databaseChangeLog:
- logicalFilePath: db/changelog/db.changelog-master.yaml
- preConditions:
- runningAs:
username: postgres
- changeSet:
id: 1
author: postgres
changes:
- createTable:
tableName: employees
columns:
- column:
name: EMPLOYEE_ID
type: int
autoIncrement: true
constraints:
primaryKey: true
nullable: false
- column:
name: FIRST_NAME
type: varchar(50)
- column:
name: LAST_NAME
type: varchar(50)
constraints:
nullable: false
- column:
name: LOCATION
type: varchar(50)
And when I run docker compose up, I always get
Caused by: org.postgresql.util.PSQLException: FATAL: role "postgres" does not exist
or Caused by: org.postgresql.util.PSQLException: FATAL: database "db" does not exist
If I create manually user and database, it works, but as you understand, I need to do it automatically, I suppose some problems with env. variables.

Rundeck global variable in meta job not resolved

we have a Rundeck (3.1.2-20190927) job which triggers multiple other jobs in Rundeck. In the /etc/rundeck/framework.properties are global variables defined that are used in the jobs. It's used to build the url of our Icinga so Rundeck can submit th job result to the monitoring. The variable is used in the notifications tab (edit job -> notification) of every single job.
When the meta job has run, it submits the result successfully to the monitoring. The same applies to the 'sub' job, if you trigger them manualy. BUT if they are triggert by the meta job, they throw an error:
Error calling the endpoint: Illegal character in authority at index 8: https://icinga-master-${globals.environment}.some.domain.
It looks like the global variable is not resolved correctly when the job are triggert by the meta job. Strange to say, other meta jobs don't have this problem. I can't find any configuration differences. Has anybody an idea what the cause could be?
Thanks for any help!
Update: Here's my job definition
- defaultTab: output
description: "Call Patchday Jobs in a row \n**Attention! This will reboot the servers**"
executionEnabled: true
group: CloudServices/SomeSoftWare
id: 5cf2966c-3e5f-4a32-8cce-b3e82b6fd036
loglevel: INFO
multipleExecutions: true
name: Patchday SomeSoftWare - Meta Job
nodeFilterEditable: false
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: false
rankOrder: ascending
successOnEmptyNodeFilter: false
threadcount: '1'
filter: 'tags: role_SomeSoftWare'
nodesSelectedByDefault: false
notification:
onfailure:
plugin:
configuration:
_noSSLVerification: ''
_printResponseToFile: ''
_proxySettings: ''
authentication: Basic
body: |-
{
"type": "Service",
"filter": "service.name==\"Rundeck-Job - ${job.name}\"",
"exit_status": 2,
"plugin_output": "'${job.name}' failed"
}
contentType: application/json
file: ''
headers: 'Accept: application/json'
method: POST
noSSLVerification: 'true'
oauthTokenEndpoint: ''
oauthValidateEndpoint: ''
password: ******
proxyIP: ''
proxyPort: ''
remoteUrl: https://icinga-master-${globals.environment}.some.domain:5665/v1/actions/process-check-result
timeout: '30000'
username: rundeck_process-check-result
type: HttpNotification
onsuccess:
plugin:
configuration:
_noSSLVerification: ''
_printResponseToFile: ''
_proxySettings: ''
authentication: Basic
body: |-
{
"type": "Service",
"filter": "service.name==\"Rundeck-Job - ${job.name}\"",
"exit_status": 0,
"plugin_output": "'${job.name}' succeeded"
}
contentType: application/json
file: ''
headers: 'Accept: application/json'
method: POST
noSSLVerification: 'true'
oauthTokenEndpoint: ''
oauthValidateEndpoint: ''
password: ******
proxyIP: ''
proxyPort: ''
remoteUrl: https://icinga-master-${globals.environment}.some.domain:5665/v1/actions/process-check-result
timeout: '30000'
username: rundeck_process-check-result
type: HttpNotification
notifyAvgDurationThreshold: null
options:
- description: Addition paramater to give to the ansible-playbook call
name: AdditionalParameter
scheduleEnabled: true
sequence:
commands:
- jobref:
args: 'branch: ${globals.defaultbranch}'
group: Infrastructure
name: Icinga Service Downtime
nodefilters:
dispatch:
nodeIntersect: true
uuid: 6eec5749-ef35-481e-aea8-674f233c32ac
- description: Pause Bamboo Server
jobref:
args: -branch ${globals.defaultbranch} -bamboo_command pause
group: Infrastructure
name: Bamboo Control
nodefilters:
dispatch:
nodeIntersect: true
uuid: 87bc7f1c-d133-4d7e-9df9-2b40fb935fd4
- configuration:
ansible-become: 'false'
ansible-disable-limit: 'false'
ansible-playbook-inline: |
- name: +++ Stop Tomcat ++++
hosts: tag_role_SomeSoftWare
gather_facts: true
remote_user: ec2-user
become: yes
tasks:
- name: stop tomcat
service:
name: tomcat
state: stopped
nodeStep: false
type: com.batix.rundeck.plugins.AnsiblePlaybookInlineWorkflowStep
- description: SomeSoftWare Update
jobref:
args: -branch ${globals.defaultbranch}
group: Infrastructure
name: SomeSoftWare Server - Setup
nodefilters:
dispatch:
nodeIntersect: true
uuid: f01a4483-d8b2-43cf-99fd-6a610d25c3a4
- description: Install/Update fs-cli
jobref:
args: -branch ${globals.defaultbranch}
group: Infrastructure
name: firstspirit-cli - Setup
nodefilters:
dispatch:
nodeIntersect: true
uuid: c7c54433-be96-4d85-b2c1-32d0534b5c60
- description: Install/Update Modules
jobref:
args: -branch ${globals.defaultbranch}
group: Infrastructure
name: SomeSoftWare Modules - Setup
nodefilters:
dispatch:
nodeIntersect: true
uuid: f7a8929b-2bc3-4abe-8c69-e0d2acf62159
- description: restart SomeSoftWare
exec: sudo service SomeSoftWare restart
- description: Resume Bamboo Server
jobref:
args: -branch ${globals.defaultbranch} -bamboo_command resume
group: Infrastructure
name: Bamboo Control
nodefilters:
dispatch:
nodeIntersect: true
uuid: 87bc7f1c-d133-4d7e-9df9-2b40fb935fd4
keepgoing: false
strategy: node-first
timeZone: Europe/Berlin
uuid: 5cf2966c-3e5f-4a32-8cce-b3e82b6fd036

Spinnaker:AKS account not showing on UI

I've configured spinnaker cloud provider as kubernetes with below commands
hal config provider kubernetes enable
kubectl config current-context
CONTEXT=$(kubectl config current-context)
hal config provider kubernetes account add my-k8s-v2-account --provider-version v2 --context $CONTEXT
hal config features edit --artifacts true
but this account is not visible on spinnaker UI
and in logs its shows error as below
Nov 29 12:07:43 47184UW2DDevLVM2 gate[34594]: 2019-11-29 12:07:43.860 ERROR 34594 --- [TaskScheduler-5] c.n.s.g.s.DefaultProviderLookupService : Unable to refresh account details cache, reason: timeout
please advise.. thanks..
here's my hal deploy diff command output
+ Get current deployment
Success
+ Determine config diff
Success
~ EDITED
default.persistentStorage.redis
- port 6379 -> null
- host localhost -> null
~ EDITED
telemetry
I've provisioned new VM and did all installation process from scratch but still same issue :(
here is ~/.kube/config file
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: xxx
server: https://xxx:443
name:xxx
contexts:
- context:
cluster: xxx
user: xxx
name: xxx
current-context: xxx
kind: Config
preferences: {}
users:
- name: xxx
user:
client-certificate-data: xxx
client-key-data: xxx
token: xxx
and here is ~/.hal/config file
currentDeployment: default
deploymentConfigurations:
- name: default
version: 1.17.2
providers:
appengine:
enabled: false
accounts: []
aws:
enabled: false
accounts: []
bakeryDefaults:
baseImages: []
defaultKeyPairTemplate: '{{name}}-keypair'
defaultRegions:
- name: xxx
defaults:
iamRole: BaseIAMRole
ecs:
enabled: false
accounts: []
azure:
enabled: false
accounts: []
bakeryDefaults:
templateFile: azure-linux.json
baseImages: []
dcos:
enabled: false
accounts: []
clusters: []
dockerRegistry:
enabled: false
accounts: []
google:
enabled: false
accounts: []
bakeryDefaults:
templateFile: gce.json
baseImages: []
zone: us-central1-f
network: default
useInternalIp: false
kubernetes:
enabled: true
accounts:
- name: xxx
requiredGroupMembership: []
providerVersion: V2
permissions: {}
dockerRegistries: []
context: xxx
configureImagePullSecrets: true
cacheThreads: 1
namespaces: []
omitNamespaces: []
kinds: []
omitKinds: []
customResources: []
cachingPolicies: []
kubeconfigFile: /home/xxx/.kube/config
oAuthScopes: []
onlySpinnakerManaged: false
primaryAccount: xxx
oracle:
enabled: false
accounts: []
bakeryDefaults:
templateFile: oci.json
baseImages: []
cloudfoundry:
enabled: false
accounts: []
deploymentEnvironment:
size: SMALL
type: LocalDebian
imageVariant: SLIM
updateVersions: true
consul:
enabled: false
vault:
enabled: false
customSizing: {}
sidecars: {}
initContainers: {}
hostAliases: {}
affinity: {}
tolerations: {}
nodeSelectors: {}
gitConfig:
upstreamUser: spinnaker
livenessProbeConfig:
enabled: false
haServices:
clouddriver:
enabled: false
disableClouddriverRoDeck: false
echo:
enabled: false
persistentStorage:
persistentStoreType: azs
azs:
storageAccountName: xxx
storageAccountKey: xxx
storageContainerName: xxx
gcs:
rootFolder: front50
redis: {}
s3:
rootFolder: front50
oracle: {}
features:
auth: false
fiat: false
chaos: false
entityTags: false
artifacts: true
metricStores:
datadog:
enabled: false
tags: []
prometheus:
enabled: false
add_source_metalabels: true
stackdriver:
enabled: false
newrelic:
enabled: false
tags: []
period: 30
enabled: false
notifications:
slack:
enabled: false
twilio:
enabled: false
baseUrl: https://api.twilio.com/
github-status:
enabled: false
timezone: America/Los_Angeles
ci:
jenkins:
enabled: false
masters: []
travis:
enabled: false
masters: []
wercker:
enabled: false
masters: []
concourse:
enabled: false
masters: []
gcb:
enabled: false
accounts: []
repository:
artifactory:
enabled: false
searches: []
security:
apiSecurity:
ssl:
enabled: false
overrideBaseUrl: http://xxx:8084/
uiSecurity:
ssl:
enabled: false
overrideBaseUrl: http://xxx:9000/
authn:
oauth2:
enabled: false
client: {}
resource: {}
userInfoMapping: {}
saml:
enabled: false
userAttributeMapping: {}
ldap:
enabled: false
x509:
enabled: false
iap:
enabled: false
enabled: false
authz:
groupMembership:
service: EXTERNAL
google:
roleProviderType: GOOGLE
github:
roleProviderType: GITHUB
file:
roleProviderType: FILE
ldap:
roleProviderType: LDAP
enabled: false
artifacts:
bitbucket:
enabled: false
accounts: []
gcs:
enabled: false
accounts: []
oracle:
enabled: false
accounts: []
github:
enabled: false
accounts: []
gitlab:
enabled: false
accounts: []
gitrepo:
enabled: false
accounts: []
http:
enabled: false
accounts: []
helm:
enabled: false
accounts: []
s3:
enabled: false
accounts: []
maven:
enabled: false
accounts: []
templates: []
pubsub:
enabled: false
google:
enabled: false
pubsubType: GOOGLE
subscriptions: []
publishers: []
canary:
enabled: false
serviceIntegrations:
- name: google
enabled: false
accounts: []
gcsEnabled: false
stackdriverEnabled: false
- name: prometheus
enabled: false
accounts: []
- name: datadog
enabled: false
accounts: []
- name: signalfx
enabled: false
accounts: []
- name: aws
enabled: false
accounts: []
s3Enabled: false
- name: newrelic
enabled: false
accounts: []
reduxLoggerEnabled: true
defaultJudge: NetflixACAJudge-v1.0
stagesEnabled: true
templatesEnabled: true
showAllConfigsEnabled: true
plugins:
plugins: []
enabled: false
downloadingEnabled: false
pluginConfigurations:
plugins: {}
webhook:
trust:
enabled: false
telemetry:
enabled: false
endpoint: https://stats.spinnaker.io
instanceId: xxx
connectionTimeoutMillis: 3000
readTimeoutMillis: 5000
Here are the commands used to install spinnaker
az login
az aks get-credentials --resource-group xxx --name xxx
curl -O https://raw.githubusercontent.com/spinnaker/halyard/master/install/debian/InstallHalyard.sh
sudo bash InstallHalyard.sh --user xxx
hal config provider kubernetes enable
CONTEXT=$(kubectl config current-context)
hal config provider kubernetes account add xxx \
--provider-version v2 \
--context $CONTEXT
hal config features edit --artifacts true
hal config deploy edit --type localdebian
hal config storage azs edit --storage-account-name xxx --storage-account-key xxx
hal config storage edit --type azs
hal version list
hal config version edit --version 1.17.2
sudo hal deploy apply
echo "host: 0.0.0.0" | tee \
~/.hal/default/service-settings/gate.yml \
~/.hal/default/service-settings/deck.yml
hal config security ui edit \
--override-base-url http://xxx:9000/
hal config security api edit \
--override-base-url http://xxx:8084/
sudo hal deploy apply
Found below exceptions logs
Dec 2 11:12:07 47184UW2DDevLVM2 clouddriver[23908]: 2019-12-02 11:12:07.424 ERROR 23908 --- [1-7002-exec-105] c.n.s.k.w.e.GenericExceptionHandlers : Internal Server Error
Dec 2 11:12:07 47184UW2DDevLVM2 clouddriver[23908]: java.lang.NullPointerException: null
Dec 2 11:12:07 47184UW2DDevLVM2 clouddriver[23908]: #011at com.netflix.spinnaker.clouddriver.kubernetes.health.KubernetesHealthIndicator.health(KubernetesHealthIndicator.java:48) ~[clouddriver-kubernetes-6.4.1-20191111102213.jar:6.4.1-20191111102213]
Dec 2 11:12:07 47184UW2DDevLVM2 clouddriver[23908]: #011at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:95) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
Dec 2 11:12:07 47184UW2DDevLVM2 clouddriver[23908]: #011at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:50) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
Dec 2 11:12:07 47184UW2DDevLVM2 clouddriver[23908]: #011at org.springframework.boot.actuate.health.HealthEndpointWebExtension.health(HealthEndpointWebExtension.java:53) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
plus localhost 7002 is not responding
hexunix#47184UW2DDevLVM2:~$ curl -v http://localhost:7002/credentials
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 7002 (#0)
> GET /credentials HTTP/1.1
> Host: localhost:7002
> User-Agent: curl/7.58.0
> Accept: */*
>
This is how i have done in my environment
kubeconfig_path="/home/root/.hal/kube-config"
kubernetes_account="my-account"
docker_registry="docker.io"
hal config provider kubernetes account add $kubernetes_account --provider-version v2 \
--kubeconfig-file "$kubeconfig_path" \
--context $(kubectl config current-context --kubeconfig "$kubeconfig_path") \
--omit-namespaces=kube-system,kube-public \
--docker-registries "$docker_registry"
make necessary updates and apply the changes. It should work.
from hal config it is clear that kubernetes account is added.
kubernetes:
enabled: true
accounts:
- name: xxx
requiredGroupMembership: []
providerVersion: V2
permissions: {}
dockerRegistries: []
context: xxx
configureImagePullSecrets: true
cacheThreads: 1
namespaces: []
omitNamespaces: []
kinds: []
omitKinds: []
customResources: []
cachingPolicies: []
kubeconfigFile: /home/xxx/.kube/config
oAuthScopes: []
onlySpinnakerManaged: false
primaryAccount: xxx