Skip to content

Commit 0b43585

Browse files
updated readme
1 parent 7c43513 commit 0b43585

File tree

1 file changed

+57
-6
lines changed

1 file changed

+57
-6
lines changed

README.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ Kubernetes configuration:
1414
1. The application is deployed using the Kubernetes deployment API (versus the
1515
the replication controller directly). For more information read
1616
http://kubernetes.io/docs/user-guide/deployments/
17-
2. The tested codebase has a yaml file that describes the Kubernetes deployment
17+
2. The tested codebase has a yaml file (i.e. deployment.yml) that describes the Kubernetes deployment
1818
parameters and configuration of your application.
19-
3. At the moment, only the basic username/pass authentication is supported.
19+
3. The script processes deployment.yml as a simple template where all `{{ ENV_VARIABLE }}` are replaced with a value of $ENV_VARIABLE deployment.yml
20+
4. At the moment, only the basic username/pass authentication is supported.
2021

2122
# Configuration
2223

@@ -28,9 +29,59 @@ before failing the build. Defaults to 120 (secs).
2829
3. KUBERNETES_PASSWORD - The password for the Kubernetes cluster. Mandatory.
2930
4. KUBERNETES_SERVER - The server (HTTPS endpoint) of the Kubernetes cluster's
3031
API. Mandatory.
31-
5. DOCKER_IMAGE_TAG - The docker tag to use for the deployment. Requires the
32-
`deployment.yml` file to specify a `$DOCKER_IMAGE_TAG` variable so it can be
33-
substitutes at deployment time.
34-
6. FORCE_RE_CREATE_RESOURCE - Will force re-creation of the deployment
3532

33+
# Usage in codefresh
3634

35+
### deployment.yml
36+
37+
```yaml
38+
---
39+
apiVersion: extensions/v1beta1
40+
kind: Deployment
41+
metadata:
42+
name: api-svc
43+
spec:
44+
replicas: 1
45+
template:
46+
metadata:
47+
annotations:
48+
revision: "{{CF_REVISION}}"
49+
labels:
50+
app: api-svc
51+
spec:
52+
containers:
53+
- name: apisvc
54+
image: myrepo/apisvc:{{CF_BRANCH}}
55+
ports:
56+
- containerPort: 80
57+
name: http
58+
59+
```
60+
61+
### codefresh.yml
62+
```yaml
63+
---
64+
version: '1.0'
65+
66+
steps:
67+
build:
68+
type: build
69+
working-directory: ${{initial-clone}}
70+
image-name: $docker-image
71+
tag: ${{CF_BRANCH}}
72+
push:
73+
type: push
74+
candidate: ${{build}}
75+
tag: ${{CF_BRANCH}}
76+
77+
deploy-to-kubernetes:
78+
image: codefresh/cf-deploy-kubernetes
79+
tag: latest
80+
working-directory: ${{initial-clone}}
81+
commands:
82+
- /cf-deploy-kubernetes deployment.yml
83+
environment:
84+
- KUBERNETES_USER=${{KUBERNETES_USER}}
85+
- KUBERNETES_PASSWORD=${{KUBERNETES_PASSWORD}}
86+
- KUBERNETES_SERVER=${{KUBERNETES_SERVER}}
87+
```

0 commit comments

Comments
 (0)