Skip to content

Commit

Permalink
Move tf-state to machine object, and remove file system dependency (#264
Browse files Browse the repository at this point in the history
)

* make the new broken type work, pass user, pass to tf

* cleanup logs, bump image

* Progress so far

* make state in machine object work

* Add and fix comments in vsphere provider
  • Loading branch information
karan authored and k8s-ci-robot committed Jun 1, 2018
1 parent 1f11e62 commit f104e0e
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 129 deletions.
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

0 comments on commit f104e0e

Please sign in to comment.