Closed Hokwang closed 4 years ago
I found out ingress.path does not work.
$ k get ing artifactory-stage-artifactory -n artifactory-stage -o yaml
<snip>
spec:
rules:
- host: nwse.sec.samsung.net
http:
paths:
- backend:
serviceName: artifactory-stage-artifactory
servicePort: 8082
path: /
- backend:
serviceName: artifactory-stage-artifactory
servicePort: 8081
path: /artifactory/
I guess this is bug.
@danielezer can you helm me?
@Hokwang You can try something like the following https://github.com/jfrog/charts/issues/306#issuecomment-520211341. Let me know if it works
@danielezer .Values.nginx.externalPortHttp is deprecated and I don't use nginx.
nginx:
enabled: false
so serviceName and servicePort does not match with your link.
Try to change it to the artifactory service name and the artifactory external service port
I did run below commands,
# cat myvalues.yaml
ingress:
enabled: true
defaultBackend:
enabled: false
hosts:
- my.company.net
path: /artifactory-stage
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
tls:
- secretName: ingress-tls
hosts:
- my.company.net
artifactory:
image:
repository: "docker.bintray.io/jfrog/artifactory-pro"
license:
secret: artifactory-license
dataKey: art.lic
masterKey: 5a406dd12321a3832c25532c0893630ce3657a89a52c7978ed8237bc75aa1744
joinKey: 5a406dd12321a3832c25532c0893630ce3657a89a52c7978ed8237bc75aa1744
accessAdmin:
ip: "*"
password: "1qaz2wsx"
persistence:
enabled: false
nginx:
enabled: false
postgresql:
postgresqlPassword: "1qaz2wsx"
persistence:
enabled: false
# helm install artifactory-stage -n artifactory-stage -f myvalues.yaml jfrog/artifactory
# k get ing -n artifactory-stage
NAME HOSTS ADDRESS PORTS AGE
artifactory-stage-artifactory my.company.net 80, 443 30s
# k edit ing artifactory-stage-artifactory -n artifactory-stage
<snip>
spec:
rules:
- host: my.company.net
http:
paths:
- backend:
serviceName: artifactory-stage-artifactory
servicePort: 8082
path: /artifactory-stage
- backend:
serviceName: artifactory-stage-artifactory
servicePort: 8081
path: /artifactory-stage/artifactory/
- backend:
serviceName: artifactory-stage-artifactory
servicePort: 8082
path: /artifactory-stage/webapp
8082 / is created automatically, I edited /artifactory-stage and 8081 /artifactory/ is also created, I edited /artifactory-stage/artifactory/ and I added 8082 /artifactory-stage/webapp Do you mean this spec? Anyway still not works and I tried to change this spec so many times but no luck.
@danielezer can you test this?
@Hokwang Hey, sorry for the delay in my response. I have tried achieving what you are aiming for and I managed to do it with the following values.yaml
:
ingress:
enabled: true
defaultBackend:
enabled: false
hosts:
- my.company.net
path: /artifactory-stage
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite "(?i)/artifactory-stage(/|$)(.*)" /$2 break;
additionalRules: |
- host: my.company.net
http:
paths:
- path: /artifactory-stage
backend:
serviceName: {{ template "artifactory.fullname" . }}
servicePort: {{ .Values.artifactory.externalPort }}
Please let me know if it works out for you
Thanks for your kind reply, but I didn't make it success. I gave up. my last value.yaml is
ingress:
enabled: true
defaultBackend:
enabled: false
hosts:
- my.company.net
routerPath: /artifactory-stage/
artifactoryPath: /artifactory-stage/artifactory
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite "(?i)/artifactory-stage(/|$)(.*)" /$2 break;
tls:
- secretName: ingress-tls
hosts:
- my.company.net
@Hokwang Sorry about that... If you gather the energy to try again, you can use my values, I have confirmed that they worked and I was able to access my Artifactory server with /artifactory-stage
@danielezer I have been running into the same issue as @Hokwang. Can you post the values.yml that worked for you?
@skulasekar take a look at this comment - https://github.com/jfrog/charts/issues/653#issuecomment-609415700. These are the values that worked for me. Hope this helps
@danielezer I had tried both your way and @Hokwang 's. Didn't work. The UI is stuck at loading screen.
My values.yaml -
ingress:
enabled: true
defaultBackend:
enabled: false
tls:
hosts:
- ''
className: my-custom-ingress-class
routerPath: /jcr/
artifactoryPath: /jcr/artifactory/
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/(v2)/token /artifactory/api/docker/null/v2/token;
rewrite ^/(v2)/([^\/]*)/(.*) /artifactory/api/docker/$2/$1/$3;
Also tried by changing annotation to -
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/(v2)/token /artifactory/api/docker/null/v2/token;
rewrite ^/(v2)/([^\/]*)/(.*) /artifactory/api/docker/$3/$2/$4;
and
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/(v2)/token /jcr/artifactory/api/docker/null/v2/token;
rewrite ^/(v2)/([^\/]*)/(.*) /jcr/artifactory/api/docker/$3/$2/$4;
Also tried /jfrog/artifactory
instead of /jcr/artifactory
in both annotations
and artifactoryPath
Hello.
I want to use artifactory with https://my.company.com/artifactory-stage URL.
Is it possible? (using including docker registry case or excluding docker registry case)
I can't deploy with sub path, can you provide simple example?
my values.yaml is
When I access my.company.com/artifactory-stage, it moved to my.company.com/artifactory and return 404 not found error.