Skip to content
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

Move tf-state to machine object, and remove file system dependency #264

Merged
merged 5 commits into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion cloud/vsphere/cmd/vsphere-machine-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,32 @@ RUN apt-get update && apt-get install -y ca-certificates curl openssh-server unz
sha256sum --quiet -c ${TERRAFORM_SHAFILE} && \
unzip ${TERRAFORM_ZIP} -d /bin && \
rm -f ${TERRAFORM_ZIP} ${TERRAFORM_SHAFILE} && \
echo 'plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"' >> ~/.terraformrc && \
rm -rf /var/lib/apt/lists/*

# Setup template provider
ENV TEMPLATE_PROVIDER_VERSION=1.0.0
ENV TEMPLATE_PROVIDER_ZIP=terraform-provider-template_${TEMPLATE_PROVIDER_VERSION}_linux_amd64.zip
ENV TEMPLATE_PROVIDER_SHA256SUM=f54c2764bd4d4c62c1c769681206dde7aa94b64b814a43cb05680f1ec8911977
ENV TEMPLATE_PROVIDER_SHAFILE=terraform-provider-template_${TEMPLATE_PROVIDER_VERSION}_SHA256SUMS

RUN curl https://releases.hashicorp.com/terraform-provider-template/${TEMPLATE_PROVIDER_VERSION}/${TEMPLATE_PROVIDER_ZIP} > ${TEMPLATE_PROVIDER_ZIP} && \
echo "${TEMPLATE_PROVIDER_SHA256SUM} ${TEMPLATE_PROVIDER_ZIP}" > ${TEMPLATE_PROVIDER_SHAFILE} && \
sha256sum --quiet -c ${TEMPLATE_PROVIDER_SHAFILE} && \
mkdir -p ~/.terraform.d/plugins/linux_amd64/ && \
unzip ${TEMPLATE_PROVIDER_ZIP} -d ~/.terraform.d/plugins/linux_amd64/ && \
rm -f ${TEMPLATE_PROVIDER_ZIP} ${TEMPLATE_PROVIDER_SHAFILE}

# Setup vsphere provider
ENV VSPHERE_PROVIDER_VERSION=1.5.0
ENV VSPHERE_PROVIDER_ZIP=terraform-provider-vsphere_${VSPHERE_PROVIDER_VERSION}_linux_amd64.zip
ENV VSPHERE_PROVIDER_SHA256SUM=6dd495feeb83aa8b098d4e9b0224b9e18b758153504449ff4ac2c6510ed4bb52
ENV VSPHERE_PROVIDER_SHAFILE=terraform-provider-vsphere_${VSPHERE_PROVIDER_VERSION}_SHA256SUMS

RUN curl https://releases.hashicorp.com/terraform-provider-vsphere/${VSPHERE_PROVIDER_VERSION}/${VSPHERE_PROVIDER_ZIP} > ${VSPHERE_PROVIDER_ZIP} && \
echo "${VSPHERE_PROVIDER_SHA256SUM} ${VSPHERE_PROVIDER_ZIP}" > ${VSPHERE_PROVIDER_SHAFILE} && \
sha256sum --quiet -c ${VSPHERE_PROVIDER_SHAFILE} && \
mkdir -p ~/.terraform.d/plugins/linux_amd64/ && \
unzip ${VSPHERE_PROVIDER_ZIP} -d ~/.terraform.d/plugins/linux_amd64/ && \
rm -f ${VSPHERE_PROVIDER_ZIP} ${VSPHERE_PROVIDER_SHAFILE}

COPY --from=builder /go/bin/vsphere-machine-controller .
8 changes: 4 additions & 4 deletions cloud/vsphere/config/configtemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ spec:
mountPath: /etc/kubernetes
- name: certs
mountPath: /etc/ssl/certs
- name: terraform-config
mountPath: /root/.terraform.d
- name: machines-stage
mountPath: /tmp/cluster-api/machines/
- name: sshkeys
mountPath: /root/.ssh
- name: named-machines
Expand Down Expand Up @@ -164,9 +164,9 @@ spec:
- name: certs
hostPath:
path: /etc/ssl/certs
- name: terraform-config
- name: machines-stage
hostPath:
path: /home/ubuntu/.terraform.d
path: /tmp/cluster-api/machines/
- name: sshkeys
hostPath:
path: /home/ubuntu/.ssh
Expand Down
Loading