-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate Image Streams #4
Conversation
Plus separating templates for easier Deployment
tags: | ||
- name: latest | ||
annotations: | ||
openshift.io/display-name: Apicast Cloud Hosted (latest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Apicast/APIcast/
😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I did it again :p
app: apicast | ||
spec: | ||
tags: | ||
- name: builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add the branch name to the tag name? So we know it is "master" and not some tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Idea 👍
openshift/04-deployment-template.yml
Outdated
imagePullPolicy: IfNotPresent | ||
name: apicast | ||
name: apicast-${RELEASE_REF} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no need for containers to have a suffix no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sure
openshift/04-deployment-template.yml
Outdated
image: "${APICAST_IMAGE}" | ||
value: "http://apicast-mapping-service-${RELEASE_REF}/config" | ||
- name: APICAST_OIDC_LOG_LEVEL | ||
value: "${APICAST_OIDC_LOG_LEVEL}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this does not need to be a Parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok So I will place the env var with notice as default.
- name: builder | ||
from: | ||
kind: DockerImage | ||
name: quay.io/3scale/apicast:master-builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it is a good idea.
Same as APICast
@@ -103,6 +110,13 @@ objects: | |||
- containerPort: 8090 | |||
name: management | |||
protocol: TCP | |||
resources: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikz Should we set the APICAST_WORKERS
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. APIcast autodetects number of requested CPU cores: 3scale/APIcast#600
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
- name: master-builder | ||
from: | ||
kind: DockerImage | ||
name: quay.io/3scale/apicast:master-builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to have a comment pointing to how is this refreshed.
#4 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I don't know how quay.io/3scale/apicast:master-builder
is refreshed either... Or are you talking about the scheduled imports from the registry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Scheduled imports.
Those quay images are built when master branch is updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 287e33c
openshift/04-deployment-template.yml
Outdated
imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- apicast-${RELEASE_REF} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep.
The ImageStream will immport the builder imager periodically. This configuration is clusterwide but the default is 15 minutes.
oc new-app -f $(THISDIR_PATH)/04-deployment-template.yml \ | ||
-p RELEASE_REF=${RELEASE_REF} \ | ||
-p ENVIRONMENT=${ENVIRONMENT} \ | ||
-p CACHE_TTL=${CACHE_TTL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this crash when CACHE_TTL
is empty? It should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it crashes because there is no predefined value in the template.
Actually it brakes without RELEASE_REF
AND ENVIRONMENT
also.
The actuall error message:
oc new-app -f /Users/dcesario/src/apicast-cloud-hosted/openshift/04-deployment-template.yml \
-p RELEASE_REF=test-dani3 \
-p ENVIRONMENT=staging \
-p CACHE_TTL=
error: error processing template "apicast-staging/apicast-cloud-hosted-deployment": Template "apicast-cloud-hosted-deployment" is invalid: template.parameters[2]: Required value: template.parameters[2]: parameter CACHE_TTL is required and must be specified
make: *** [deploy] Error 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@mikz Should we investigate how to build the |
openshift/03-build-config.yml
Outdated
- '--daemon' | ||
command: | ||
- bin/apicast | ||
#postCommit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikz Should we remove the postCommit
? The Deployment is working without it, but I'm not sure how to solve it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postCommit
is good. It verifies the image will boot. Otherwise you have no idea until you try to deploy it (and fail).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok you said something about Apicasy and the RESOLVER
env Variable I will take a look at it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikz So the problem with the postCommit is that the openshift builder is setting the resolv.conf
file like that:
# nameserver updated by /etc/NetworkManager/dispatcher.d/99-origin-dns.sh
# Generated by NetworkManager
search ec2.internal cluster.local
nameserver 10.0.101.97
The problem is the first line, looks like the parse_nameservers
function in APIcast https://github.com/3scale/apicast/blob/5c2dc6bbf9295b5e7891fb7bb52e32abcf763972/gateway/src/resty/resolver.lua#L105 is matching with the commented nameserver
in the file.
The actual error thrown by nginx is:
nginx: [emerg] invalid IPv6 address in resolver "[domain]:53" in /tmp/lua_c5D5o5:45
I have reproduced it locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Looks like: https://github.com/3scale/apicast/blob/5c2dc6bbf9295b5e7891fb7bb52e32abcf763972/gateway/src/resty/resolver.lua#L135-L140
This should match only from start of the line and ignore comments. We probably need better parsing anyway.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected in 3scale/APIcast#618
ToDo:
Makefile